diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 23e0ed2a0c274..6eb3f46ce7e61 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -527,6 +527,7 @@ com.azure.resourcemanager:azure-resourcemanager-resources-deployments;1.0.0;1.1. com.azure.resourcemanager:azure-resourcemanager-resources-policy;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-resources-templatespecs;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-compute-workloadmanager;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-datatransfer;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.2;2.0.0-beta.2 diff --git a/pom.xml b/pom.xml index 3578c2983dd65..bc32ab32d42f0 100644 --- a/pom.xml +++ b/pom.xml @@ -87,6 +87,7 @@ sdk/datalakestore sdk/datamigration sdk/dataprotection + sdk/datatransfer sdk/defendereasm sdk/delegatednetwork sdk/dell diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/CHANGELOG.md b/sdk/datatransfer/azure-resourcemanager-datatransfer/CHANGELOG.md new file mode 100644 index 0000000000000..7cbd3cd599751 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/CHANGELOG.md @@ -0,0 +1,9 @@ +# Release History + +## 1.0.0-beta.1 (2026-10-23) + +- Azure Resource Manager Data Transfer client library for Java. This package contains Microsoft Azure SDK for Data Transfer Management SDK. Package api-version 2026-02-06-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-datatransfer Java SDK. + diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/README.md b/sdk/datatransfer/azure-resourcemanager-datatransfer/README.md new file mode 100644 index 0000000000000..1d33b692f8d0f --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager Data Transfer client library for Java + +Azure Resource Manager Data Transfer client library for Java. + +This package contains Microsoft Azure SDK for Data Transfer Management SDK. Package api-version 2026-02-06-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-datatransfer;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-datatransfer + 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(); +DataTransferManager manager = DataTransferManager + .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/datatransfer/azure-resourcemanager-datatransfer/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/datatransfer/azure-resourcemanager-datatransfer/SAMPLE.md b/sdk/datatransfer/azure-resourcemanager-datatransfer/SAMPLE.md new file mode 100644 index 0000000000000..092f22e040b54 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/SAMPLE.md @@ -0,0 +1,1282 @@ +# Code snippets and samples + + +## AzureDataTransfer + +- [ListApprovedSchemas](#azuredatatransfer_listapprovedschemas) +- [ListFlowProfiles](#azuredatatransfer_listflowprofiles) +- [ListPipelineMetadata](#azuredatatransfer_listpipelinemetadata) +- [ValidateSchema](#azuredatatransfer_validateschema) + +## Connections + +- [CreateOrUpdate](#connections_createorupdate) +- [Delete](#connections_delete) +- [GetByResourceGroup](#connections_getbyresourcegroup) +- [Link](#connections_link) +- [List](#connections_list) +- [ListByResourceGroup](#connections_listbyresourcegroup) +- [ListBySubscription](#connections_listbysubscription) +- [ListPendingFlowsList](#connections_listpendingflowslist) +- [Update](#connections_update) + +## FlowProfiles + +- [CreateOrUpdate](#flowprofiles_createorupdate) +- [Delete](#flowprofiles_delete) +- [Get](#flowprofiles_get) +- [ListByPipeline](#flowprofiles_listbypipeline) +- [Update](#flowprofiles_update) + +## Flows + +- [CreateOrUpdate](#flows_createorupdate) +- [Delete](#flows_delete) +- [Disable](#flows_disable) +- [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 + +- [ApproveConnection](#pipelines_approveconnection) +- [CreateOrUpdate](#pipelines_createorupdate) +- [Delete](#pipelines_delete) +- [ExecuteAction](#pipelines_executeaction) +- [GetByResourceGroup](#pipelines_getbyresourcegroup) +- [List](#pipelines_list) +- [ListByResourceGroup](#pipelines_listbyresourcegroup) +- [ListBySubscription](#pipelines_listbysubscription) +- [ListSchemasList](#pipelines_listschemaslist) +- [RejectConnection](#pipelines_rejectconnection) +- [Update](#pipelines_update) +### AzureDataTransfer_ListApprovedSchemas + +```java +import com.azure.resourcemanager.datatransfer.models.Direction; +import com.azure.resourcemanager.datatransfer.models.ListApprovedSchemasRequest; + +/** + * Samples for AzureDataTransfer ListApprovedSchemas. + */ +public final class AzureDataTransferListApprovedSchemasSamples { + /* + * x-ms-original-file: 2026-02-06-preview/postListApprovedSchemas.json + */ + /** + * Sample code: Performs action request. + * + * @param manager Entry point to DataTransferManager. + */ + public static void performsActionRequest(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.azureDataTransfers() + .listApprovedSchemasWithResponse( + new ListApprovedSchemasRequest().withPipeline("test").withDirection(Direction.SEND), + com.azure.core.util.Context.NONE); + } +} +``` + +### AzureDataTransfer_ListFlowProfiles + +```java +import com.azure.resourcemanager.datatransfer.models.ListFlowProfilesRequest; + +/** + * Samples for AzureDataTransfer ListFlowProfiles. + */ +public final class AzureDataTransferListFlowProfilesSamples { + /* + * x-ms-original-file: 2026-02-06-preview/AzureDataTransfer_ListFlowProfiles_MaximumSet_Gen.json + */ + /** + * Sample code: AzureDataTransfer_ListFlowProfiles_MaximumSet_Gen - generated by [MaximumSet] rule. + * + * @param manager Entry point to DataTransferManager. + */ + public static void azureDataTransferListFlowProfilesMaximumSetGenGeneratedByMaximumSetRule( + com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.azureDataTransfers() + .listFlowProfilesWithResponse(new ListFlowProfilesRequest(), com.azure.core.util.Context.NONE); + } +} +``` + +### AzureDataTransfer_ListPipelineMetadata + +```java +import com.azure.resourcemanager.datatransfer.models.ListPipelineMetadataRequest; + +/** + * Samples for AzureDataTransfer ListPipelineMetadata. + */ +public final class AzureDataTransferListPipelineMetadataSamples { + /* + * x-ms-original-file: 2026-02-06-preview/AzureDataTransfer_ListPipelineMetadata.json + */ + /** + * Sample code: AzureDataTransfer_ListPipelineMetadata. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + azureDataTransferListPipelineMetadata(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.azureDataTransfers() + .listPipelineMetadataWithResponse(new ListPipelineMetadataRequest().withPipeline("testPipeline"), + com.azure.core.util.Context.NONE); + } +} +``` + +### AzureDataTransfer_ValidateSchema + +```java +import com.azure.resourcemanager.datatransfer.models.Schema; + +/** + * Samples for AzureDataTransfer ValidateSchema. + */ +public final class AzureDataTransferValidateSchemaSamples { + /* + * x-ms-original-file: 2026-02-06-preview/postValidateSchema.json + */ + /** + * Sample code: Performs action request. + * + * @param manager Entry point to DataTransferManager. + */ + public static void performsActionRequest(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.azureDataTransfers() + .validateSchemaWithResponse(new Schema().withName("schema.xml"), com.azure.core.util.Context.NONE); + } +} +``` + +### Connections_CreateOrUpdate + +```java +import com.azure.resourcemanager.datatransfer.models.ConnectionProperties; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.FlowProfileMetadata; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import java.util.Arrays; + +/** + * Samples for Connections CreateOrUpdate. + */ +public final class ConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-02-06-preview/createOrUpdateConnection.json + */ + /** + * Sample code: Creates or updates the connection resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + createsOrUpdatesTheConnectionResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.connections() + .define("testConnection") + .withRegion("East US") + .withExistingResourceGroup("testRG") + .withProperties(new ConnectionProperties().withPipeline("testdc") + .withJustification("justification") + .withFlowProfileList(Arrays.asList( + new FlowProfileMetadata().withPipeline("pipelinea") + .withName("flowProfileNamea") + .withReplicationScenario(DataClassType.FILES) + .withFlowProfileId("25f2c41a-6e29-4c40-a033-b4de81d4a681") + .withStatus(FlowProfileStatus.ENABLED) + .withDescription("Testing 123"), + new FlowProfileMetadata().withPipeline("pipelinea") + .withName("flowProfileNameb") + .withReplicationScenario(DataClassType.FILES) + .withFlowProfileId("66b00598-cabb-4a85-b3d8-88905ac899b8") + .withStatus(FlowProfileStatus.ENABLED) + .withDescription("Testing 123"))) + .withRequirementId("id")) + .create(); + } +} +``` + +### Connections_Delete + +```java +/** + * Samples for Connections Delete. + */ +public final class ConnectionsDeleteSamples { + /* + * x-ms-original-file: 2026-02-06-preview/deleteConnection.json + */ + /** + * Sample code: Deletes the connection resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + deletesTheConnectionResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.connections().delete("testRG", "testConnection", com.azure.core.util.Context.NONE); + } +} +``` + +### Connections_GetByResourceGroup + +```java +/** + * Samples for Connections GetByResourceGroup. + */ +public final class ConnectionsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-02-06-preview/getConnection.json + */ + /** + * Sample code: Gets connection resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void getsConnectionResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.connections() + .getByResourceGroupWithResponse("testRG", "testConnection", com.azure.core.util.Context.NONE); + } +} +``` + +### Connections_Link + +```java +import com.azure.resourcemanager.datatransfer.models.ResourceBody; + +/** + * Samples for Connections Link. + */ +public final class ConnectionsLinkSamples { + /* + * x-ms-original-file: 2026-02-06-preview/linkConnection.json + */ + /** + * Sample code: Links the specified connection. + * + * @param manager Entry point to DataTransferManager. + */ + public static void linksTheSpecifiedConnection(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.connections() + .link("testRG", "testConnection", new ResourceBody().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.AzureDataTransfer/connections/testConnection"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Connections_List + +```java +/** + * Samples for Connections List. + */ +public final class ConnectionsListSamples { + /* + * x-ms-original-file: 2026-02-06-preview/listPendingConnections.json + */ + /** + * Sample code: Lists a list of pending connections. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + listsAListOfPendingConnections(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.connections().list("testRG", "testConnection", com.azure.core.util.Context.NONE); + } +} +``` + +### Connections_ListByResourceGroup + +```java +/** + * Samples for Connections ListByResourceGroup. + */ +public final class ConnectionsListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-02-06-preview/listConnectionsByResourceGroup.json + */ + /** + * Sample code: Gets connections in a resource group. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + getsConnectionsInAResourceGroup(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.connections().listByResourceGroup("testRG", com.azure.core.util.Context.NONE); + } +} +``` + +### Connections_ListBySubscription + +```java +/** + * Samples for Connections ListBySubscription. + */ +public final class ConnectionsListBySubscriptionSamples { + /* + * x-ms-original-file: 2026-02-06-preview/listConnectionsBySubscription.json + */ + /** + * Sample code: Gets connections in a subscription. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + getsConnectionsInASubscription(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.connections().listBySubscription(com.azure.core.util.Context.NONE); + } +} +``` + +### Connections_ListPendingFlowsList + +```java +/** + * Samples for Connections ListPendingFlowsList. + */ +public final class ConnectionsListPendingFlowsListSamples { + /* + * x-ms-original-file: 2026-02-06-preview/listPendingFlows.json + */ + /** + * Sample code: Lists a list of pending flows. + * + * @param manager Entry point to DataTransferManager. + */ + public static void listsAListOfPendingFlows(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.connections().listPendingFlowsList("testRG", "testConnection", com.azure.core.util.Context.NONE); + } +} +``` + +### Connections_Update + +```java +import com.azure.resourcemanager.datatransfer.models.ConnectionsPatch; + +/** + * Samples for Connections Update. + */ +public final class ConnectionsUpdateSamples { + /* + * x-ms-original-file: 2026-02-06-preview/patchConnection.json + */ + /** + * Sample code: Updates the connection resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + updatesTheConnectionResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.connections() + .update("testRG", "testConnection", new ConnectionsPatch(), com.azure.core.util.Context.NONE); + } +} +``` + +### FlowProfiles_CreateOrUpdate + +```java +import com.azure.resourcemanager.datatransfer.models.AntivirusRuleset; +import com.azure.resourcemanager.datatransfer.models.AntivirusSolutions; +import com.azure.resourcemanager.datatransfer.models.ArchiveRuleset; +import com.azure.resourcemanager.datatransfer.models.Casing; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.DataSizeRuleset; +import com.azure.resourcemanager.datatransfer.models.FilterType; +import com.azure.resourcemanager.datatransfer.models.FlowProfileProperties; +import com.azure.resourcemanager.datatransfer.models.FlowProfileRulesets; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.MatchType; +import com.azure.resourcemanager.datatransfer.models.MimeFilterRuleset; +import com.azure.resourcemanager.datatransfer.models.MimeTypeFilter; +import com.azure.resourcemanager.datatransfer.models.TextMatchingRuleset; +import com.azure.resourcemanager.datatransfer.models.TextMatchingRulesetDeny; +import com.azure.resourcemanager.datatransfer.models.XmlFilterRuleset; +import com.azure.resourcemanager.datatransfer.models.XmlReferenceType; +import java.util.Arrays; + +/** + * Samples for FlowProfiles CreateOrUpdate. + */ +public final class FlowProfilesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-02-06-preview/createOrUpdateFlowProfile.json + */ + /** + * Sample code: Creates or updates the FlowPRofile resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + createsOrUpdatesTheFlowPRofileResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flowProfiles() + .define("testFlowProfile") + .withRegion("East US") + .withExistingPipeline("testRG", "testPipeline") + .withProperties(new FlowProfileProperties().withReplicationScenario(DataClassType.FILES) + .withStatus(FlowProfileStatus.ENABLED) + .withDescription("Hello world description") + .withRulesets(new FlowProfileRulesets() + .withAntivirus(new AntivirusRuleset() + .withAvSolutions(Arrays.asList(AntivirusSolutions.DEFENDER, AntivirusSolutions.CLAM_AV))) + .withArchives(new ArchiveRuleset().withMinimumSizeForExpansion(1L) + .withMaximumExpansionSizeLimit(123456L) + .withMaximumDepthLimit(12L) + .withMaximumCompressionRatioLimit(123.0D)) + .withDataSize(new DataSizeRuleset().withMaximum(123456789L).withMinimum(1L)) + .withMimeFilters(new MimeFilterRuleset().withType(FilterType.ALLOW) + .withFilters(Arrays.asList(new MimeTypeFilter().withMedia("application/json") + .withExtensions(Arrays.asList(".json", ".app", ".js"))))) + .withXmlFilters(new XmlFilterRuleset().withDefaultNamespace("testnamespace") + .withReference(XmlReferenceType.INLINE) + .withSchema( + " ")) + .withTextMatching(new TextMatchingRuleset().withDeny(Arrays.asList( + new TextMatchingRulesetDeny().withText("hello world") + .withMatchType(MatchType.PARTIAL) + .withCaseSensitivity(Casing.INSENSITIVE), + new TextMatchingRulesetDeny().withText("hello") + .withMatchType(MatchType.COMPLETE) + .withCaseSensitivity(Casing.SENSITIVE)))))) + .create(); + } +} +``` + +### FlowProfiles_Delete + +```java +/** + * Samples for FlowProfiles Delete. + */ +public final class FlowProfilesDeleteSamples { + /* + * x-ms-original-file: 2026-02-06-preview/deleteFlowProfile.json + */ + /** + * Sample code: Deletes the flowprofile resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + deletesTheFlowprofileResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flowProfiles().delete("testRG", "testPipeline", "testFlowProfile", com.azure.core.util.Context.NONE); + } +} +``` + +### FlowProfiles_Get + +```java +/** + * Samples for FlowProfiles Get. + */ +public final class FlowProfilesGetSamples { + /* + * x-ms-original-file: 2026-02-06-preview/getFlowProfile.json + */ + /** + * Sample code: Gets flowprofile resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void getsFlowprofileResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flowProfiles() + .getWithResponse("testRG", "testPipeline", "testFlowProfile", com.azure.core.util.Context.NONE); + } +} +``` + +### FlowProfiles_ListByPipeline + +```java +/** + * Samples for FlowProfiles ListByPipeline. + */ +public final class FlowProfilesListByPipelineSamples { + /* + * x-ms-original-file: 2026-02-06-preview/listFlowProfilesByPipeline.json + */ + /** + * Sample code: Gets flows in a connection. + * + * @param manager Entry point to DataTransferManager. + */ + public static void getsFlowsInAConnection(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flowProfiles().listByPipeline("testRG", "testPipeline", com.azure.core.util.Context.NONE); + } +} +``` + +### FlowProfiles_Update + +```java +import com.azure.resourcemanager.datatransfer.models.FlowProfile; + +/** + * Samples for FlowProfiles Update. + */ +public final class FlowProfilesUpdateSamples { + /* + * x-ms-original-file: 2026-02-06-preview/patchFlowProfile.json + */ + /** + * Sample code: Updates the flowprofile resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + updatesTheFlowprofileResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + FlowProfile resource = manager.flowProfiles() + .getWithResponse("testRG", "testPipeline", "testFlowProfile", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } +} +``` + +### Flows_CreateOrUpdate + +```java +import com.azure.resourcemanager.datatransfer.fluent.models.FlowPropertiesInner; +import com.azure.resourcemanager.datatransfer.models.DataClass; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.FlowProfileMetadata; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.SelectedResource; + +/** + * Samples for Flows CreateOrUpdate. + */ +public final class FlowsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-02-06-preview/createOrUpdateFlow.json + */ + /** + * Sample code: Creates or updates the flow resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + createsOrUpdatesTheFlowResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows() + .define("testFlow") + .withRegion("East US") + .withExistingConnection("testRG", "testConnection") + .withProperties(new FlowPropertiesInner().withConnection(new SelectedResource().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.AzureDataTransfer/connections/testConnection")) + .withStorageAccountName("testsa") + .withStorageContainerName("testcontainer") + .withFlowProfile(new FlowProfileMetadata().withPipeline("testPipeline") + .withName("flowProfileName") + .withReplicationScenario(DataClassType.FILES) + .withFlowProfileId("25f2c41a-6e29-4c40-a033-b4de81d4a681") + .withStatus(FlowProfileStatus.ENABLED) + .withDescription("Testing 123")) + .withFlowDataType(DataClass.BLOB)) + .create(); + } +} +``` + +### Flows_Delete + +```java +/** + * Samples for Flows Delete. + */ +public final class FlowsDeleteSamples { + /* + * x-ms-original-file: 2026-02-06-preview/deleteFlow.json + */ + /** + * Sample code: Deletes the flow resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void deletesTheFlowResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows().delete("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_Disable + +```java +/** + * Samples for Flows Disable. + */ +public final class FlowsDisableSamples { + /* + * x-ms-original-file: 2026-02-06-preview/disableFlow.json + */ + /** + * Sample code: Disables the specified flow. + * + * @param manager Entry point to DataTransferManager. + */ + public static void disablesTheSpecifiedFlow(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows().disable("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_Enable + +```java +/** + * Samples for Flows Enable. + */ +public final class FlowsEnableSamples { + /* + * x-ms-original-file: 2026-02-06-preview/enableFlow.json + */ + /** + * Sample code: Enables the specified flow. + * + * @param manager Entry point to DataTransferManager. + */ + public static void enablesTheSpecifiedFlow(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows().enable("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_GeneratePassphrase + +```java +/** + * Samples for Flows GeneratePassphrase. + */ +public final class FlowsGeneratePassphraseSamples { + /* + * x-ms-original-file: 2026-02-06-preview/generateFlowPassphrase.json + */ + /** + * Sample code: Generate a new compliant streaming passphrase. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + generateANewCompliantStreamingPassphrase(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows().generatePassphrase("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_Get + +```java +/** + * Samples for Flows Get. + */ +public final class FlowsGetSamples { + /* + * x-ms-original-file: 2026-02-06-preview/getFlow.json + */ + /** + * Sample code: Gets flow resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void getsFlowResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows().getWithResponse("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_GetDestinationEndpointPorts + +```java +/** + * Samples for Flows GetDestinationEndpointPorts. + */ +public final class FlowsGetDestinationEndpointPortsSamples { + /* + * x-ms-original-file: 2026-02-06-preview/getFlowDestinationEndpointPorts.json + */ + /** + * Sample code: Get the flow stream destination endpoint ports. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + getTheFlowStreamDestinationEndpointPorts(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows() + .getDestinationEndpointPortsWithResponse("testRG", "testConnection", "testFlow", + com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_GetDestinationEndpoints + +```java +/** + * Samples for Flows GetDestinationEndpoints. + */ +public final class FlowsGetDestinationEndpointsSamples { + /* + * x-ms-original-file: 2026-02-06-preview/getFlowDestinationEndpoints.json + */ + /** + * Sample code: Get the flow stream destination endpoints. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + getTheFlowStreamDestinationEndpoints(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows() + .getDestinationEndpointsWithResponse("testRG", "testConnection", "testFlow", + com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_GetSourceAddresses + +```java +/** + * Samples for Flows GetSourceAddresses. + */ +public final class FlowsGetSourceAddressesSamples { + /* + * x-ms-original-file: 2026-02-06-preview/getFlowSourceAddresses.json + */ + /** + * Sample code: Get the flow stream source addresses. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + getTheFlowStreamSourceAddresses(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows() + .getSourceAddressesWithResponse("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_GetStreamConnectionString + +```java +/** + * Samples for Flows GetStreamConnectionString. + */ +public final class FlowsGetStreamConnectionStringSamples { + /* + * x-ms-original-file: 2026-02-06-preview/getStreamConnectionString.json + */ + /** + * Sample code: Get the flow stream connection string. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + getTheFlowStreamConnectionString(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows() + .getStreamConnectionStringWithResponse("testRG", "testConnection", "testFlow", + com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_Link + +```java +import com.azure.resourcemanager.datatransfer.models.ResourceBody; + +/** + * Samples for Flows Link. + */ +public final class FlowsLinkSamples { + /* + * x-ms-original-file: 2026-02-06-preview/linkFlow.json + */ + /** + * Sample code: Links the specified flow. + * + * @param manager Entry point to DataTransferManager. + */ + public static void linksTheSpecifiedFlow(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows() + .link("testRG", "testConnection", "testFlow", new ResourceBody().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.AzureDataTransfer/connections/testConnection/flows/testFlow"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_ListByConnection + +```java +/** + * Samples for Flows ListByConnection. + */ +public final class FlowsListByConnectionSamples { + /* + * x-ms-original-file: 2026-02-06-preview/listFlowsByConnection.json + */ + /** + * Sample code: Gets flows in a connection. + * + * @param manager Entry point to DataTransferManager. + */ + public static void getsFlowsInAConnection(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows().listByConnection("testRG", "testConnection", com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_SetDestinationEndpointPorts + +```java +import com.azure.resourcemanager.datatransfer.models.SetDestinationEndpointPorts; +import java.util.Arrays; + +/** + * Samples for Flows SetDestinationEndpointPorts. + */ +public final class FlowsSetDestinationEndpointPortsSamples { + /* + * x-ms-original-file: 2026-02-06-preview/setFlowDestinationEndpointPorts.json + */ + /** + * Sample code: Set the flow stream destination endpoint ports. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + setTheFlowStreamDestinationEndpointPorts(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows() + .setDestinationEndpointPorts("testRG", "testConnection", "testFlow", + new SetDestinationEndpointPorts().withPorts(Arrays.asList(1234L)), com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_SetDestinationEndpoints + +```java +import com.azure.resourcemanager.datatransfer.models.SetDestinationEndpoints; +import java.util.Arrays; + +/** + * Samples for Flows SetDestinationEndpoints. + */ +public final class FlowsSetDestinationEndpointsSamples { + /* + * x-ms-original-file: 2026-02-06-preview/setFlowDestinationEndpoints.json + */ + /** + * Sample code: Set the flow stream destination endpoints. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + setTheFlowStreamDestinationEndpoints(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows() + .setDestinationEndpoints("testRG", "testConnection", "testFlow", + new SetDestinationEndpoints().withEndpoints(Arrays.asList("10.0.0.1")), + com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_SetPassphrase + +```java +import com.azure.resourcemanager.datatransfer.models.SetStreamPassphrase; + +/** + * Samples for Flows SetPassphrase. + */ +public final class FlowsSetPassphraseSamples { + /* + * x-ms-original-file: 2026-02-06-preview/setFlowPassphrase.json + */ + /** + * Sample code: Set the flow stream passphrase. + * + * @param manager Entry point to DataTransferManager. + */ + public static void setTheFlowStreamPassphrase(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows() + .setPassphrase("testRG", "testConnection", "testFlow", new SetStreamPassphrase().withValue("password123"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_SetSourceAddresses + +```java +import com.azure.resourcemanager.datatransfer.models.SetSourceAddresses; +import java.util.Arrays; + +/** + * Samples for Flows SetSourceAddresses. + */ +public final class FlowsSetSourceAddressesSamples { + /* + * x-ms-original-file: 2026-02-06-preview/setFlowSourceAddresses.json + */ + /** + * Sample code: Set the flow stream source addresses. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + setTheFlowStreamSourceAddresses(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows() + .setSourceAddresses("testRG", "testConnection", "testFlow", + new SetSourceAddresses().withValues(Arrays.asList("0.0.0.0", "1.0.0.0/24")), + com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_Update + +```java +import com.azure.resourcemanager.datatransfer.models.FlowsPatch; + +/** + * Samples for Flows Update. + */ +public final class FlowsUpdateSamples { + /* + * x-ms-original-file: 2026-02-06-preview/patchFlow.json + */ + /** + * Sample code: Updates the flow resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void updatesTheFlowResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows() + .update("testRG", "testConnection", "testFlow", new FlowsPatch(), com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2026-02-06-preview/listOperations.json + */ + /** + * Sample code: List operations. + * + * @param manager Entry point to DataTransferManager. + */ + public static void listOperations(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Pipelines_ApproveConnection + +```java +import com.azure.resourcemanager.datatransfer.models.ResourceBody; + +/** + * Samples for Pipelines ApproveConnection. + */ +public final class PipelinesApproveConnectionSamples { + /* + * x-ms-original-file: 2026-02-06-preview/approveConnection.json + */ + /** + * Sample code: Approves the specified connection in a pipeline. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + approvesTheSpecifiedConnectionInAPipeline(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.pipelines() + .approveConnection("testRG", "testPipeline", new ResourceBody().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.AzureDataTransfer/connections/testConnection") + .withStatusReason("Example reason"), com.azure.core.util.Context.NONE); + } +} +``` + +### Pipelines_CreateOrUpdate + +```java +import com.azure.resourcemanager.datatransfer.models.PipelineProperties; + +/** + * Samples for Pipelines CreateOrUpdate. + */ +public final class PipelinesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-02-06-preview/createOrUpdatePipeline.json + */ + /** + * Sample code: Creates or updates the pipeline resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + createsOrUpdatesThePipelineResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.pipelines() + .define("testPipeline") + .withRegion("East US") + .withExistingResourceGroup("testRG") + .withProperties(new PipelineProperties().withRemoteCloud("testdc")) + .create(); + } +} +``` + +### Pipelines_Delete + +```java +/** + * Samples for Pipelines Delete. + */ +public final class PipelinesDeleteSamples { + /* + * x-ms-original-file: 2026-02-06-preview/deletePipeline.json + */ + /** + * Sample code: Deletes the pipeline resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void deletesThePipelineResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.pipelines().delete("testRG", "testPipeline", com.azure.core.util.Context.NONE); + } +} +``` + +### Pipelines_ExecuteAction + +```java +import com.azure.resourcemanager.datatransfer.models.Action; +import com.azure.resourcemanager.datatransfer.models.DateTransferActionType; +import com.azure.resourcemanager.datatransfer.models.TargetType; +import java.util.Arrays; + +/** + * Samples for Pipelines ExecuteAction. + */ +public final class PipelinesExecuteActionSamples { + /* + * x-ms-original-file: 2026-02-06-preview/executeAction.json + */ + /** + * Sample code: Executes action for a pipeline. + * + * @param manager Entry point to DataTransferManager. + */ + public static void executesActionForAPipeline(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.pipelines() + .executeAction("testRG", "testPipeline", new Action().withActionType(DateTransferActionType.FORCE_DISABLE) + .withTargetType(TargetType.CONNECTION) + .withTargets(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.AzureDataTransfer/connections/testConnection")), + com.azure.core.util.Context.NONE); + } +} +``` + +### Pipelines_GetByResourceGroup + +```java +/** + * Samples for Pipelines GetByResourceGroup. + */ +public final class PipelinesGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-02-06-preview/getPipeline.json + */ + /** + * Sample code: Gets pipeline resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void getsPipelineResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.pipelines().getByResourceGroupWithResponse("testRG", "testPipeline", com.azure.core.util.Context.NONE); + } +} +``` + +### Pipelines_List + +```java +import com.azure.resourcemanager.datatransfer.models.ConnectionIdList; +import java.util.Arrays; + +/** + * Samples for Pipelines List. + */ +public final class PipelinesListSamples { + /* + * x-ms-original-file: 2026-02-06-preview/listFlowsByPipeline.json + */ + /** + * Sample code: Lists flows for a pipeline. + * + * @param manager Entry point to DataTransferManager. + */ + public static void listsFlowsForAPipeline(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.pipelines() + .listWithResponse("testRG", "testPipeline", new ConnectionIdList().withValue(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.AzureDataTransfer/connections/testConnection")), + com.azure.core.util.Context.NONE); + } +} +``` + +### Pipelines_ListByResourceGroup + +```java +/** + * Samples for Pipelines ListByResourceGroup. + */ +public final class PipelinesListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-02-06-preview/listPipelinesByResourceGroup.json + */ + /** + * Sample code: Gets pipelines in a resource group. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + getsPipelinesInAResourceGroup(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.pipelines().listByResourceGroup("testRG", com.azure.core.util.Context.NONE); + } +} +``` + +### Pipelines_ListBySubscription + +```java +/** + * Samples for Pipelines ListBySubscription. + */ +public final class PipelinesListBySubscriptionSamples { + /* + * x-ms-original-file: 2026-02-06-preview/listPipelinesBySubscription.json + */ + /** + * Sample code: Gets pipelines in a subscription. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + getsPipelinesInASubscription(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.pipelines().listBySubscription(com.azure.core.util.Context.NONE); + } +} +``` + +### Pipelines_ListSchemasList + +```java +import com.azure.resourcemanager.datatransfer.models.Schema; + +/** + * Samples for Pipelines ListSchemasList. + */ +public final class PipelinesListSchemasListSamples { + /* + * x-ms-original-file: 2026-02-06-preview/listSchemas.json + */ + /** + * Sample code: Lists schemas for a pipeline. + * + * @param manager Entry point to DataTransferManager. + */ + public static void listsSchemasForAPipeline(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.pipelines() + .listSchemasListWithResponse("testRG", "testPipeline", new Schema().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.AzureDataTransfer/connections/testConnection") + .withName("test.xsd"), com.azure.core.util.Context.NONE); + } +} +``` + +### Pipelines_RejectConnection + +```java +import com.azure.resourcemanager.datatransfer.models.ResourceBody; + +/** + * Samples for Pipelines RejectConnection. + */ +public final class PipelinesRejectConnectionSamples { + /* + * x-ms-original-file: 2026-02-06-preview/rejectConnection.json + */ + /** + * Sample code: Rejects the specified connection in a pipeline. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + rejectsTheSpecifiedConnectionInAPipeline(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.pipelines() + .rejectConnection("testRG", "testPipeline", new ResourceBody().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.AzureDataTransfer/connections/testConnection") + .withStatusReason("Example reason"), com.azure.core.util.Context.NONE); + } +} +``` + +### Pipelines_Update + +```java +import com.azure.resourcemanager.datatransfer.models.PipelinesPatch; + +/** + * Samples for Pipelines Update. + */ +public final class PipelinesUpdateSamples { + /* + * x-ms-original-file: 2026-02-06-preview/patchPipeline.json + */ + /** + * Sample code: Updates the pipeline resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void updatesThePipelineResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.pipelines().update("testRG", "testPipeline", new PipelinesPatch(), com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/pom.xml b/sdk/datatransfer/azure-resourcemanager-datatransfer/pom.xml new file mode 100644 index 0000000000000..be682228fba73 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/pom.xml @@ -0,0 +1,74 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-datatransfer + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Data Transfer Management + This package contains Microsoft Azure SDK for Data Transfer Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package api-version 2026-02-06-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.60.0 + + + com.azure + azure-core-management + 1.19.8 + + + com.azure + azure-core-test + 1.27.0-beta.19 + test + + + com.azure + azure-identity + 1.18.7 + test + + + diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/DataTransferManager.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/DataTransferManager.java new file mode 100644 index 0000000000000..6b2acc5049fff --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/DataTransferManager.java @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer; + +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.datatransfer.fluent.DataTransferManagementClient; +import com.azure.resourcemanager.datatransfer.implementation.AzureDataTransfersImpl; +import com.azure.resourcemanager.datatransfer.implementation.ConnectionsImpl; +import com.azure.resourcemanager.datatransfer.implementation.DataTransferManagementClientBuilder; +import com.azure.resourcemanager.datatransfer.implementation.FlowProfilesImpl; +import com.azure.resourcemanager.datatransfer.implementation.FlowsImpl; +import com.azure.resourcemanager.datatransfer.implementation.OperationsImpl; +import com.azure.resourcemanager.datatransfer.implementation.PipelinesImpl; +import com.azure.resourcemanager.datatransfer.models.AzureDataTransfers; +import com.azure.resourcemanager.datatransfer.models.Connections; +import com.azure.resourcemanager.datatransfer.models.FlowProfiles; +import com.azure.resourcemanager.datatransfer.models.Flows; +import com.azure.resourcemanager.datatransfer.models.Operations; +import com.azure.resourcemanager.datatransfer.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 DataTransferManager. + */ +public final class DataTransferManager { + private Operations operations; + + private FlowProfiles flowProfiles; + + private Pipelines pipelines; + + private Connections connections; + + private Flows flows; + + private AzureDataTransfers azureDataTransfers; + + private final DataTransferManagementClient clientObject; + + private DataTransferManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new DataTransferManagementClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Data Transfer service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Data Transfer service API instance. + */ + public static DataTransferManager 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 Data Transfer service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Data Transfer service API instance. + */ + public static DataTransferManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new DataTransferManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create DataTransferManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new DataTransferManager.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-datatransfer.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 Data Transfer service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Data Transfer service API instance. + */ + public DataTransferManager 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.datatransfer") + .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 DataTransferManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of FlowProfiles. It manages FlowProfile. + * + * @return Resource collection API of FlowProfiles. + */ + public FlowProfiles flowProfiles() { + if (this.flowProfiles == null) { + this.flowProfiles = new FlowProfilesImpl(clientObject.getFlowProfiles(), this); + } + return flowProfiles; + } + + /** + * 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 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 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 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 wrapped service client DataTransferManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + * + * @return Wrapped service client DataTransferManagementClient. + */ + public DataTransferManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/AzureDataTransfersClient.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/AzureDataTransfersClient.java new file mode 100644 index 0000000000000..a779cbe159dbe --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/AzureDataTransfersClient.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.fluent.models.FlowProfilesListResultInner; +import com.azure.resourcemanager.datatransfer.fluent.models.ListPipelineMetadataResultInner; +import com.azure.resourcemanager.datatransfer.fluent.models.SchemasListResultInner; +import com.azure.resourcemanager.datatransfer.fluent.models.ValidateSchemaResultInner; +import com.azure.resourcemanager.datatransfer.models.ListApprovedSchemasRequest; +import com.azure.resourcemanager.datatransfer.models.ListFlowProfilesRequest; +import com.azure.resourcemanager.datatransfer.models.ListPipelineMetadataRequest; +import com.azure.resourcemanager.datatransfer.models.Schema; + +/** + * An instance of this class provides access to all the operations defined in AzureDataTransfersClient. + */ +public interface AzureDataTransfersClient { + /** + * Retrieves the list of approved schemas available for Azure Data Transfer. This operation has reached end of life + * support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile resource. + * + * @param pipeline The request payload for listing approved schemas. + * @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 pipeline, + Context context); + + /** + * Retrieves the list of approved schemas available for Azure Data Transfer. This operation has reached end of life + * support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile resource. + * + * @param pipeline The request payload for listing approved schemas. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 pipeline); + + /** + * Retrieves a list of FlowProfile resources associated with a specified pipeline. + * + * @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 flow profiles list result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listFlowProfilesWithResponse(ListFlowProfilesRequest body, Context context); + + /** + * Retrieves a list of FlowProfile resources associated with a specified pipeline. + * + * @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 flow profiles list result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowProfilesListResultInner listFlowProfiles(ListFlowProfilesRequest body); + + /** + * Validates the structure and content of a schema for use in Azure Data Transfer. This operation has reached end of + * life support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile + * resource. + * + * @param schema 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 schema, Context context); + + /** + * Validates the structure and content of a schema for use in Azure Data Transfer. This operation has reached end of + * life support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile + * resource. + * + * @param schema 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 schema); + + /** + * Retrieves the pipeline metadata associated with a specified pipeline. + * + * @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 defines the response body for retrieving Pipeline metadata for a provided pipeline along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listPipelineMetadataWithResponse(ListPipelineMetadataRequest body, + Context context); + + /** + * Retrieves the pipeline metadata associated with a specified pipeline. + * + * @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 defines the response body for retrieving Pipeline metadata for a provided pipeline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ListPipelineMetadataResultInner listPipelineMetadata(ListPipelineMetadataRequest body); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/ConnectionsClient.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/ConnectionsClient.java new file mode 100644 index 0000000000000..af1b337c2b3bd --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/ConnectionsClient.java @@ -0,0 +1,384 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.fluent.models.ConnectionInner; +import com.azure.resourcemanager.datatransfer.fluent.models.PendingConnectionInner; +import com.azure.resourcemanager.datatransfer.fluent.models.PendingFlowInner; +import com.azure.resourcemanager.datatransfer.models.ConnectionsPatch; +import com.azure.resourcemanager.datatransfer.models.ResourceBody; + +/** + * An instance of this class provides access to all the operations defined in ConnectionsClient. + */ +public interface ConnectionsClient { + /** + * Gets connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @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 to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 to perform the operation on. + * @param connection 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> beginCreateOrUpdate(String resourceGroupName, + String connectionName, ConnectionInner connection); + + /** + * 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 to perform the operation on. + * @param connection 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> beginCreateOrUpdate(String resourceGroupName, + String connectionName, ConnectionInner connection, 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 to perform the operation on. + * @param connection 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 connection); + + /** + * 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 to perform the operation on. + * @param connection 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 createOrUpdate(String resourceGroupName, String connectionName, ConnectionInner connection, + 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 to perform the operation on. + * @param connection 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, Void> beginUpdate(String resourceGroupName, String connectionName, + ConnectionsPatch connection); + + /** + * Updates the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param connection 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, Void> beginUpdate(String resourceGroupName, String connectionName, + ConnectionsPatch connection, 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 to perform the operation on. + * @param connection 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void update(String resourceGroupName, String connectionName, ConnectionsPatch connection); + + /** + * Updates the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param connection 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void update(String resourceGroupName, String connectionName, ConnectionsPatch connection, 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 to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 to perform the operation on. + * @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 to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 to perform the operation on. + * @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); + + /** + * 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 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); + + /** + * 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 to perform the operation on. + * @param connection 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 connection); + + /** + * 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 to perform the operation on. + * @param connection 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 connection, 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 to perform the operation on. + * @param connection 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 connection); + + /** + * 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 to perform the operation on. + * @param connection 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 connection, Context context); + + /** + * Lists all pending remote connections that are linkable to this connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom response of a list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String connectionName); + + /** + * Lists all pending remote connections that are linkable to this connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @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 custom response of a list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String connectionName, Context context); + + /** + * Lists all remote flows that have not yet been linked to local flows. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom response of a list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPendingFlowsList(String resourceGroupName, String connectionName); + + /** + * Lists all remote flows that have not yet been linked to local flows. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @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 custom response of a list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPendingFlowsList(String resourceGroupName, String connectionName, + Context context); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/DataTransferManagementClient.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/DataTransferManagementClient.java new file mode 100644 index 0000000000000..e1e12ffe8a5da --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/DataTransferManagementClient.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for DataTransferManagementClient class. + */ +public interface DataTransferManagementClient { + /** + * Gets Service host. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the FlowProfilesClient object to access its operations. + * + * @return the FlowProfilesClient object. + */ + FlowProfilesClient getFlowProfiles(); + + /** + * Gets the PipelinesClient object to access its operations. + * + * @return the PipelinesClient object. + */ + PipelinesClient getPipelines(); + + /** + * Gets the ConnectionsClient object to access its operations. + * + * @return the ConnectionsClient object. + */ + ConnectionsClient getConnections(); + + /** + * Gets the FlowsClient object to access its operations. + * + * @return the FlowsClient object. + */ + FlowsClient getFlows(); + + /** + * Gets the AzureDataTransfersClient object to access its operations. + * + * @return the AzureDataTransfersClient object. + */ + AzureDataTransfersClient getAzureDataTransfers(); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/FlowProfilesClient.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/FlowProfilesClient.java new file mode 100644 index 0000000000000..8968a88ed412e --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/FlowProfilesClient.java @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.fluent.models.FlowProfileInner; +import com.azure.resourcemanager.datatransfer.models.FlowProfilePatch; + +/** + * An instance of this class provides access to all the operations defined in FlowProfilesClient. + */ +public interface FlowProfilesClient { + /** + * Retrieves the specified FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @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 represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String pipelineName, String flowProfileName, + Context context); + + /** + * Retrieves the specified FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowProfileInner get(String resourceGroupName, String pipelineName, String flowProfileName); + + /** + * Creates a new FlowProfile or updates an existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param resource The FlowProfile resource definition to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 represents a FlowProfile Azure resource, which defines a data + * replication scenario with a specific data classification and a set of configurable policy rules. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FlowProfileInner> beginCreateOrUpdate(String resourceGroupName, + String pipelineName, String flowProfileName, FlowProfileInner resource); + + /** + * Creates a new FlowProfile or updates an existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param resource The FlowProfile resource definition to create or update. + * @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 represents a FlowProfile Azure resource, which defines a data + * replication scenario with a specific data classification and a set of configurable policy rules. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FlowProfileInner> beginCreateOrUpdate(String resourceGroupName, + String pipelineName, String flowProfileName, FlowProfileInner resource, Context context); + + /** + * Creates a new FlowProfile or updates an existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param resource The FlowProfile resource definition to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowProfileInner createOrUpdate(String resourceGroupName, String pipelineName, String flowProfileName, + FlowProfileInner resource); + + /** + * Creates a new FlowProfile or updates an existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param resource The FlowProfile resource definition to create or update. + * @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 represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowProfileInner createOrUpdate(String resourceGroupName, String pipelineName, String flowProfileName, + FlowProfileInner resource, Context context); + + /** + * Applies partial updates to an existing FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param properties The FlowProfile patch definition containing the properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 represents a FlowProfile Azure resource, which defines a data + * replication scenario with a specific data classification and a set of configurable policy rules. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FlowProfileInner> beginUpdate(String resourceGroupName, + String pipelineName, String flowProfileName, FlowProfilePatch properties); + + /** + * Applies partial updates to an existing FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param properties The FlowProfile patch definition containing the properties to update. + * @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 represents a FlowProfile Azure resource, which defines a data + * replication scenario with a specific data classification and a set of configurable policy rules. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FlowProfileInner> beginUpdate(String resourceGroupName, + String pipelineName, String flowProfileName, FlowProfilePatch properties, Context context); + + /** + * Applies partial updates to an existing FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param properties The FlowProfile patch definition containing the properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowProfileInner update(String resourceGroupName, String pipelineName, String flowProfileName, + FlowProfilePatch properties); + + /** + * Applies partial updates to an existing FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param properties The FlowProfile patch definition containing the properties to update. + * @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 represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowProfileInner update(String resourceGroupName, String pipelineName, String flowProfileName, + FlowProfilePatch properties, Context context); + + /** + * Deletes the specified FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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, + String flowProfileName); + + /** + * Deletes the specified FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @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, + String flowProfileName, Context context); + + /** + * Deletes the specified FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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, String flowProfileName); + + /** + * Deletes the specified FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @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, String flowProfileName, Context context); + + /** + * Lists all FlowProfiles under a given Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 FlowProfile list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPipeline(String resourceGroupName, String pipelineName); + + /** + * Lists all FlowProfiles under a given Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @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 FlowProfile list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPipeline(String resourceGroupName, String pipelineName, Context context); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/FlowsClient.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/FlowsClient.java new file mode 100644 index 0000000000000..5664375437f1a --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/FlowsClient.java @@ -0,0 +1,903 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.fluent.models.FlowInner; +import com.azure.resourcemanager.datatransfer.fluent.models.GetDestinationEndpointPortsResultInner; +import com.azure.resourcemanager.datatransfer.fluent.models.GetDestinationEndpointsResultInner; +import com.azure.resourcemanager.datatransfer.fluent.models.GetStreamConnectionStringResultInner; +import com.azure.resourcemanager.datatransfer.fluent.models.StreamSourceAddressesInner; +import com.azure.resourcemanager.datatransfer.models.FlowsPatch; +import com.azure.resourcemanager.datatransfer.models.ResourceBody; +import com.azure.resourcemanager.datatransfer.models.SetDestinationEndpointPorts; +import com.azure.resourcemanager.datatransfer.models.SetDestinationEndpoints; +import com.azure.resourcemanager.datatransfer.models.SetSourceAddresses; +import com.azure.resourcemanager.datatransfer.models.SetStreamPassphrase; + +/** + * An instance of this class provides access to all the operations defined in FlowsClient. + */ +public interface FlowsClient { + /** + * Gets flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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> beginCreateOrUpdate(String resourceGroupName, String connectionName, + String flowName, FlowInner flow); + + /** + * 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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> beginCreateOrUpdate(String resourceGroupName, String connectionName, + String flowName, FlowInner flow, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 flow); + + /** + * 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 createOrUpdate(String resourceGroupName, String connectionName, String flowName, FlowInner flow, + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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, Void> beginUpdate(String resourceGroupName, String connectionName, String flowName, + FlowsPatch flow); + + /** + * Updates the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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, Void> beginUpdate(String resourceGroupName, String connectionName, String flowName, + FlowsPatch flow, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void update(String resourceGroupName, String connectionName, String flowName, FlowsPatch flow); + + /** + * Updates the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void update(String resourceGroupName, String connectionName, String flowName, FlowsPatch flow, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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); + + /** + * 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 to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 to perform the operation on. + * @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); + + /** + * Disables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GetDestinationEndpointPortsResultInner getDestinationEndpointPorts(String resourceGroupName, String connectionName, + String flowName); + + /** + * Get the destination endpoints for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 flow); + + /** + * Links the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 flow, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 flow); + + /** + * Links the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 flow, + Context context); + + /** + * Set the destination endpoint ports for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpointPorts The 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 streamDestinationEndpointPorts); + + /** + * Set the destination endpoint ports for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpointPorts The 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 streamDestinationEndpointPorts, + Context context); + + /** + * Set the destination endpoint ports for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpointPorts The 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 streamDestinationEndpointPorts); + + /** + * Set the destination endpoint ports for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpointPorts The 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 streamDestinationEndpointPorts, Context context); + + /** + * Set the destination endpoints for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpoints 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 streamDestinationEndpoints); + + /** + * Set the destination endpoints for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpoints 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 streamDestinationEndpoints, Context context); + + /** + * Set the destination endpoints for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpoints 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 streamDestinationEndpoints); + + /** + * Set the destination endpoints for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpoints 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 streamDestinationEndpoints, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param passphrase 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 passphrase); + + /** + * 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param passphrase 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 passphrase, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param passphrase 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 passphrase); + + /** + * 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param passphrase 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 passphrase, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param sourceAddresses 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 sourceAddresses); + + /** + * 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param sourceAddresses 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 sourceAddresses, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param sourceAddresses 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 sourceAddresses); + + /** + * 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param sourceAddresses 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 sourceAddresses, Context context); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/OperationsClient.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/OperationsClient.java new file mode 100644 index 0000000000000..96d697c9a268d --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/OperationsClient.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/PipelinesClient.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/PipelinesClient.java new file mode 100644 index 0000000000000..3a9dbe53befb6 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/PipelinesClient.java @@ -0,0 +1,524 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.fluent.models.ConnectionInner; +import com.azure.resourcemanager.datatransfer.fluent.models.ListFlowsByPipelineResultInner; +import com.azure.resourcemanager.datatransfer.fluent.models.PipelineInner; +import com.azure.resourcemanager.datatransfer.fluent.models.SchemasListResultInner; +import com.azure.resourcemanager.datatransfer.models.Action; +import com.azure.resourcemanager.datatransfer.models.ConnectionIdList; +import com.azure.resourcemanager.datatransfer.models.PipelinesPatch; +import com.azure.resourcemanager.datatransfer.models.ResourceBody; +import com.azure.resourcemanager.datatransfer.models.Schema; + +/** + * An instance of this class provides access to all the operations defined in PipelinesClient. + */ +public interface PipelinesClient { + /** + * Retrieves the specified Pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String pipelineName, + Context context); + + /** + * Retrieves the specified Pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 getByResourceGroup(String resourceGroupName, String pipelineName); + + /** + * Creates a new Pipeline resource or updates an existing one. This operation is asynchronous and returns the + * resulting Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the Pipeline definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 pipeline); + + /** + * Creates a new Pipeline resource or updates an existing one. This operation is asynchronous and returns the + * resulting Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the Pipeline definition. + * @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 pipeline, Context context); + + /** + * Creates a new Pipeline resource or updates an existing one. This operation is asynchronous and returns the + * resulting Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the Pipeline definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 pipeline); + + /** + * Creates a new Pipeline resource or updates an existing one. This operation is asynchronous and returns the + * resulting Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the Pipeline definition. + * @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 pipeline, + Context context); + + /** + * Applies partial updates to an existing Pipeline resource. This operation supports patch semantics and returns the + * updated Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the updated Pipeline properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpdate(String resourceGroupName, String pipelineName, + PipelinesPatch pipeline); + + /** + * Applies partial updates to an existing Pipeline resource. This operation supports patch semantics and returns the + * updated Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the updated Pipeline properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpdate(String resourceGroupName, String pipelineName, + PipelinesPatch pipeline, Context context); + + /** + * Applies partial updates to an existing Pipeline resource. This operation supports patch semantics and returns the + * updated Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the updated Pipeline properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void update(String resourceGroupName, String pipelineName, PipelinesPatch pipeline); + + /** + * Applies partial updates to an existing Pipeline resource. This operation supports patch semantics and returns the + * updated Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the updated Pipeline properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void update(String resourceGroupName, String pipelineName, PipelinesPatch pipeline, Context context); + + /** + * Deletes the specified Pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 specified Pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @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 specified Pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 specified Pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @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); + + /** + * Lists all Pipeline resources within the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Pipeline resources within the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all Pipeline resources within the current subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscription(); + + /** + * Lists all Pipeline resources within the current subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscription(Context context); + + /** + * Approves a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to approve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 connection); + + /** + * Approves a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to approve. + * @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 connection, Context context); + + /** + * Approves a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to approve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 connection); + + /** + * Approves a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to approve. + * @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 connection, + Context context); + + /** + * Executes a privileged or administrative action on the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param action The action to be executed on the Pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 action); + + /** + * Executes a privileged or administrative action on the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param action The action to be executed on the Pipeline. + * @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 action, Context context); + + /** + * Executes a privileged or administrative action on the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param action The action to be executed on the Pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 action); + + /** + * Executes a privileged or administrative action on the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param action The action to be executed on the Pipeline. + * @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 action, Context context); + + /** + * Lists all Flows associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connections A list of connection identifiers used to filter the Flows to be retrieved. + * @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 all Flows associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 associated with a specific connection in the Pipeline. This operation has reached end of life + * support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param schema The schema(s) to retrieve for the specified 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 schemas list result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listSchemasListWithResponse(String resourceGroupName, String pipelineName, + Schema schema, Context context); + + /** + * Lists the schemas associated with a specific connection in the Pipeline. This operation has reached end of life + * support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param schema The schema(s) to retrieve for the specified connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 schema); + + /** + * Rejects a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to reject. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 connection); + + /** + * Rejects a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to reject. + * @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 connection, Context context); + + /** + * Rejects a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to reject. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 connection); + + /** + * Rejects a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to reject. + * @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 connection, + Context context); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/ConnectionInner.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/ConnectionInner.java new file mode 100644 index 0000000000000..5eacbd36117b3 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/ConnectionInner.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.models.ConnectionProperties; +import com.azure.resourcemanager.datatransfer.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; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/FlowInner.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/FlowInner.java new file mode 100644 index 0000000000000..9e0194365262e --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/FlowInner.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.datatransfer.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; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/FlowProfileInner.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/FlowProfileInner.java new file mode 100644 index 0000000000000..0b74f21246a01 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/FlowProfileInner.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.models.FlowProfileProperties; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentity; +import java.io.IOException; +import java.util.Map; + +/** + * Represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules. + */ +@Fluent +public final class FlowProfileInner extends Resource { + /* + * The set of configuration properties that define the behavior and rules of the FlowProfile. + */ + private FlowProfileProperties 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 FlowProfileInner class. + */ + public FlowProfileInner() { + } + + /** + * Get the properties property: The set of configuration properties that define the behavior and rules of the + * FlowProfile. + * + * @return the properties value. + */ + public FlowProfileProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The set of configuration properties that define the behavior and rules of the + * FlowProfile. + * + * @param properties the properties value to set. + * @return the FlowProfileInner object itself. + */ + public FlowProfileInner withProperties(FlowProfileProperties 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 FlowProfileInner object itself. + */ + public FlowProfileInner 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 FlowProfileInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FlowProfileInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlowProfileInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlowProfileInner 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 FlowProfileInner. + */ + public static FlowProfileInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlowProfileInner deserializedFlowProfileInner = new FlowProfileInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFlowProfileInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFlowProfileInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFlowProfileInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedFlowProfileInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedFlowProfileInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedFlowProfileInner.properties = FlowProfileProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedFlowProfileInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedFlowProfileInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFlowProfileInner; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/FlowProfilesListResultInner.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/FlowProfilesListResultInner.java new file mode 100644 index 0000000000000..a0713f55f5e04 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/FlowProfilesListResultInner.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datatransfer.models.FlowProfileMetadata; +import java.io.IOException; +import java.util.List; + +/** + * The flow profiles list result. + */ +@Immutable +public final class FlowProfilesListResultInner implements JsonSerializable { + /* + * FlowProfileMetadata array. + */ + private List value; + + /** + * Creates an instance of FlowProfilesListResultInner class. + */ + private FlowProfilesListResultInner() { + } + + /** + * Get the value property: FlowProfileMetadata array. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * {@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 FlowProfilesListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlowProfilesListResultInner 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 FlowProfilesListResultInner. + */ + public static FlowProfilesListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlowProfilesListResultInner deserializedFlowProfilesListResultInner = new FlowProfilesListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> FlowProfileMetadata.fromJson(reader1)); + deserializedFlowProfilesListResultInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedFlowProfilesListResultInner; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/FlowPropertiesInner.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/FlowPropertiesInner.java new file mode 100644 index 0000000000000..9f6ac60725690 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/FlowPropertiesInner.java @@ -0,0 +1,900 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.models.ApiFlowOptions; +import com.azure.resourcemanager.datatransfer.models.DataClass; +import com.azure.resourcemanager.datatransfer.models.DataType; +import com.azure.resourcemanager.datatransfer.models.FlowProfileMetadata; +import com.azure.resourcemanager.datatransfer.models.FlowStatus; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ForceDisabledStatus; +import com.azure.resourcemanager.datatransfer.models.LinkStatus; +import com.azure.resourcemanager.datatransfer.models.MessagingOptions; +import com.azure.resourcemanager.datatransfer.models.ProvisioningState; +import com.azure.resourcemanager.datatransfer.models.Schema; +import com.azure.resourcemanager.datatransfer.models.SelectedResource; +import com.azure.resourcemanager.datatransfer.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; + + /* + * URI to a Key Vault Secret containing a 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; + + /* + * Type of FlowProfile to use for transfer via the flow. + */ + private FlowProfileMetadata flowProfile; + + /* + * The Flow's data class. + */ + private DataClass flowDataType; + + /* + * The flow type for this flow. The property has reached end of life support starting version 2025-05-30-preview. + * Please create and use a FlowProfile resource instead. + */ + private FlowType flowType; + + /* + * Type of data to transfer via the flow. The property has reached end of life support starting version + * 2025-05-30-preview. Please create and use a FlowProfile resource instead. + */ + private DataType dataType; + + /* + * Provisioning state of the flow + */ + private ProvisioningState provisioningState; + + /* + * The policies for this flow. The property has reached end of life support starting version 2025-05-30-preview. + * Please create and use a FlowProfile resource instead. + */ + private List policies; + + /* + * The selected schema for this flow. The property has reached end of life support starting version + * 2025-05-30-preview. Please create and use a FlowProfile resource instead. + */ + 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: URI to a Key Vault Secret containing a SAS token. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the keyVaultUri property: URI to a Key Vault Secret containing a 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 flowProfile property: Type of FlowProfile to use for transfer via the flow. + * + * @return the flowProfile value. + */ + public FlowProfileMetadata flowProfile() { + return this.flowProfile; + } + + /** + * Set the flowProfile property: Type of FlowProfile to use for transfer via the flow. + * + * @param flowProfile the flowProfile value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withFlowProfile(FlowProfileMetadata flowProfile) { + this.flowProfile = flowProfile; + return this; + } + + /** + * Get the flowDataType property: The Flow's data class. + * + * @return the flowDataType value. + */ + public DataClass flowDataType() { + return this.flowDataType; + } + + /** + * Set the flowDataType property: The Flow's data class. + * + * @param flowDataType the flowDataType value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withFlowDataType(DataClass flowDataType) { + this.flowDataType = flowDataType; + return this; + } + + /** + * Get the flowType property: The flow type for this flow. The property has reached end of life support starting + * version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @return the flowType value. + */ + public FlowType flowType() { + return this.flowType; + } + + /** + * Set the flowType property: The flow type for this flow. The property has reached end of life support starting + * version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @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: Type of data to transfer via the flow. The property has reached end of life support + * starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @return the dataType value. + */ + public DataType dataType() { + return this.dataType; + } + + /** + * Set the dataType property: Type of data to transfer via the flow. The property has reached end of life support + * starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @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. The property has reached end of life support starting + * version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @return the policies value. + */ + public List policies() { + return this.policies; + } + + /** + * Set the policies property: The policies for this flow. The property has reached end of life support starting + * version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @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. The property has reached end of life support starting + * version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @return the schema value. + */ + public Schema schema() { + return this.schema; + } + + /** + * Set the schema property: The selected schema for this flow. The property has reached end of life support starting + * version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @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; + } + + /** + * {@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.writeJsonField("flowProfile", this.flowProfile); + jsonWriter.writeStringField("flowDataType", this.flowDataType == null ? null : this.flowDataType.toString()); + 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 ("flowProfile".equals(fieldName)) { + deserializedFlowPropertiesInner.flowProfile = FlowProfileMetadata.fromJson(reader); + } else if ("flowDataType".equals(fieldName)) { + deserializedFlowPropertiesInner.flowDataType = DataClass.fromString(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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/GetDestinationEndpointPortsResultInner.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/GetDestinationEndpointPortsResultInner.java new file mode 100644 index 0000000000000..a0e5bd9fff6b5 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/GetDestinationEndpointPortsResultInner.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * List of destination endpoint ports for the flow stream. + */ +@Immutable +public final class GetDestinationEndpointPortsResultInner + implements JsonSerializable { + /* + * The destination endpoint port for the flow stream + */ + private List ports; + + /** + * Creates an instance of GetDestinationEndpointPortsResultInner class. + */ + private GetDestinationEndpointPortsResultInner() { + } + + /** + * Get the ports property: The destination endpoint port for the flow stream. + * + * @return the ports value. + */ + public List ports() { + return this.ports; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/GetDestinationEndpointsResultInner.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/GetDestinationEndpointsResultInner.java new file mode 100644 index 0000000000000..d4e555384fbe2 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/GetDestinationEndpointsResultInner.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * List of destination endpoints for the flow stream. + */ +@Immutable +public final class GetDestinationEndpointsResultInner implements JsonSerializable { + /* + * The destination endpoints for the flow stream + */ + private List endpoints; + + /** + * Creates an instance of GetDestinationEndpointsResultInner class. + */ + private GetDestinationEndpointsResultInner() { + } + + /** + * Get the endpoints property: The destination endpoints for the flow stream. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/GetStreamConnectionStringResultInner.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/GetStreamConnectionStringResultInner.java new file mode 100644 index 0000000000000..984bda354c10e --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/GetStreamConnectionStringResultInner.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The connection string for the specified streaming flow. + */ +@Immutable +public final class GetStreamConnectionStringResultInner + implements JsonSerializable { + /* + * The connection string for the specified streaming flow + */ + private String connectionString; + + /** + * Creates an instance of GetStreamConnectionStringResultInner class. + */ + private GetStreamConnectionStringResultInner() { + } + + /** + * Get the connectionString property: The connection string for the specified streaming flow. + * + * @return the connectionString value. + */ + public String connectionString() { + return this.connectionString; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/ListFlowsByPipelineResultInner.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/ListFlowsByPipelineResultInner.java new file mode 100644 index 0000000000000..f270f3a54eb4d --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/ListFlowsByPipelineResultInner.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datatransfer.models.ListFlowsByPipelineConnection; +import java.io.IOException; +import java.util.List; + +/** + * An array of flow resources. + */ +@Immutable +public final class ListFlowsByPipelineResultInner implements JsonSerializable { + /* + * List flows by pipeline result by connection + */ + private List value; + + /** + * Creates an instance of ListFlowsByPipelineResultInner class. + */ + private ListFlowsByPipelineResultInner() { + } + + /** + * Get the value property: List flows by pipeline result by connection. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/ListPipelineMetadataResultInner.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/ListPipelineMetadataResultInner.java new file mode 100644 index 0000000000000..204fc759a8f74 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/ListPipelineMetadataResultInner.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datatransfer.models.DirectionSettings; +import java.io.IOException; + +/** + * Defines the response body for retrieving Pipeline metadata for a provided pipeline. + */ +@Immutable +public final class ListPipelineMetadataResultInner implements JsonSerializable { + /* + * Returns the settings associated with send direction of the pipeline. + */ + private DirectionSettings send; + + /* + * Returns the settings associated with receive direction of the pipeline. + */ + private DirectionSettings receive; + + /** + * Creates an instance of ListPipelineMetadataResultInner class. + */ + private ListPipelineMetadataResultInner() { + } + + /** + * Get the send property: Returns the settings associated with send direction of the pipeline. + * + * @return the send value. + */ + public DirectionSettings send() { + return this.send; + } + + /** + * Get the receive property: Returns the settings associated with receive direction of the pipeline. + * + * @return the receive value. + */ + public DirectionSettings receive() { + return this.receive; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("send", this.send); + jsonWriter.writeJsonField("receive", this.receive); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListPipelineMetadataResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListPipelineMetadataResultInner 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 ListPipelineMetadataResultInner. + */ + public static ListPipelineMetadataResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListPipelineMetadataResultInner deserializedListPipelineMetadataResultInner + = new ListPipelineMetadataResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("send".equals(fieldName)) { + deserializedListPipelineMetadataResultInner.send = DirectionSettings.fromJson(reader); + } else if ("receive".equals(fieldName)) { + deserializedListPipelineMetadataResultInner.receive = DirectionSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedListPipelineMetadataResultInner; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/OperationInner.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..1eee87dc77b48 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/OperationInner.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datatransfer.models.ActionType; +import com.azure.resourcemanager.datatransfer.models.OperationDisplay; +import com.azure.resourcemanager.datatransfer.models.Origin; +import java.io.IOException; + +/** + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Immutable +public final class OperationInner implements JsonSerializable { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure + * Resource Manager/control-plane operations. + */ + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + private Origin origin; + + /* + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + private ActionType actionType; + + /** + * Creates an instance of OperationInner class. + */ + private OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/PendingConnectionInner.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/PendingConnectionInner.java new file mode 100644 index 0000000000000..fc7dbc44b2200 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/PendingConnectionInner.java @@ -0,0 +1,578 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SystemData; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datatransfer.models.ConnectionStatus; +import com.azure.resourcemanager.datatransfer.models.Direction; +import com.azure.resourcemanager.datatransfer.models.FlowProfileMetadata; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ForceDisabledStatus; +import com.azure.resourcemanager.datatransfer.models.LinkStatus; +import com.azure.resourcemanager.datatransfer.models.ProvisioningState; +import com.azure.resourcemanager.datatransfer.models.Schema; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Pending connection object. + */ +@Immutable +public final class PendingConnectionInner implements JsonSerializable { + /* + * Subscription ID of the pending connection. + */ + private String subscriptionId; + + /* + * 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. This FlowType property has reached end of life support + * starting version 2025-05-30-preview. Please create a FlowProfile resource instead. + */ + private List flowTypes; + + /* + * Provides a list of FlowProfiles . + */ + private List flowProfileList; + + /* + * 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. The policies property has reached end of life support starting version + * 2025-05-30-preview. Please create and use a FlowProfile resource instead. + */ + private List policies; + + /* + * The schemas for this connection. The schemas property has reached end of life support starting version + * 2025-05-30-preview. Please create and use a FlowProfile resource instead. + */ + private List schemas; + + /* + * The schema URIs for this connection. The schemaUris property has reached end of life support starting version + * 2025-05-30-preview. Please create and use a FlowProfile resource instead. + */ + private List schemaUris; + + /* + * Hostname specific to API Flows + */ + private String apiHostname; + + /* + * 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; + + /** + * Creates an instance of PendingConnectionInner class. + */ + private PendingConnectionInner() { + } + + /** + * Get the subscriptionId property: Subscription ID of the pending connection. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Get the pipeline property: Pipeline to use to transfer data. + * + * @return the pipeline value. + */ + public String pipeline() { + return this.pipeline; + } + + /** + * Get the direction property: Direction of data movement. + * + * @return the direction value. + */ + public Direction direction() { + return this.direction; + } + + /** + * Get the justification property: Justification for the connection request. + * + * @return the justification value. + */ + public String justification() { + return this.justification; + } + + /** + * 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. This FlowType property has + * reached end of life support starting version 2025-05-30-preview. Please create a FlowProfile resource instead. + * + * @return the flowTypes value. + */ + public List flowTypes() { + return this.flowTypes; + } + + /** + * Get the flowProfileList property: Provides a list of FlowProfiles . + * + * @return the flowProfileList value. + */ + public List flowProfileList() { + return this.flowProfileList; + } + + /** + * Get the requirementId property: Requirement ID of the connection. + * + * @return the requirementId value. + */ + public String requirementId() { + return this.requirementId; + } + + /** + * Get the remoteSubscriptionId property: Subscription ID to link cloud subscriptions together. + * + * @return the remoteSubscriptionId value. + */ + public String remoteSubscriptionId() { + return this.remoteSubscriptionId; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Get the secondaryContacts property: The secondary contacts for this connection request. + * + * @return the secondaryContacts value. + */ + public List secondaryContacts() { + return this.secondaryContacts; + } + + /** + * 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. The policies property has reached end of life + * support starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @return the policies value. + */ + public List policies() { + return this.policies; + } + + /** + * Get the schemas property: The schemas for this connection. The schemas property has reached end of life support + * starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @return the schemas value. + */ + public List schemas() { + return this.schemas; + } + + /** + * Get the schemaUris property: The schema URIs for this connection. The schemaUris property has reached end of life + * support starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @return the schemaUris value. + */ + public List schemaUris() { + return this.schemaUris; + } + + /** + * Get the apiHostname property: Hostname specific to API Flows. + * + * @return the apiHostname value. + */ + public String apiHostname() { + return this.apiHostname; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * 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; + } + + /** + * {@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.writeArrayField("flowProfileList", this.flowProfileList, + (writer, element) -> writer.writeJson(element)); + 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.writeStringField("apiHostname", this.apiHostname); + 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 ("subscriptionId".equals(fieldName)) { + deserializedPendingConnectionInner.subscriptionId = 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 ("flowProfileList".equals(fieldName)) { + List flowProfileList + = reader.readArray(reader1 -> FlowProfileMetadata.fromJson(reader1)); + deserializedPendingConnectionInner.flowProfileList = flowProfileList; + } 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 ("apiHostname".equals(fieldName)) { + deserializedPendingConnectionInner.apiHostname = reader.getString(); + } 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 { + reader.skipChildren(); + } + } + + return deserializedPendingConnectionInner; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/PendingFlowInner.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/PendingFlowInner.java new file mode 100644 index 0000000000000..df1ad597fe267 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/PendingFlowInner.java @@ -0,0 +1,747 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datatransfer.models.ApiFlowOptions; +import com.azure.resourcemanager.datatransfer.models.DataClass; +import com.azure.resourcemanager.datatransfer.models.DataType; +import com.azure.resourcemanager.datatransfer.models.FlowProfileMetadata; +import com.azure.resourcemanager.datatransfer.models.FlowStatus; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ForceDisabledStatus; +import com.azure.resourcemanager.datatransfer.models.LinkStatus; +import com.azure.resourcemanager.datatransfer.models.MessagingOptions; +import com.azure.resourcemanager.datatransfer.models.ProvisioningState; +import com.azure.resourcemanager.datatransfer.models.Schema; +import com.azure.resourcemanager.datatransfer.models.SelectedResource; +import com.azure.resourcemanager.datatransfer.models.StreamProtocol; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Pending flow object. + */ +@Immutable +public final class PendingFlowInner implements JsonSerializable { + /* + * Subscription ID of the pending flow. + */ + private String subscriptionId; + + /* + * Connection ID of the pending flow. + */ + private String connectionId; + + /* + * The connection associated with this flow + */ + private SelectedResource connection; + + /* + * Dataflow GUID associated with this flow + */ + private String flowId; + + /* + * URI to a Key Vault Secret containing a 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; + + /* + * Type of FlowProfile to use for transfer via the flow. + */ + private FlowProfileMetadata flowProfile; + + /* + * The Flow's data class. + */ + private DataClass flowDataType; + + /* + * The flow type for this flow. The property has reached end of life support starting version 2025-05-30-preview. + * Please create and use a FlowProfile resource instead. + */ + private FlowType flowType; + + /* + * Type of data to transfer via the flow. The property has reached end of life support starting version + * 2025-05-30-preview. Please create and use a FlowProfile resource instead. + */ + private DataType dataType; + + /* + * Provisioning state of the flow + */ + private ProvisioningState provisioningState; + + /* + * The policies for this flow. The property has reached end of life support starting version 2025-05-30-preview. + * Please create and use a FlowProfile resource instead. + */ + private List policies; + + /* + * The selected schema for this flow. The property has reached end of life support starting version + * 2025-05-30-preview. Please create and use a FlowProfile resource instead. + */ + 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; + + /* + * 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; + + /** + * Creates an instance of PendingFlowInner class. + */ + private PendingFlowInner() { + } + + /** + * 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; + } + + /** + * Get the connection property: The connection associated with this flow. + * + * @return the connection value. + */ + public SelectedResource connection() { + return this.connection; + } + + /** + * Get the flowId property: Dataflow GUID associated with this flow. + * + * @return the flowId value. + */ + public String flowId() { + return this.flowId; + } + + /** + * Get the keyVaultUri property: URI to a Key Vault Secret containing a SAS token. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Get the storageAccountId property: Storage Account ID. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Get the storageContainerName property: Storage Container Name. + * + * @return the storageContainerName value. + */ + public String storageContainerName() { + return this.storageContainerName; + } + + /** + * Get the storageTableName property: Storage Table Name. + * + * @return the storageTableName value. + */ + public String storageTableName() { + return this.storageTableName; + } + + /** + * Get the serviceBusQueueId property: Service Bus Queue ID. + * + * @return the serviceBusQueueId value. + */ + public String serviceBusQueueId() { + return this.serviceBusQueueId; + } + + /** + * Get the flowProfile property: Type of FlowProfile to use for transfer via the flow. + * + * @return the flowProfile value. + */ + public FlowProfileMetadata flowProfile() { + return this.flowProfile; + } + + /** + * Get the flowDataType property: The Flow's data class. + * + * @return the flowDataType value. + */ + public DataClass flowDataType() { + return this.flowDataType; + } + + /** + * Get the flowType property: The flow type for this flow. The property has reached end of life support starting + * version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @return the flowType value. + */ + public FlowType flowType() { + return this.flowType; + } + + /** + * Get the dataType property: Type of data to transfer via the flow. The property has reached end of life support + * starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @return the dataType value. + */ + public DataType dataType() { + return this.dataType; + } + + /** + * 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. The property has reached end of life support starting + * version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @return the policies value. + */ + public List policies() { + return this.policies; + } + + /** + * Get the schema property: The selected schema for this flow. The property has reached end of life support starting + * version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @return the schema value. + */ + public Schema schema() { + return this.schema; + } + + /** + * Get the messagingOptions property: The messaging options for this flow. + * + * @return the messagingOptions value. + */ + public MessagingOptions messagingOptions() { + return this.messagingOptions; + } + + /** + * 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; + } + + /** + * Get the customerManagedKeyVaultUri property: The URI to the customer managed key for this flow. + * + * @return the customerManagedKeyVaultUri value. + */ + public String customerManagedKeyVaultUri() { + return this.customerManagedKeyVaultUri; + } + + /** + * Get the streamId property: The flow stream identifier. + * + * @return the streamId value. + */ + public String streamId() { + return this.streamId; + } + + /** + * Get the streamProtocol property: The protocol of the stream. + * + * @return the streamProtocol value. + */ + public StreamProtocol streamProtocol() { + return this.streamProtocol; + } + + /** + * Get the streamLatency property: The latency of the stream in milliseconds. + * + * @return the streamLatency value. + */ + public Long streamLatency() { + return this.streamLatency; + } + + /** + * Get the passphrase property: The passphrase used for SRT streams. + * + * @return the passphrase value. + */ + public String passphrase() { + return this.passphrase; + } + + /** + * Get the sourceAddresses property: The source IP address and CIDR ranges of the stream. + * + * @return the sourceAddresses value. + */ + public StreamSourceAddressesInner sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Get the destinationEndpoints property: The destination endpoints of the stream. + * + * @return the destinationEndpoints value. + */ + public List destinationEndpoints() { + return this.destinationEndpoints; + } + + /** + * Get the destinationEndpointPorts property: The destination endpoint ports of the stream. + * + * @return the destinationEndpointPorts value. + */ + public List destinationEndpointPorts() { + return this.destinationEndpointPorts; + } + + /** + * Get the eventHubId property: Event Hub ID. + * + * @return the eventHubId value. + */ + public String eventHubId() { + return this.eventHubId; + } + + /** + * Get the consumerGroup property: Event Hub Consumer Group. + * + * @return the consumerGroup value. + */ + public String consumerGroup() { + return this.consumerGroup; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * 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; + } + + /** + * {@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.writeJsonField("flowProfile", this.flowProfile); + jsonWriter.writeStringField("flowDataType", this.flowDataType == null ? null : this.flowDataType.toString()); + 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.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 ("subscriptionId".equals(fieldName)) { + deserializedPendingFlowInner.subscriptionId = reader.getString(); + } else if ("connectionId".equals(fieldName)) { + deserializedPendingFlowInner.connectionId = 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 ("flowProfile".equals(fieldName)) { + deserializedPendingFlowInner.flowProfile = FlowProfileMetadata.fromJson(reader); + } else if ("flowDataType".equals(fieldName)) { + deserializedPendingFlowInner.flowDataType = DataClass.fromString(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 ("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 { + reader.skipChildren(); + } + } + + return deserializedPendingFlowInner; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/PipelineInner.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/PipelineInner.java new file mode 100644 index 0000000000000..4048f949edf84 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/PipelineInner.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.datatransfer.models.PipelineProperties; +import java.io.IOException; +import java.util.Map; + +/** + * The pipeline resource definition. A Pipeline defines the scope and identity under which data replication scenarios + * are managed. + */ +@Fluent +public final class PipelineInner extends Resource { + /* + * The set of configurable properties for the Pipeline resource. + */ + 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: The set of configurable properties for the Pipeline resource. + * + * @return the properties value. + */ + public PipelineProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The set of configurable properties for the Pipeline resource. + * + * @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; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/SchemasListResultInner.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/SchemasListResultInner.java new file mode 100644 index 0000000000000..704508b2160ac --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/SchemasListResultInner.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datatransfer.models.Schema; +import java.io.IOException; +import java.util.List; + +/** + * The schemas list result. SchemaListResults has reached end of life support starting version 2025-05-30-preview. + * Please manage schemas with a FlowProfile resource instead. + */ +@Immutable +public final class SchemasListResultInner implements JsonSerializable { + /* + * Schemas array. + */ + private List value; + + /** + * Creates an instance of SchemasListResultInner class. + */ + private SchemasListResultInner() { + } + + /** + * Get the value property: Schemas array. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/StreamSourceAddressesInner.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/StreamSourceAddressesInner.java new file mode 100644 index 0000000000000..275fb1e04d0cf --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/StreamSourceAddressesInner.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/ValidateSchemaResultInner.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/ValidateSchemaResultInner.java new file mode 100644 index 0000000000000..d8b31599504f8 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/ValidateSchemaResultInner.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datatransfer.models.ValidateSchemaStatus; +import java.io.IOException; + +/** + * Result of the schema validation. ValidateSchemaResult has reached end of life support starting version + * 2025-05-30-preview. Please manage schemas with a FlowProfile resource instead. + */ +@Immutable +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. + */ + private ValidateSchemaResultInner() { + } + + /** + * Get the status property: Validation status of the schema. + * + * @return the status value. + */ + public ValidateSchemaStatus status() { + return this.status; + } + + /** + * Get the message property: Message describing the schema validation. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/package-info.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/package-info.java new file mode 100644 index 0000000000000..51d7cb632ebe2 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the inner data models for DataTransfer. + */ +package com.azure.resourcemanager.datatransfer.fluent.models; diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/package-info.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/package-info.java new file mode 100644 index 0000000000000..b03e835ad3fcc --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/fluent/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the service clients for DataTransfer. + */ +package com.azure.resourcemanager.datatransfer.fluent; diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/AzureDataTransfersClientImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/AzureDataTransfersClientImpl.java new file mode 100644 index 0000000000000..50132cabb4408 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/AzureDataTransfersClientImpl.java @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +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.resourcemanager.datatransfer.fluent.AzureDataTransfersClient; +import com.azure.resourcemanager.datatransfer.fluent.models.FlowProfilesListResultInner; +import com.azure.resourcemanager.datatransfer.fluent.models.ListPipelineMetadataResultInner; +import com.azure.resourcemanager.datatransfer.fluent.models.SchemasListResultInner; +import com.azure.resourcemanager.datatransfer.fluent.models.ValidateSchemaResultInner; +import com.azure.resourcemanager.datatransfer.models.ListApprovedSchemasRequest; +import com.azure.resourcemanager.datatransfer.models.ListFlowProfilesRequest; +import com.azure.resourcemanager.datatransfer.models.ListPipelineMetadataRequest; +import com.azure.resourcemanager.datatransfer.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 DataTransferManagementClientImpl client; + + /** + * Initializes an instance of AzureDataTransfersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AzureDataTransfersClientImpl(DataTransferManagementClientImpl client) { + this.service = RestProxy.create(AzureDataTransfersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataTransferManagementClientAzureDataTransfers to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DataTransferManagementClientAzureDataTransfers") + public interface AzureDataTransfersService { + @Post("/providers/Microsoft.AzureDataTransfer/listApprovedSchemas") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listApprovedSchemas(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ListApprovedSchemasRequest pipeline, + Context context); + + @Post("/providers/Microsoft.AzureDataTransfer/listApprovedSchemas") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listApprovedSchemasSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ListApprovedSchemasRequest pipeline, + Context context); + + @Post("/providers/Microsoft.AzureDataTransfer/listFlowProfiles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listFlowProfiles(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ListFlowProfilesRequest body, + Context context); + + @Post("/providers/Microsoft.AzureDataTransfer/listFlowProfiles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listFlowProfilesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ListFlowProfilesRequest body, + Context context); + + @Post("/providers/Microsoft.AzureDataTransfer/validateSchema") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validateSchema(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") Schema schema, Context context); + + @Post("/providers/Microsoft.AzureDataTransfer/validateSchema") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response validateSchemaSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") Schema schema, Context context); + + @Post("/providers/Microsoft.AzureDataTransfer/listPipelineMetadata") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listPipelineMetadata(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ListPipelineMetadataRequest body, + Context context); + + @Post("/providers/Microsoft.AzureDataTransfer/listPipelineMetadata") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listPipelineMetadataSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ListPipelineMetadataRequest body, + Context context); + } + + /** + * Retrieves the list of approved schemas available for Azure Data Transfer. This operation has reached end of life + * support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile resource. + * + * @param pipeline The request payload for listing approved schemas. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 pipeline) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listApprovedSchemas(this.client.getEndpoint(), this.client.getApiVersion(), + contentType, accept, pipeline, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the list of approved schemas available for Azure Data Transfer. This operation has reached end of life + * support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile resource. + * + * @param pipeline The request payload for listing approved schemas. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 pipeline) { + return listApprovedSchemasWithResponseAsync(pipeline).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the list of approved schemas available for Azure Data Transfer. This operation has reached end of life + * support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile resource. + * + * @param pipeline The request payload for listing approved schemas. + * @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 pipeline, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.listApprovedSchemasSync(this.client.getEndpoint(), this.client.getApiVersion(), contentType, + accept, pipeline, context); + } + + /** + * Retrieves the list of approved schemas available for Azure Data Transfer. This operation has reached end of life + * support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile resource. + * + * @param pipeline The request payload for listing approved schemas. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 pipeline) { + return listApprovedSchemasWithResponse(pipeline, Context.NONE).getValue(); + } + + /** + * Retrieves a list of FlowProfile resources associated with a specified pipeline. + * + * @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 flow profiles list result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listFlowProfilesWithResponseAsync(ListFlowProfilesRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listFlowProfiles(this.client.getEndpoint(), this.client.getApiVersion(), + contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves a list of FlowProfile resources associated with a specified pipeline. + * + * @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 flow profiles list result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listFlowProfilesAsync(ListFlowProfilesRequest body) { + return listFlowProfilesWithResponseAsync(body).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves a list of FlowProfile resources associated with a specified pipeline. + * + * @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 flow profiles list result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listFlowProfilesWithResponse(ListFlowProfilesRequest body, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.listFlowProfilesSync(this.client.getEndpoint(), this.client.getApiVersion(), contentType, accept, + body, context); + } + + /** + * Retrieves a list of FlowProfile resources associated with a specified pipeline. + * + * @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 flow profiles list result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowProfilesListResultInner listFlowProfiles(ListFlowProfilesRequest body) { + return listFlowProfilesWithResponse(body, Context.NONE).getValue(); + } + + /** + * Validates the structure and content of a schema for use in Azure Data Transfer. This operation has reached end of + * life support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile + * resource. + * + * @param schema 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 schema) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.validateSchema(this.client.getEndpoint(), this.client.getApiVersion(), + contentType, accept, schema, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validates the structure and content of a schema for use in Azure Data Transfer. This operation has reached end of + * life support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile + * resource. + * + * @param schema 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 schema) { + return validateSchemaWithResponseAsync(schema).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Validates the structure and content of a schema for use in Azure Data Transfer. This operation has reached end of + * life support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile + * resource. + * + * @param schema 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 schema, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.validateSchemaSync(this.client.getEndpoint(), this.client.getApiVersion(), contentType, accept, + schema, context); + } + + /** + * Validates the structure and content of a schema for use in Azure Data Transfer. This operation has reached end of + * life support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile + * resource. + * + * @param schema 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 schema) { + return validateSchemaWithResponse(schema, Context.NONE).getValue(); + } + + /** + * Retrieves the pipeline metadata associated with a specified pipeline. + * + * @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 defines the response body for retrieving Pipeline metadata for a provided pipeline along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listPipelineMetadataWithResponseAsync(ListPipelineMetadataRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listPipelineMetadata(this.client.getEndpoint(), this.client.getApiVersion(), + contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the pipeline metadata associated with a specified pipeline. + * + * @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 defines the response body for retrieving Pipeline metadata for a provided pipeline on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listPipelineMetadataAsync(ListPipelineMetadataRequest body) { + return listPipelineMetadataWithResponseAsync(body).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the pipeline metadata associated with a specified pipeline. + * + * @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 defines the response body for retrieving Pipeline metadata for a provided pipeline along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listPipelineMetadataWithResponse(ListPipelineMetadataRequest body, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.listPipelineMetadataSync(this.client.getEndpoint(), this.client.getApiVersion(), contentType, + accept, body, context); + } + + /** + * Retrieves the pipeline metadata associated with a specified pipeline. + * + * @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 defines the response body for retrieving Pipeline metadata for a provided pipeline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ListPipelineMetadataResultInner listPipelineMetadata(ListPipelineMetadataRequest body) { + return listPipelineMetadataWithResponse(body, Context.NONE).getValue(); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/AzureDataTransfersImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/AzureDataTransfersImpl.java new file mode 100644 index 0000000000000..d6dea753c070d --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/AzureDataTransfersImpl.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.fluent.AzureDataTransfersClient; +import com.azure.resourcemanager.datatransfer.fluent.models.FlowProfilesListResultInner; +import com.azure.resourcemanager.datatransfer.fluent.models.ListPipelineMetadataResultInner; +import com.azure.resourcemanager.datatransfer.fluent.models.SchemasListResultInner; +import com.azure.resourcemanager.datatransfer.fluent.models.ValidateSchemaResultInner; +import com.azure.resourcemanager.datatransfer.models.AzureDataTransfers; +import com.azure.resourcemanager.datatransfer.models.FlowProfilesListResult; +import com.azure.resourcemanager.datatransfer.models.ListApprovedSchemasRequest; +import com.azure.resourcemanager.datatransfer.models.ListFlowProfilesRequest; +import com.azure.resourcemanager.datatransfer.models.ListPipelineMetadataRequest; +import com.azure.resourcemanager.datatransfer.models.ListPipelineMetadataResult; +import com.azure.resourcemanager.datatransfer.models.Schema; +import com.azure.resourcemanager.datatransfer.models.SchemasListResult; +import com.azure.resourcemanager.datatransfer.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.datatransfer.DataTransferManager serviceManager; + + public AzureDataTransfersImpl(AzureDataTransfersClient innerClient, + com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listApprovedSchemasWithResponse(ListApprovedSchemasRequest pipeline, + Context context) { + Response inner + = this.serviceClient().listApprovedSchemasWithResponse(pipeline, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SchemasListResultImpl(inner.getValue(), this.manager())); + } + + public SchemasListResult listApprovedSchemas(ListApprovedSchemasRequest pipeline) { + SchemasListResultInner inner = this.serviceClient().listApprovedSchemas(pipeline); + if (inner != null) { + return new SchemasListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listFlowProfilesWithResponse(ListFlowProfilesRequest body, + Context context) { + Response inner = this.serviceClient().listFlowProfilesWithResponse(body, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FlowProfilesListResultImpl(inner.getValue(), this.manager())); + } + + public FlowProfilesListResult listFlowProfiles(ListFlowProfilesRequest body) { + FlowProfilesListResultInner inner = this.serviceClient().listFlowProfiles(body); + if (inner != null) { + return new FlowProfilesListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response validateSchemaWithResponse(Schema schema, Context context) { + Response inner = this.serviceClient().validateSchemaWithResponse(schema, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ValidateSchemaResultImpl(inner.getValue(), this.manager())); + } + + public ValidateSchemaResult validateSchema(Schema schema) { + ValidateSchemaResultInner inner = this.serviceClient().validateSchema(schema); + if (inner != null) { + return new ValidateSchemaResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listPipelineMetadataWithResponse(ListPipelineMetadataRequest body, + Context context) { + Response inner + = this.serviceClient().listPipelineMetadataWithResponse(body, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ListPipelineMetadataResultImpl(inner.getValue(), this.manager())); + } + + public ListPipelineMetadataResult listPipelineMetadata(ListPipelineMetadataRequest body) { + ListPipelineMetadataResultInner inner = this.serviceClient().listPipelineMetadata(body); + if (inner != null) { + return new ListPipelineMetadataResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private AzureDataTransfersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datatransfer.DataTransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/ConnectionImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/ConnectionImpl.java new file mode 100644 index 0000000000000..dba76301f26e2 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/ConnectionImpl.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.fluent.models.ConnectionInner; +import com.azure.resourcemanager.datatransfer.models.Connection; +import com.azure.resourcemanager.datatransfer.models.ConnectionProperties; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.datatransfer.models.PendingConnection; +import com.azure.resourcemanager.datatransfer.models.PendingFlow; +import com.azure.resourcemanager.datatransfer.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.datatransfer.DataTransferManager 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.datatransfer.DataTransferManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String connectionName; + + public ConnectionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Connection create() { + this.innerObject = serviceManager.serviceClient() + .getConnections() + .createOrUpdate(resourceGroupName, connectionName, this.innerModel(), Context.NONE); + return this; + } + + public Connection create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConnections() + .createOrUpdate(resourceGroupName, connectionName, this.innerModel(), context); + return this; + } + + ConnectionImpl(String name, com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager) { + this.innerObject = new ConnectionInner(); + this.serviceManager = serviceManager; + this.connectionName = name; + } + + public ConnectionImpl update() { + return this; + } + + public Connection apply() { + this.innerObject = serviceManager.serviceClient() + .getConnections() + .createOrUpdate(resourceGroupName, connectionName, this.innerModel(), Context.NONE); + return this; + } + + public Connection apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConnections() + .createOrUpdate(resourceGroupName, connectionName, this.innerModel(), context); + return this; + } + + ConnectionImpl(ConnectionInner innerObject, + com.azure.resourcemanager.datatransfer.DataTransferManager 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 connection) { + return serviceManager.connections().link(resourceGroupName, connectionName, connection); + } + + public Connection link(ResourceBody connection, Context context) { + return serviceManager.connections().link(resourceGroupName, connectionName, connection, 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) { + this.innerModel().withTags(tags); + return this; + } + + public ConnectionImpl withProperties(ConnectionProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public ConnectionImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/ConnectionsClientImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/ConnectionsClientImpl.java new file mode 100644 index 0000000000000..702e9595d389f --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/ConnectionsClientImpl.java @@ -0,0 +1,1707 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datatransfer.fluent.ConnectionsClient; +import com.azure.resourcemanager.datatransfer.fluent.models.ConnectionInner; +import com.azure.resourcemanager.datatransfer.fluent.models.PendingConnectionInner; +import com.azure.resourcemanager.datatransfer.fluent.models.PendingFlowInner; +import com.azure.resourcemanager.datatransfer.implementation.models.ConnectionListResult; +import com.azure.resourcemanager.datatransfer.implementation.models.PendingConnectionListResult; +import com.azure.resourcemanager.datatransfer.implementation.models.PendingFlowListResult; +import com.azure.resourcemanager.datatransfer.models.ConnectionsPatch; +import com.azure.resourcemanager.datatransfer.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 DataTransferManagementClientImpl client; + + /** + * Initializes an instance of ConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConnectionsClientImpl(DataTransferManagementClientImpl client) { + this.service + = RestProxy.create(ConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataTransferManagementClientConnections to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DataTransferManagementClientConnections") + public interface ConnectionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("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("endpoint") 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); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ConnectionInner connection, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ConnectionInner connection, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ConnectionsPatch connection, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ConnectionsPatch connection, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureDataTransfer/connections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscription(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureDataTransfer/connections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/link") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> link(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ResourceBody connection, + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/link") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response linkSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ResourceBody connection, + 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("endpoint") 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("endpoint") 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("endpoint") 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("endpoint") 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> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listPendingFlowsListNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listPendingFlowsListNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, 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 to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) { + 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 to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 to perform the operation on. + * @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) { + 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 to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 to perform the operation on. + * @param connection 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 connection) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, contentType, accept, connection, + 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 to perform the operation on. + * @param connection 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 createOrUpdateWithResponse(String resourceGroupName, String connectionName, + ConnectionInner connection) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, contentType, accept, connection, + Context.NONE); + } + + /** + * 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 to perform the operation on. + * @param connection 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 createOrUpdateWithResponse(String resourceGroupName, String connectionName, + ConnectionInner connection, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, contentType, accept, connection, + 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 to perform the operation on. + * @param connection 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> beginCreateOrUpdateAsync(String resourceGroupName, + String connectionName, ConnectionInner connection) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, connectionName, connection); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ConnectionInner.class, ConnectionInner.class, this.client.getContext()); + } + + /** + * 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 to perform the operation on. + * @param connection 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> beginCreateOrUpdate(String resourceGroupName, + String connectionName, ConnectionInner connection) { + Response response = createOrUpdateWithResponse(resourceGroupName, connectionName, connection); + return this.client.getLroResult(response, ConnectionInner.class, + ConnectionInner.class, Context.NONE); + } + + /** + * 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 to perform the operation on. + * @param connection 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> beginCreateOrUpdate(String resourceGroupName, + String connectionName, ConnectionInner connection, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, connectionName, connection, context); + return this.client.getLroResult(response, ConnectionInner.class, + ConnectionInner.class, 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 to perform the operation on. + * @param connection 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 connection) { + return beginCreateOrUpdateAsync(resourceGroupName, connectionName, connection).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 to perform the operation on. + * @param connection 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 connection) { + return beginCreateOrUpdate(resourceGroupName, connectionName, connection).getFinalResult(); + } + + /** + * 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 to perform the operation on. + * @param connection 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 createOrUpdate(String resourceGroupName, String connectionName, ConnectionInner connection, + Context context) { + return beginCreateOrUpdate(resourceGroupName, connectionName, connection, context).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 to perform the operation on. + * @param connection 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 connection) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, contentType, accept, connection, + 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 to perform the operation on. + * @param connection 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 connection) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, contentType, accept, connection, + 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 to perform the operation on. + * @param connection 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 connection, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, contentType, accept, connection, + 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 to perform the operation on. + * @param connection 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, Void> beginUpdateAsync(String resourceGroupName, String connectionName, + ConnectionsPatch connection) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, connectionName, connection); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.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 to perform the operation on. + * @param connection 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, Void> beginUpdate(String resourceGroupName, String connectionName, + ConnectionsPatch connection) { + Response response = updateWithResponse(resourceGroupName, connectionName, connection); + return this.client.getLroResult(response, Void.class, Void.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 to perform the operation on. + * @param connection 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, Void> beginUpdate(String resourceGroupName, String connectionName, + ConnectionsPatch connection, Context context) { + Response response = updateWithResponse(resourceGroupName, connectionName, connection, context); + return this.client.getLroResult(response, Void.class, Void.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 to perform the operation on. + * @param connection 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 connection) { + return beginUpdateAsync(resourceGroupName, connectionName, connection).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 to perform the operation on. + * @param connection 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void update(String resourceGroupName, String connectionName, ConnectionsPatch connection) { + beginUpdate(resourceGroupName, connectionName, connection).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 to perform the operation on. + * @param connection 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void update(String resourceGroupName, String connectionName, ConnectionsPatch connection, Context context) { + beginUpdate(resourceGroupName, connectionName, connection, 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 to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, 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 to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, 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 to perform the operation on. + * @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) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, 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 to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 to perform the operation on. + * @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 to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 to perform the operation on. + * @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(); + } + + /** + * 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) { + 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) { + 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) { + 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 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() { + 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() { + 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) { + 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)); + } + + /** + * 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 to perform the operation on. + * @param connection 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 connection) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.link(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, contentType, accept, connection, + 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 to perform the operation on. + * @param connection 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 connection) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.linkSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, connectionName, contentType, accept, connection, 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 to perform the operation on. + * @param connection 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 connection, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.linkSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, connectionName, contentType, accept, connection, 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 to perform the operation on. + * @param connection 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 connection) { + Mono>> mono = linkWithResponseAsync(resourceGroupName, connectionName, connection); + 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 to perform the operation on. + * @param connection 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 connection) { + Response response = linkWithResponse(resourceGroupName, connectionName, connection); + 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 to perform the operation on. + * @param connection 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 connection, Context context) { + Response response = linkWithResponse(resourceGroupName, connectionName, connection, 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 to perform the operation on. + * @param connection 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 connection) { + return beginLinkAsync(resourceGroupName, connectionName, connection).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 to perform the operation on. + * @param connection 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 connection) { + return beginLink(resourceGroupName, connectionName, connection).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 to perform the operation on. + * @param connection 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 connection, + Context context) { + return beginLink(resourceGroupName, connectionName, connection, context).getFinalResult(); + } + + /** + * Lists all pending remote connections that are linkable to this connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom response of a list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String connectionName) { + 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 remote connections that are linkable to this connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom response of a 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 remote connections that are linkable to this connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom response of a list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String connectionName) { + 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 remote connections that are linkable to this connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @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 custom response of a list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String connectionName, + Context context) { + 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 remote connections that are linkable to this connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom response of a 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 remote connections that are linkable to this connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @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 custom response of a 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 remote flows that have not yet been linked to local flows. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom response of a list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPendingFlowsListSinglePageAsync(String resourceGroupName, + String connectionName) { + 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 remote flows that have not yet been linked to local flows. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom response of a 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 remote flows that have not yet been linked to local flows. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom response of a list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listPendingFlowsListSinglePage(String resourceGroupName, + String connectionName) { + 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 remote flows that have not yet been linked to local flows. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @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 custom response of a list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listPendingFlowsListSinglePage(String resourceGroupName, + String connectionName, Context context) { + 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 remote flows that have not yet been linked to local flows. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom response of a 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 remote flows that have not yet been linked to local flows. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @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 custom response of a 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 connections in a resource group along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + 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 connections in a resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + 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 connections in a resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { + 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 connections in a subscription along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connections in a subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connections in a subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom response of a list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom response of a list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom response of a list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * 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 custom response of a list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPendingFlowsListNextSinglePageAsync(String nextLink) { + 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 custom response of a list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listPendingFlowsListNextSinglePage(String nextLink) { + 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 custom response of a list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listPendingFlowsListNextSinglePage(String nextLink, Context context) { + 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); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/ConnectionsImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/ConnectionsImpl.java new file mode 100644 index 0000000000000..0c10fa2e8594c --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/ConnectionsImpl.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.fluent.ConnectionsClient; +import com.azure.resourcemanager.datatransfer.fluent.models.ConnectionInner; +import com.azure.resourcemanager.datatransfer.fluent.models.PendingConnectionInner; +import com.azure.resourcemanager.datatransfer.fluent.models.PendingFlowInner; +import com.azure.resourcemanager.datatransfer.models.Connection; +import com.azure.resourcemanager.datatransfer.models.Connections; +import com.azure.resourcemanager.datatransfer.models.ConnectionsPatch; +import com.azure.resourcemanager.datatransfer.models.PendingConnection; +import com.azure.resourcemanager.datatransfer.models.PendingFlow; +import com.azure.resourcemanager.datatransfer.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.datatransfer.DataTransferManager serviceManager; + + public ConnectionsImpl(ConnectionsClient innerClient, + com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String connectionName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, connectionName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConnectionImpl(inner.getValue(), this.manager())); + } + + 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 update(String resourceGroupName, String connectionName, ConnectionsPatch connection) { + this.serviceClient().update(resourceGroupName, connectionName, connection); + } + + public void update(String resourceGroupName, String connectionName, ConnectionsPatch connection, Context context) { + this.serviceClient().update(resourceGroupName, connectionName, connection, context); + } + + 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 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 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 Connection link(String resourceGroupName, String connectionName, ResourceBody connection) { + ConnectionInner inner = this.serviceClient().link(resourceGroupName, connectionName, connection); + if (inner != null) { + return new ConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Connection link(String resourceGroupName, String connectionName, ResourceBody connection, Context context) { + ConnectionInner inner = this.serviceClient().link(resourceGroupName, connectionName, connection, 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.datatransfer.DataTransferManager manager() { + return this.serviceManager; + } + + public ConnectionImpl define(String name) { + return new ConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/DataTransferManagementClientBuilder.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/DataTransferManagementClientBuilder.java new file mode 100644 index 0000000000000..770d0e0031af7 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/DataTransferManagementClientBuilder.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 DataTransferManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { DataTransferManagementClientImpl.class }) +public final class DataTransferManagementClientBuilder { + /* + * Service host + */ + private String endpoint; + + /** + * Sets Service host. + * + * @param endpoint the endpoint value. + * @return the DataTransferManagementClientBuilder. + */ + public DataTransferManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the DataTransferManagementClientBuilder. + */ + public DataTransferManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the DataTransferManagementClientBuilder. + */ + public DataTransferManagementClientBuilder 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 DataTransferManagementClientBuilder. + */ + public DataTransferManagementClientBuilder 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 DataTransferManagementClientBuilder. + */ + public DataTransferManagementClientBuilder 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 DataTransferManagementClientBuilder. + */ + public DataTransferManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of DataTransferManagementClientImpl with the provided parameters. + * + * @return an instance of DataTransferManagementClientImpl. + */ + public DataTransferManagementClientImpl 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(); + DataTransferManagementClientImpl client = new DataTransferManagementClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); + return client; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/DataTransferManagementClientImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/DataTransferManagementClientImpl.java new file mode 100644 index 0000000000000..7cfe82e3f873b --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/DataTransferManagementClientImpl.java @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.fluent.AzureDataTransfersClient; +import com.azure.resourcemanager.datatransfer.fluent.ConnectionsClient; +import com.azure.resourcemanager.datatransfer.fluent.DataTransferManagementClient; +import com.azure.resourcemanager.datatransfer.fluent.FlowProfilesClient; +import com.azure.resourcemanager.datatransfer.fluent.FlowsClient; +import com.azure.resourcemanager.datatransfer.fluent.OperationsClient; +import com.azure.resourcemanager.datatransfer.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 DataTransferManagementClientImpl type. + */ +@ServiceClient(builder = DataTransferManagementClientBuilder.class) +public final class DataTransferManagementClientImpl implements DataTransferManagementClient { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Version parameter. + */ + private final String apiVersion; + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The default poll interval for long-running operation. + */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** + * The 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 FlowProfilesClient object to access its operations. + */ + private final FlowProfilesClient flowProfiles; + + /** + * Gets the FlowProfilesClient object to access its operations. + * + * @return the FlowProfilesClient object. + */ + public FlowProfilesClient getFlowProfiles() { + return this.flowProfiles; + } + + /** + * 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 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 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; + } + + /** + * 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; + } + + /** + * Initializes an instance of DataTransferManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + */ + DataTransferManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.endpoint = endpoint; + this.subscriptionId = subscriptionId; + this.apiVersion = "2026-02-06-preview"; + this.operations = new OperationsClientImpl(this); + this.flowProfiles = new FlowProfilesClientImpl(this); + this.pipelines = new PipelinesClientImpl(this); + this.connections = new ConnectionsClientImpl(this); + this.flows = new FlowsClientImpl(this); + this.azureDataTransfers = new AzureDataTransfersClientImpl(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 ? new byte[0] : 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(DataTransferManagementClientImpl.class); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowImpl.java new file mode 100644 index 0000000000000..49d6cc149f16a --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowImpl.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.fluent.models.FlowInner; +import com.azure.resourcemanager.datatransfer.fluent.models.FlowPropertiesInner; +import com.azure.resourcemanager.datatransfer.models.Flow; +import com.azure.resourcemanager.datatransfer.models.FlowProperties; +import com.azure.resourcemanager.datatransfer.models.GetDestinationEndpointPortsResult; +import com.azure.resourcemanager.datatransfer.models.GetDestinationEndpointsResult; +import com.azure.resourcemanager.datatransfer.models.GetStreamConnectionStringResult; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.datatransfer.models.Plan; +import com.azure.resourcemanager.datatransfer.models.ResourceBody; +import com.azure.resourcemanager.datatransfer.models.SetDestinationEndpointPorts; +import com.azure.resourcemanager.datatransfer.models.SetDestinationEndpoints; +import com.azure.resourcemanager.datatransfer.models.SetSourceAddresses; +import com.azure.resourcemanager.datatransfer.models.SetStreamPassphrase; +import com.azure.resourcemanager.datatransfer.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.datatransfer.DataTransferManager 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.datatransfer.DataTransferManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String connectionName; + + private String flowName; + + public FlowImpl withExistingConnection(String resourceGroupName, String connectionName) { + this.resourceGroupName = resourceGroupName; + this.connectionName = connectionName; + return this; + } + + public Flow create() { + this.innerObject = serviceManager.serviceClient() + .getFlows() + .createOrUpdate(resourceGroupName, connectionName, flowName, this.innerModel(), Context.NONE); + return this; + } + + public Flow create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFlows() + .createOrUpdate(resourceGroupName, connectionName, flowName, this.innerModel(), context); + return this; + } + + FlowImpl(String name, com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager) { + this.innerObject = new FlowInner(); + this.serviceManager = serviceManager; + this.flowName = name; + } + + public FlowImpl update() { + return this; + } + + public Flow apply() { + this.innerObject = serviceManager.serviceClient() + .getFlows() + .createOrUpdate(resourceGroupName, connectionName, flowName, this.innerModel(), Context.NONE); + return this; + } + + public Flow apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFlows() + .createOrUpdate(resourceGroupName, connectionName, flowName, this.innerModel(), context); + return this; + } + + FlowImpl(FlowInner innerObject, com.azure.resourcemanager.datatransfer.DataTransferManager 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 flow) { + return serviceManager.flows().link(resourceGroupName, connectionName, flowName, flow); + } + + public Flow link(ResourceBody flow, Context context) { + return serviceManager.flows().link(resourceGroupName, connectionName, flowName, flow, context); + } + + public Flow setDestinationEndpointPorts(SetDestinationEndpointPorts streamDestinationEndpointPorts) { + return serviceManager.flows() + .setDestinationEndpointPorts(resourceGroupName, connectionName, flowName, streamDestinationEndpointPorts); + } + + public Flow setDestinationEndpointPorts(SetDestinationEndpointPorts streamDestinationEndpointPorts, + Context context) { + return serviceManager.flows() + .setDestinationEndpointPorts(resourceGroupName, connectionName, flowName, streamDestinationEndpointPorts, + context); + } + + public Flow setDestinationEndpoints(SetDestinationEndpoints streamDestinationEndpoints) { + return serviceManager.flows() + .setDestinationEndpoints(resourceGroupName, connectionName, flowName, streamDestinationEndpoints); + } + + public Flow setDestinationEndpoints(SetDestinationEndpoints streamDestinationEndpoints, Context context) { + return serviceManager.flows() + .setDestinationEndpoints(resourceGroupName, connectionName, flowName, streamDestinationEndpoints, context); + } + + public Flow setPassphrase(SetStreamPassphrase passphrase) { + return serviceManager.flows().setPassphrase(resourceGroupName, connectionName, flowName, passphrase); + } + + public Flow setPassphrase(SetStreamPassphrase passphrase, Context context) { + return serviceManager.flows().setPassphrase(resourceGroupName, connectionName, flowName, passphrase, context); + } + + public Flow setSourceAddresses(SetSourceAddresses sourceAddresses) { + return serviceManager.flows().setSourceAddresses(resourceGroupName, connectionName, flowName, sourceAddresses); + } + + public Flow setSourceAddresses(SetSourceAddresses sourceAddresses, Context context) { + return serviceManager.flows() + .setSourceAddresses(resourceGroupName, connectionName, flowName, sourceAddresses, 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) { + this.innerModel().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) { + this.innerModel().withIdentity(identity); + return this; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowProfileImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowProfileImpl.java new file mode 100644 index 0000000000000..a5b4fefc1c038 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowProfileImpl.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datatransfer.fluent.models.FlowProfileInner; +import com.azure.resourcemanager.datatransfer.models.FlowProfile; +import com.azure.resourcemanager.datatransfer.models.FlowProfilePatch; +import com.azure.resourcemanager.datatransfer.models.FlowProfilePatchProperties; +import com.azure.resourcemanager.datatransfer.models.FlowProfileProperties; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentity; +import java.util.Collections; +import java.util.Map; + +public final class FlowProfileImpl implements FlowProfile, FlowProfile.Definition, FlowProfile.Update { + private FlowProfileInner innerObject; + + private final com.azure.resourcemanager.datatransfer.DataTransferManager 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 FlowProfileProperties 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 FlowProfileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datatransfer.DataTransferManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String pipelineName; + + private String flowProfileName; + + private FlowProfilePatch updateProperties; + + public FlowProfileImpl withExistingPipeline(String resourceGroupName, String pipelineName) { + this.resourceGroupName = resourceGroupName; + this.pipelineName = pipelineName; + return this; + } + + public FlowProfile create() { + this.innerObject = serviceManager.serviceClient() + .getFlowProfiles() + .createOrUpdate(resourceGroupName, pipelineName, flowProfileName, this.innerModel(), Context.NONE); + return this; + } + + public FlowProfile create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFlowProfiles() + .createOrUpdate(resourceGroupName, pipelineName, flowProfileName, this.innerModel(), context); + return this; + } + + FlowProfileImpl(String name, com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager) { + this.innerObject = new FlowProfileInner(); + this.serviceManager = serviceManager; + this.flowProfileName = name; + } + + public FlowProfileImpl update() { + this.updateProperties = new FlowProfilePatch(); + return this; + } + + public FlowProfile apply() { + this.innerObject = serviceManager.serviceClient() + .getFlowProfiles() + .update(resourceGroupName, pipelineName, flowProfileName, updateProperties, Context.NONE); + return this; + } + + public FlowProfile apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFlowProfiles() + .update(resourceGroupName, pipelineName, flowProfileName, updateProperties, context); + return this; + } + + FlowProfileImpl(FlowProfileInner innerObject, + com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.pipelineName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "pipelines"); + this.flowProfileName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "flowProfiles"); + } + + public FlowProfile refresh() { + this.innerObject = serviceManager.serviceClient() + .getFlowProfiles() + .getWithResponse(resourceGroupName, pipelineName, flowProfileName, Context.NONE) + .getValue(); + return this; + } + + public FlowProfile refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFlowProfiles() + .getWithResponse(resourceGroupName, pipelineName, flowProfileName, context) + .getValue(); + return this; + } + + public FlowProfileImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public FlowProfileImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public FlowProfileImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public FlowProfileImpl withProperties(FlowProfileProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public FlowProfileImpl withIdentity(ManagedServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateProperties.withIdentity(identity); + return this; + } + } + + public FlowProfileImpl withProperties(FlowProfilePatchProperties properties) { + this.updateProperties.withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel() == null || this.innerModel().id() == null; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowProfilesClientImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowProfilesClientImpl.java new file mode 100644 index 0000000000000..77555b80681b4 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowProfilesClientImpl.java @@ -0,0 +1,1031 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datatransfer.fluent.FlowProfilesClient; +import com.azure.resourcemanager.datatransfer.fluent.models.FlowProfileInner; +import com.azure.resourcemanager.datatransfer.implementation.models.FlowProfileListResult; +import com.azure.resourcemanager.datatransfer.models.FlowProfilePatch; +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 FlowProfilesClient. + */ +public final class FlowProfilesClientImpl implements FlowProfilesClient { + /** + * The proxy service used to perform REST calls. + */ + private final FlowProfilesService service; + + /** + * The service client containing this operation class. + */ + private final DataTransferManagementClientImpl client; + + /** + * Initializes an instance of FlowProfilesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FlowProfilesClientImpl(DataTransferManagementClientImpl client) { + this.service + = RestProxy.create(FlowProfilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataTransferManagementClientFlowProfiles to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DataTransferManagementClientFlowProfiles") + public interface FlowProfilesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/flowProfiles/{flowProfileName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @PathParam("flowProfileName") String flowProfileName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/flowProfiles/{flowProfileName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @PathParam("flowProfileName") String flowProfileName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/flowProfiles/{flowProfileName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @PathParam("flowProfileName") String flowProfileName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FlowProfileInner resource, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/flowProfiles/{flowProfileName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @PathParam("flowProfileName") String flowProfileName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FlowProfileInner resource, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/flowProfiles/{flowProfileName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @PathParam("flowProfileName") String flowProfileName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FlowProfilePatch properties, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/flowProfiles/{flowProfileName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @PathParam("flowProfileName") String flowProfileName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FlowProfilePatch properties, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/flowProfiles/{flowProfileName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @PathParam("flowProfileName") String flowProfileName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/flowProfiles/{flowProfileName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @PathParam("flowProfileName") String flowProfileName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/flowProfiles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPipeline(@HostParam("endpoint") 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}/flowProfiles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByPipelineSync(@HostParam("endpoint") 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("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPipelineNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByPipelineNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Retrieves the specified FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String pipelineName, + String flowProfileName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, flowProfileName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the specified FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String pipelineName, String flowProfileName) { + return getWithResponseAsync(resourceGroupName, pipelineName, flowProfileName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the specified FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @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 represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String pipelineName, + String flowProfileName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, pipelineName, flowProfileName, accept, context); + } + + /** + * Retrieves the specified FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowProfileInner get(String resourceGroupName, String pipelineName, String flowProfileName) { + return getWithResponse(resourceGroupName, pipelineName, flowProfileName, Context.NONE).getValue(); + } + + /** + * Creates a new FlowProfile or updates an existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param resource The FlowProfile resource definition to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String pipelineName, String flowProfileName, FlowProfileInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, flowProfileName, contentType, accept, + resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new FlowProfile or updates an existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param resource The FlowProfile resource definition to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String pipelineName, + String flowProfileName, FlowProfileInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, flowProfileName, contentType, accept, + resource, Context.NONE); + } + + /** + * Creates a new FlowProfile or updates an existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param resource The FlowProfile resource definition to create or update. + * @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 represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String pipelineName, + String flowProfileName, FlowProfileInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, flowProfileName, contentType, accept, + resource, context); + } + + /** + * Creates a new FlowProfile or updates an existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param resource The FlowProfile resource definition to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 represents a FlowProfile Azure resource, which defines a data + * replication scenario with a specific data classification and a set of configurable policy rules. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FlowProfileInner> beginCreateOrUpdateAsync( + String resourceGroupName, String pipelineName, String flowProfileName, FlowProfileInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, pipelineName, flowProfileName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + FlowProfileInner.class, FlowProfileInner.class, this.client.getContext()); + } + + /** + * Creates a new FlowProfile or updates an existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param resource The FlowProfile resource definition to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 represents a FlowProfile Azure resource, which defines a data + * replication scenario with a specific data classification and a set of configurable policy rules. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowProfileInner> beginCreateOrUpdate(String resourceGroupName, + String pipelineName, String flowProfileName, FlowProfileInner resource) { + Response response + = createOrUpdateWithResponse(resourceGroupName, pipelineName, flowProfileName, resource); + return this.client.getLroResult(response, FlowProfileInner.class, + FlowProfileInner.class, Context.NONE); + } + + /** + * Creates a new FlowProfile or updates an existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param resource The FlowProfile resource definition to create or update. + * @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 represents a FlowProfile Azure resource, which defines a data + * replication scenario with a specific data classification and a set of configurable policy rules. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowProfileInner> beginCreateOrUpdate(String resourceGroupName, + String pipelineName, String flowProfileName, FlowProfileInner resource, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, pipelineName, flowProfileName, resource, context); + return this.client.getLroResult(response, FlowProfileInner.class, + FlowProfileInner.class, context); + } + + /** + * Creates a new FlowProfile or updates an existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param resource The FlowProfile resource definition to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String pipelineName, + String flowProfileName, FlowProfileInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, pipelineName, flowProfileName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new FlowProfile or updates an existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param resource The FlowProfile resource definition to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowProfileInner createOrUpdate(String resourceGroupName, String pipelineName, String flowProfileName, + FlowProfileInner resource) { + return beginCreateOrUpdate(resourceGroupName, pipelineName, flowProfileName, resource).getFinalResult(); + } + + /** + * Creates a new FlowProfile or updates an existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param resource The FlowProfile resource definition to create or update. + * @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 represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowProfileInner createOrUpdate(String resourceGroupName, String pipelineName, String flowProfileName, + FlowProfileInner resource, Context context) { + return beginCreateOrUpdate(resourceGroupName, pipelineName, flowProfileName, resource, context) + .getFinalResult(); + } + + /** + * Applies partial updates to an existing FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param properties The FlowProfile patch definition containing the properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String pipelineName, + String flowProfileName, FlowProfilePatch properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, flowProfileName, contentType, accept, + properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Applies partial updates to an existing FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param properties The FlowProfile patch definition containing the properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String pipelineName, + String flowProfileName, FlowProfilePatch properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, flowProfileName, contentType, accept, + properties, Context.NONE); + } + + /** + * Applies partial updates to an existing FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param properties The FlowProfile patch definition containing the properties to update. + * @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 represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String pipelineName, + String flowProfileName, FlowProfilePatch properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, flowProfileName, contentType, accept, + properties, context); + } + + /** + * Applies partial updates to an existing FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param properties The FlowProfile patch definition containing the properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 represents a FlowProfile Azure resource, which defines a data + * replication scenario with a specific data classification and a set of configurable policy rules. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FlowProfileInner> beginUpdateAsync(String resourceGroupName, + String pipelineName, String flowProfileName, FlowProfilePatch properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, pipelineName, flowProfileName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + FlowProfileInner.class, FlowProfileInner.class, this.client.getContext()); + } + + /** + * Applies partial updates to an existing FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param properties The FlowProfile patch definition containing the properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 represents a FlowProfile Azure resource, which defines a data + * replication scenario with a specific data classification and a set of configurable policy rules. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowProfileInner> beginUpdate(String resourceGroupName, + String pipelineName, String flowProfileName, FlowProfilePatch properties) { + Response response + = updateWithResponse(resourceGroupName, pipelineName, flowProfileName, properties); + return this.client.getLroResult(response, FlowProfileInner.class, + FlowProfileInner.class, Context.NONE); + } + + /** + * Applies partial updates to an existing FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param properties The FlowProfile patch definition containing the properties to update. + * @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 represents a FlowProfile Azure resource, which defines a data + * replication scenario with a specific data classification and a set of configurable policy rules. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowProfileInner> beginUpdate(String resourceGroupName, + String pipelineName, String flowProfileName, FlowProfilePatch properties, Context context) { + Response response + = updateWithResponse(resourceGroupName, pipelineName, flowProfileName, properties, context); + return this.client.getLroResult(response, FlowProfileInner.class, + FlowProfileInner.class, context); + } + + /** + * Applies partial updates to an existing FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param properties The FlowProfile patch definition containing the properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String pipelineName, String flowProfileName, + FlowProfilePatch properties) { + return beginUpdateAsync(resourceGroupName, pipelineName, flowProfileName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Applies partial updates to an existing FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param properties The FlowProfile patch definition containing the properties to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowProfileInner update(String resourceGroupName, String pipelineName, String flowProfileName, + FlowProfilePatch properties) { + return beginUpdate(resourceGroupName, pipelineName, flowProfileName, properties).getFinalResult(); + } + + /** + * Applies partial updates to an existing FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @param properties The FlowProfile patch definition containing the properties to update. + * @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 represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowProfileInner update(String resourceGroupName, String pipelineName, String flowProfileName, + FlowProfilePatch properties, Context context) { + return beginUpdate(resourceGroupName, pipelineName, flowProfileName, properties, context).getFinalResult(); + } + + /** + * Deletes the specified FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, + String flowProfileName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, flowProfileName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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, + String flowProfileName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, flowProfileName, Context.NONE); + } + + /** + * Deletes the specified FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @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, + String flowProfileName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, flowProfileName, context); + } + + /** + * Deletes the specified FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, + String flowProfileName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, pipelineName, flowProfileName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes the specified FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, + String flowProfileName) { + Response response = deleteWithResponse(resourceGroupName, pipelineName, flowProfileName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @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, + String flowProfileName, Context context) { + Response response = deleteWithResponse(resourceGroupName, pipelineName, flowProfileName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes the specified FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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, String flowProfileName) { + return beginDeleteAsync(resourceGroupName, pipelineName, flowProfileName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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, String flowProfileName) { + beginDelete(resourceGroupName, pipelineName, flowProfileName).getFinalResult(); + } + + /** + * Deletes the specified FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @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, String flowProfileName, Context context) { + beginDelete(resourceGroupName, pipelineName, flowProfileName, context).getFinalResult(); + } + + /** + * Lists all FlowProfiles under a given Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 FlowProfile list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPipelineSinglePageAsync(String resourceGroupName, + String pipelineName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByPipeline(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, 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 FlowProfiles under a given Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 FlowProfile list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPipelineAsync(String resourceGroupName, String pipelineName) { + return new PagedFlux<>(() -> listByPipelineSinglePageAsync(resourceGroupName, pipelineName), + nextLink -> listByPipelineNextSinglePageAsync(nextLink)); + } + + /** + * Lists all FlowProfiles under a given Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 FlowProfile list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByPipelineSinglePage(String resourceGroupName, String pipelineName) { + final String accept = "application/json"; + Response res + = service.listByPipelineSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all FlowProfiles under a given Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @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 FlowProfile list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByPipelineSinglePage(String resourceGroupName, String pipelineName, + Context context) { + final String accept = "application/json"; + Response res + = service.listByPipelineSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all FlowProfiles under a given Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 FlowProfile list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPipeline(String resourceGroupName, String pipelineName) { + return new PagedIterable<>(() -> listByPipelineSinglePage(resourceGroupName, pipelineName), + nextLink -> listByPipelineNextSinglePage(nextLink)); + } + + /** + * Lists all FlowProfiles under a given Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @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 FlowProfile list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPipeline(String resourceGroupName, String pipelineName, + Context context) { + return new PagedIterable<>(() -> listByPipelineSinglePage(resourceGroupName, pipelineName, context), + nextLink -> listByPipelineNextSinglePage(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 FlowProfile list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPipelineNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByPipelineNext(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 FlowProfile list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByPipelineNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByPipelineNextSync(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 FlowProfile list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByPipelineNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByPipelineNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowProfilesImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowProfilesImpl.java new file mode 100644 index 0000000000000..3cb1a8119fa4a --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowProfilesImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.fluent.FlowProfilesClient; +import com.azure.resourcemanager.datatransfer.fluent.models.FlowProfileInner; +import com.azure.resourcemanager.datatransfer.models.FlowProfile; +import com.azure.resourcemanager.datatransfer.models.FlowProfiles; + +public final class FlowProfilesImpl implements FlowProfiles { + private static final ClientLogger LOGGER = new ClientLogger(FlowProfilesImpl.class); + + private final FlowProfilesClient innerClient; + + private final com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager; + + public FlowProfilesImpl(FlowProfilesClient innerClient, + com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String pipelineName, String flowProfileName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, pipelineName, flowProfileName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FlowProfileImpl(inner.getValue(), this.manager())); + } + + public FlowProfile get(String resourceGroupName, String pipelineName, String flowProfileName) { + FlowProfileInner inner = this.serviceClient().get(resourceGroupName, pipelineName, flowProfileName); + if (inner != null) { + return new FlowProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String pipelineName, String flowProfileName) { + this.serviceClient().delete(resourceGroupName, pipelineName, flowProfileName); + } + + public void delete(String resourceGroupName, String pipelineName, String flowProfileName, Context context) { + this.serviceClient().delete(resourceGroupName, pipelineName, flowProfileName, context); + } + + public PagedIterable listByPipeline(String resourceGroupName, String pipelineName) { + PagedIterable inner = this.serviceClient().listByPipeline(resourceGroupName, pipelineName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FlowProfileImpl(inner1, this.manager())); + } + + public PagedIterable listByPipeline(String resourceGroupName, String pipelineName, Context context) { + PagedIterable inner + = this.serviceClient().listByPipeline(resourceGroupName, pipelineName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FlowProfileImpl(inner1, this.manager())); + } + + public FlowProfile 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))); + } + String flowProfileName = ResourceManagerUtils.getValueFromIdByName(id, "flowProfiles"); + if (flowProfileName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flowProfiles'.", id))); + } + return this.getWithResponse(resourceGroupName, pipelineName, flowProfileName, 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))); + } + String flowProfileName = ResourceManagerUtils.getValueFromIdByName(id, "flowProfiles"); + if (flowProfileName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flowProfiles'.", id))); + } + return this.getWithResponse(resourceGroupName, pipelineName, flowProfileName, 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))); + } + String flowProfileName = ResourceManagerUtils.getValueFromIdByName(id, "flowProfiles"); + if (flowProfileName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flowProfiles'.", id))); + } + this.delete(resourceGroupName, pipelineName, flowProfileName, 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))); + } + String flowProfileName = ResourceManagerUtils.getValueFromIdByName(id, "flowProfiles"); + if (flowProfileName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flowProfiles'.", id))); + } + this.delete(resourceGroupName, pipelineName, flowProfileName, context); + } + + private FlowProfilesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datatransfer.DataTransferManager manager() { + return this.serviceManager; + } + + public FlowProfileImpl define(String name) { + return new FlowProfileImpl(name, this.manager()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowProfilesListResultImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowProfilesListResultImpl.java new file mode 100644 index 0000000000000..8959fffa3852d --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowProfilesListResultImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation; + +import com.azure.resourcemanager.datatransfer.fluent.models.FlowProfilesListResultInner; +import com.azure.resourcemanager.datatransfer.models.FlowProfileMetadata; +import com.azure.resourcemanager.datatransfer.models.FlowProfilesListResult; +import java.util.Collections; +import java.util.List; + +public final class FlowProfilesListResultImpl implements FlowProfilesListResult { + private FlowProfilesListResultInner innerObject; + + private final com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager; + + FlowProfilesListResultImpl(FlowProfilesListResultInner innerObject, + com.azure.resourcemanager.datatransfer.DataTransferManager 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 FlowProfilesListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datatransfer.DataTransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowPropertiesImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowPropertiesImpl.java new file mode 100644 index 0000000000000..2bad482754a23 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowPropertiesImpl.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation; + +import com.azure.resourcemanager.datatransfer.fluent.models.FlowPropertiesInner; +import com.azure.resourcemanager.datatransfer.fluent.models.StreamSourceAddressesInner; +import com.azure.resourcemanager.datatransfer.models.ApiFlowOptions; +import com.azure.resourcemanager.datatransfer.models.DataClass; +import com.azure.resourcemanager.datatransfer.models.DataType; +import com.azure.resourcemanager.datatransfer.models.FlowProfileMetadata; +import com.azure.resourcemanager.datatransfer.models.FlowProperties; +import com.azure.resourcemanager.datatransfer.models.FlowStatus; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ForceDisabledStatus; +import com.azure.resourcemanager.datatransfer.models.LinkStatus; +import com.azure.resourcemanager.datatransfer.models.MessagingOptions; +import com.azure.resourcemanager.datatransfer.models.ProvisioningState; +import com.azure.resourcemanager.datatransfer.models.Schema; +import com.azure.resourcemanager.datatransfer.models.SelectedResource; +import com.azure.resourcemanager.datatransfer.models.StreamProtocol; +import com.azure.resourcemanager.datatransfer.models.StreamSourceAddresses; +import java.util.Collections; +import java.util.List; + +public final class FlowPropertiesImpl implements FlowProperties { + private FlowPropertiesInner innerObject; + + private final com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager; + + FlowPropertiesImpl(FlowPropertiesInner innerObject, + com.azure.resourcemanager.datatransfer.DataTransferManager 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 FlowProfileMetadata flowProfile() { + return this.innerModel().flowProfile(); + } + + public DataClass flowDataType() { + return this.innerModel().flowDataType(); + } + + 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.datatransfer.DataTransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowsClientImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowsClientImpl.java new file mode 100644 index 0000000000000..da3557659ac13 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowsClientImpl.java @@ -0,0 +1,2963 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datatransfer.fluent.FlowsClient; +import com.azure.resourcemanager.datatransfer.fluent.models.FlowInner; +import com.azure.resourcemanager.datatransfer.fluent.models.GetDestinationEndpointPortsResultInner; +import com.azure.resourcemanager.datatransfer.fluent.models.GetDestinationEndpointsResultInner; +import com.azure.resourcemanager.datatransfer.fluent.models.GetStreamConnectionStringResultInner; +import com.azure.resourcemanager.datatransfer.fluent.models.StreamSourceAddressesInner; +import com.azure.resourcemanager.datatransfer.implementation.models.FlowListResult; +import com.azure.resourcemanager.datatransfer.models.FlowsPatch; +import com.azure.resourcemanager.datatransfer.models.ResourceBody; +import com.azure.resourcemanager.datatransfer.models.SetDestinationEndpointPorts; +import com.azure.resourcemanager.datatransfer.models.SetDestinationEndpoints; +import com.azure.resourcemanager.datatransfer.models.SetSourceAddresses; +import com.azure.resourcemanager.datatransfer.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 DataTransferManagementClientImpl client; + + /** + * Initializes an instance of FlowsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FlowsClientImpl(DataTransferManagementClientImpl client) { + this.service = RestProxy.create(FlowsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataTransferManagementClientFlows to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DataTransferManagementClientFlows") + public interface FlowsService { + @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("endpoint") 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("endpoint") 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); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FlowInner flow, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FlowInner flow, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FlowsPatch flow, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FlowsPatch flow, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByConnection(@HostParam("endpoint") 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("endpoint") 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}/flows/{flowName}/disable") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> disable(@HostParam("endpoint") 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("endpoint") 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("endpoint") 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("endpoint") 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("endpoint") 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("endpoint") 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("endpoint") 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("endpoint") 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("endpoint") 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("endpoint") 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("endpoint") 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("endpoint") 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("endpoint") 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("endpoint") 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); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/link") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> link(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ResourceBody flow, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/link") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response linkSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ResourceBody flow, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/setDestinationEndpointPorts") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> setDestinationEndpointPorts(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SetDestinationEndpointPorts streamDestinationEndpointPorts, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/setDestinationEndpointPorts") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response setDestinationEndpointPortsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SetDestinationEndpointPorts streamDestinationEndpointPorts, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/setDestinationEndpoints") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> setDestinationEndpoints(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SetDestinationEndpoints streamDestinationEndpoints, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/setDestinationEndpoints") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response setDestinationEndpointsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SetDestinationEndpoints streamDestinationEndpoints, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/setPassphrase") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> setPassphrase(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SetStreamPassphrase passphrase, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/setPassphrase") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response setPassphraseSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SetStreamPassphrase passphrase, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/setSourceAddresses") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> setSourceAddresses(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SetSourceAddresses sourceAddresses, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/setSourceAddresses") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response setSourceAddressesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SetSourceAddresses sourceAddresses, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByConnectionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByConnectionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) { + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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) { + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 flow) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, contentType, accept, flow, + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 createOrUpdateWithResponse(String resourceGroupName, String connectionName, + String flowName, FlowInner flow) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, contentType, accept, flow, + Context.NONE); + } + + /** + * 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 createOrUpdateWithResponse(String resourceGroupName, String connectionName, + String flowName, FlowInner flow, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, contentType, accept, flow, + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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> beginCreateOrUpdateAsync(String resourceGroupName, + String connectionName, String flowName, FlowInner flow) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, connectionName, flowName, flow); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), FlowInner.class, + FlowInner.class, this.client.getContext()); + } + + /** + * 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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> beginCreateOrUpdate(String resourceGroupName, + String connectionName, String flowName, FlowInner flow) { + Response response = createOrUpdateWithResponse(resourceGroupName, connectionName, flowName, flow); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, Context.NONE); + } + + /** + * 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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> beginCreateOrUpdate(String resourceGroupName, + String connectionName, String flowName, FlowInner flow, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, connectionName, flowName, flow, context); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 flow) { + return beginCreateOrUpdateAsync(resourceGroupName, connectionName, flowName, flow).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 flow) { + return beginCreateOrUpdate(resourceGroupName, connectionName, flowName, flow).getFinalResult(); + } + + /** + * 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 createOrUpdate(String resourceGroupName, String connectionName, String flowName, FlowInner flow, + Context context) { + return beginCreateOrUpdate(resourceGroupName, connectionName, flowName, flow, context).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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 flow) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, contentType, accept, flow, + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 flow) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, contentType, accept, flow, + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 flow, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, contentType, accept, flow, + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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, Void> beginUpdateAsync(String resourceGroupName, String connectionName, + String flowName, FlowsPatch flow) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, connectionName, flowName, flow); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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, Void> beginUpdate(String resourceGroupName, String connectionName, + String flowName, FlowsPatch flow) { + Response response = updateWithResponse(resourceGroupName, connectionName, flowName, flow); + return this.client.getLroResult(response, Void.class, Void.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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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, Void> beginUpdate(String resourceGroupName, String connectionName, + String flowName, FlowsPatch flow, Context context) { + Response response = updateWithResponse(resourceGroupName, connectionName, flowName, flow, context); + return this.client.getLroResult(response, Void.class, Void.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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 flow) { + return beginUpdateAsync(resourceGroupName, connectionName, flowName, flow).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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void update(String resourceGroupName, String connectionName, String flowName, FlowsPatch flow) { + beginUpdate(resourceGroupName, connectionName, flowName, flow).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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void update(String resourceGroupName, String connectionName, String flowName, FlowsPatch flow, + Context context) { + beginUpdate(resourceGroupName, connectionName, flowName, flow, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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(); + } + + /** + * 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 to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) { + 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 to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) { + 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 to perform the operation on. + * @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) { + 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 to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 to perform the operation on. + * @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)); + } + + /** + * Disables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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) { + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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) { + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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) { + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getDestinationEndpointPortsWithResponseAsync(String resourceGroupName, String connectionName, String flowName) { + 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDestinationEndpointPortsWithResponse( + String resourceGroupName, String connectionName, String flowName, Context context) { + 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getDestinationEndpointsWithResponseAsync(String resourceGroupName, String connectionName, String flowName) { + 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDestinationEndpointsWithResponse(String resourceGroupName, + String connectionName, String flowName, Context context) { + 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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. + */ + @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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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) { + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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) { + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 flow) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.link(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, contentType, accept, flow, + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 flow) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.linkSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, connectionName, flowName, contentType, accept, flow, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 flow, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.linkSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, connectionName, flowName, contentType, accept, flow, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 flow) { + Mono>> mono + = linkWithResponseAsync(resourceGroupName, connectionName, flowName, flow); + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 flow) { + Response response = linkWithResponse(resourceGroupName, connectionName, flowName, flow); + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 flow, Context context) { + Response response = linkWithResponse(resourceGroupName, connectionName, flowName, flow, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 flow) { + return beginLinkAsync(resourceGroupName, connectionName, flowName, flow).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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 flow) { + return beginLink(resourceGroupName, connectionName, flowName, flow).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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 flow, + Context context) { + return beginLink(resourceGroupName, connectionName, flowName, flow, context).getFinalResult(); + } + + /** + * Set the destination endpoint ports for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpointPorts The 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 streamDestinationEndpointPorts) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.setDestinationEndpointPorts(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, connectionName, + flowName, contentType, accept, streamDestinationEndpointPorts, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Set the destination endpoint ports for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpointPorts The 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 streamDestinationEndpointPorts) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.setDestinationEndpointPortsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, contentType, accept, + streamDestinationEndpointPorts, Context.NONE); + } + + /** + * Set the destination endpoint ports for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpointPorts The 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 streamDestinationEndpointPorts, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.setDestinationEndpointPortsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, contentType, accept, + streamDestinationEndpointPorts, context); + } + + /** + * Set the destination endpoint ports for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpointPorts The 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 streamDestinationEndpointPorts) { + Mono>> mono = setDestinationEndpointPortsWithResponseAsync(resourceGroupName, + connectionName, flowName, streamDestinationEndpointPorts); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), FlowInner.class, + FlowInner.class, this.client.getContext()); + } + + /** + * Set the destination endpoint ports for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpointPorts The 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 streamDestinationEndpointPorts) { + Response response = setDestinationEndpointPortsWithResponse(resourceGroupName, connectionName, + flowName, streamDestinationEndpointPorts); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, Context.NONE); + } + + /** + * Set the destination endpoint ports for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpointPorts The 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 streamDestinationEndpointPorts, + Context context) { + Response response = setDestinationEndpointPortsWithResponse(resourceGroupName, connectionName, + flowName, streamDestinationEndpointPorts, context); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, context); + } + + /** + * Set the destination endpoint ports for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpointPorts The 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 streamDestinationEndpointPorts) { + return beginSetDestinationEndpointPortsAsync(resourceGroupName, connectionName, flowName, + streamDestinationEndpointPorts).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Set the destination endpoint ports for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpointPorts The 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 streamDestinationEndpointPorts) { + return beginSetDestinationEndpointPorts(resourceGroupName, connectionName, flowName, + streamDestinationEndpointPorts).getFinalResult(); + } + + /** + * Set the destination endpoint ports for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpointPorts The 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 streamDestinationEndpointPorts, Context context) { + return beginSetDestinationEndpointPorts(resourceGroupName, connectionName, flowName, + streamDestinationEndpointPorts, context).getFinalResult(); + } + + /** + * Set the destination endpoints for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpoints 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 streamDestinationEndpoints) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.setDestinationEndpoints(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, connectionName, + flowName, contentType, accept, streamDestinationEndpoints, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Set the destination endpoints for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpoints 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 streamDestinationEndpoints) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.setDestinationEndpointsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, contentType, accept, + streamDestinationEndpoints, Context.NONE); + } + + /** + * Set the destination endpoints for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpoints 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 streamDestinationEndpoints, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.setDestinationEndpointsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, contentType, accept, + streamDestinationEndpoints, context); + } + + /** + * Set the destination endpoints for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpoints 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 streamDestinationEndpoints) { + Mono>> mono = setDestinationEndpointsWithResponseAsync(resourceGroupName, + connectionName, flowName, streamDestinationEndpoints); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), FlowInner.class, + FlowInner.class, this.client.getContext()); + } + + /** + * Set the destination endpoints for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpoints 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 streamDestinationEndpoints) { + Response response = setDestinationEndpointsWithResponse(resourceGroupName, connectionName, flowName, + streamDestinationEndpoints); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, Context.NONE); + } + + /** + * Set the destination endpoints for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpoints 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 streamDestinationEndpoints, Context context) { + Response response = setDestinationEndpointsWithResponse(resourceGroupName, connectionName, flowName, + streamDestinationEndpoints, context); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, context); + } + + /** + * Set the destination endpoints for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpoints 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 streamDestinationEndpoints) { + return beginSetDestinationEndpointsAsync(resourceGroupName, connectionName, flowName, + streamDestinationEndpoints).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Set the destination endpoints for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpoints 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 streamDestinationEndpoints) { + return beginSetDestinationEndpoints(resourceGroupName, connectionName, flowName, streamDestinationEndpoints) + .getFinalResult(); + } + + /** + * Set the destination endpoints for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpoints 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 streamDestinationEndpoints, Context context) { + return beginSetDestinationEndpoints(resourceGroupName, connectionName, flowName, streamDestinationEndpoints, + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param passphrase 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 passphrase) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.setPassphrase(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, contentType, accept, + passphrase, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param passphrase 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 passphrase) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.setPassphraseSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, contentType, accept, + passphrase, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param passphrase 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 passphrase, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.setPassphraseSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, contentType, accept, + passphrase, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param passphrase 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 passphrase) { + Mono>> mono + = setPassphraseWithResponseAsync(resourceGroupName, connectionName, flowName, passphrase); + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param passphrase 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 passphrase) { + Response response + = setPassphraseWithResponse(resourceGroupName, connectionName, flowName, passphrase); + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param passphrase 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 passphrase, Context context) { + Response response + = setPassphraseWithResponse(resourceGroupName, connectionName, flowName, passphrase, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param passphrase 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 passphrase) { + return beginSetPassphraseAsync(resourceGroupName, connectionName, flowName, passphrase).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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param passphrase 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 passphrase) { + return beginSetPassphrase(resourceGroupName, connectionName, flowName, passphrase).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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param passphrase 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 passphrase, Context context) { + return beginSetPassphrase(resourceGroupName, connectionName, flowName, passphrase, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param sourceAddresses 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 sourceAddresses) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.setSourceAddresses(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, contentType, accept, + sourceAddresses, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param sourceAddresses 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 sourceAddresses) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.setSourceAddressesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, contentType, accept, + sourceAddresses, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param sourceAddresses 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 sourceAddresses, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.setSourceAddressesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, contentType, accept, + sourceAddresses, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param sourceAddresses 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 sourceAddresses) { + Mono>> mono + = setSourceAddressesWithResponseAsync(resourceGroupName, connectionName, flowName, sourceAddresses); + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param sourceAddresses 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 sourceAddresses) { + Response response + = setSourceAddressesWithResponse(resourceGroupName, connectionName, flowName, sourceAddresses); + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param sourceAddresses 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 sourceAddresses, Context context) { + Response response + = setSourceAddressesWithResponse(resourceGroupName, connectionName, flowName, sourceAddresses, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param sourceAddresses 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 sourceAddresses) { + return beginSetSourceAddressesAsync(resourceGroupName, connectionName, flowName, sourceAddresses).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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param sourceAddresses 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 sourceAddresses) { + return beginSetSourceAddresses(resourceGroupName, connectionName, flowName, sourceAddresses).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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param sourceAddresses 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 sourceAddresses, Context context) { + return beginSetSourceAddresses(resourceGroupName, connectionName, flowName, sourceAddresses, 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 flows in a connection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByConnectionNextSinglePageAsync(String nextLink) { + 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 flows in a connection along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByConnectionNextSinglePage(String nextLink) { + 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 flows in a connection along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByConnectionNextSinglePage(String nextLink, Context context) { + 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); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowsImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowsImpl.java new file mode 100644 index 0000000000000..8bc5491c215ab --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowsImpl.java @@ -0,0 +1,412 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.fluent.FlowsClient; +import com.azure.resourcemanager.datatransfer.fluent.models.FlowInner; +import com.azure.resourcemanager.datatransfer.fluent.models.GetDestinationEndpointPortsResultInner; +import com.azure.resourcemanager.datatransfer.fluent.models.GetDestinationEndpointsResultInner; +import com.azure.resourcemanager.datatransfer.fluent.models.GetStreamConnectionStringResultInner; +import com.azure.resourcemanager.datatransfer.fluent.models.StreamSourceAddressesInner; +import com.azure.resourcemanager.datatransfer.models.Flow; +import com.azure.resourcemanager.datatransfer.models.Flows; +import com.azure.resourcemanager.datatransfer.models.FlowsPatch; +import com.azure.resourcemanager.datatransfer.models.GetDestinationEndpointPortsResult; +import com.azure.resourcemanager.datatransfer.models.GetDestinationEndpointsResult; +import com.azure.resourcemanager.datatransfer.models.GetStreamConnectionStringResult; +import com.azure.resourcemanager.datatransfer.models.ResourceBody; +import com.azure.resourcemanager.datatransfer.models.SetDestinationEndpointPorts; +import com.azure.resourcemanager.datatransfer.models.SetDestinationEndpoints; +import com.azure.resourcemanager.datatransfer.models.SetSourceAddresses; +import com.azure.resourcemanager.datatransfer.models.SetStreamPassphrase; +import com.azure.resourcemanager.datatransfer.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.datatransfer.DataTransferManager serviceManager; + + public FlowsImpl(FlowsClient innerClient, + com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String connectionName, String flowName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, connectionName, flowName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FlowImpl(inner.getValue(), this.manager())); + } + + 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 update(String resourceGroupName, String connectionName, String flowName, FlowsPatch flow) { + this.serviceClient().update(resourceGroupName, connectionName, flowName, flow); + } + + public void update(String resourceGroupName, String connectionName, String flowName, FlowsPatch flow, + Context context) { + this.serviceClient().update(resourceGroupName, connectionName, flowName, flow, context); + } + + 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 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 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); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GetDestinationEndpointPortsResultImpl(inner.getValue(), this.manager())); + } + + 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); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GetDestinationEndpointsResultImpl(inner.getValue(), this.manager())); + } + + 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); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new StreamSourceAddressesImpl(inner.getValue(), this.manager())); + } + + 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); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GetStreamConnectionStringResultImpl(inner.getValue(), this.manager())); + } + + 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 flow) { + FlowInner inner = this.serviceClient().link(resourceGroupName, connectionName, flowName, flow); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow link(String resourceGroupName, String connectionName, String flowName, ResourceBody flow, + Context context) { + FlowInner inner = this.serviceClient().link(resourceGroupName, connectionName, flowName, flow, context); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow setDestinationEndpointPorts(String resourceGroupName, String connectionName, String flowName, + SetDestinationEndpointPorts streamDestinationEndpointPorts) { + FlowInner inner = this.serviceClient() + .setDestinationEndpointPorts(resourceGroupName, connectionName, flowName, streamDestinationEndpointPorts); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow setDestinationEndpointPorts(String resourceGroupName, String connectionName, String flowName, + SetDestinationEndpointPorts streamDestinationEndpointPorts, Context context) { + FlowInner inner = this.serviceClient() + .setDestinationEndpointPorts(resourceGroupName, connectionName, flowName, streamDestinationEndpointPorts, + context); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow setDestinationEndpoints(String resourceGroupName, String connectionName, String flowName, + SetDestinationEndpoints streamDestinationEndpoints) { + FlowInner inner = this.serviceClient() + .setDestinationEndpoints(resourceGroupName, connectionName, flowName, streamDestinationEndpoints); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow setDestinationEndpoints(String resourceGroupName, String connectionName, String flowName, + SetDestinationEndpoints streamDestinationEndpoints, Context context) { + FlowInner inner = this.serviceClient() + .setDestinationEndpoints(resourceGroupName, connectionName, flowName, streamDestinationEndpoints, context); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow setPassphrase(String resourceGroupName, String connectionName, String flowName, + SetStreamPassphrase passphrase) { + FlowInner inner = this.serviceClient().setPassphrase(resourceGroupName, connectionName, flowName, passphrase); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow setPassphrase(String resourceGroupName, String connectionName, String flowName, + SetStreamPassphrase passphrase, Context context) { + FlowInner inner + = this.serviceClient().setPassphrase(resourceGroupName, connectionName, flowName, passphrase, context); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow setSourceAddresses(String resourceGroupName, String connectionName, String flowName, + SetSourceAddresses sourceAddresses) { + FlowInner inner + = this.serviceClient().setSourceAddresses(resourceGroupName, connectionName, flowName, sourceAddresses); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow setSourceAddresses(String resourceGroupName, String connectionName, String flowName, + SetSourceAddresses sourceAddresses, Context context) { + FlowInner inner = this.serviceClient() + .setSourceAddresses(resourceGroupName, connectionName, flowName, sourceAddresses, 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.datatransfer.DataTransferManager manager() { + return this.serviceManager; + } + + public FlowImpl define(String name) { + return new FlowImpl(name, this.manager()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/GetDestinationEndpointPortsResultImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/GetDestinationEndpointPortsResultImpl.java new file mode 100644 index 0000000000000..c159c76acfa88 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/GetDestinationEndpointPortsResultImpl.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation; + +import com.azure.resourcemanager.datatransfer.fluent.models.GetDestinationEndpointPortsResultInner; +import com.azure.resourcemanager.datatransfer.models.GetDestinationEndpointPortsResult; +import java.util.Collections; +import java.util.List; + +public final class GetDestinationEndpointPortsResultImpl implements GetDestinationEndpointPortsResult { + private GetDestinationEndpointPortsResultInner innerObject; + + private final com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager; + + GetDestinationEndpointPortsResultImpl(GetDestinationEndpointPortsResultInner innerObject, + com.azure.resourcemanager.datatransfer.DataTransferManager 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.datatransfer.DataTransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/GetDestinationEndpointsResultImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/GetDestinationEndpointsResultImpl.java new file mode 100644 index 0000000000000..6b4baa60dbfde --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/GetDestinationEndpointsResultImpl.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation; + +import com.azure.resourcemanager.datatransfer.fluent.models.GetDestinationEndpointsResultInner; +import com.azure.resourcemanager.datatransfer.models.GetDestinationEndpointsResult; +import java.util.Collections; +import java.util.List; + +public final class GetDestinationEndpointsResultImpl implements GetDestinationEndpointsResult { + private GetDestinationEndpointsResultInner innerObject; + + private final com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager; + + GetDestinationEndpointsResultImpl(GetDestinationEndpointsResultInner innerObject, + com.azure.resourcemanager.datatransfer.DataTransferManager 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.datatransfer.DataTransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/GetStreamConnectionStringResultImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/GetStreamConnectionStringResultImpl.java new file mode 100644 index 0000000000000..37a8c68b3fb5c --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/GetStreamConnectionStringResultImpl.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation; + +import com.azure.resourcemanager.datatransfer.fluent.models.GetStreamConnectionStringResultInner; +import com.azure.resourcemanager.datatransfer.models.GetStreamConnectionStringResult; + +public final class GetStreamConnectionStringResultImpl implements GetStreamConnectionStringResult { + private GetStreamConnectionStringResultInner innerObject; + + private final com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager; + + GetStreamConnectionStringResultImpl(GetStreamConnectionStringResultInner innerObject, + com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String connectionString() { + return this.innerModel().connectionString(); + } + + public GetStreamConnectionStringResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datatransfer.DataTransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/ListFlowsByPipelineResultImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/ListFlowsByPipelineResultImpl.java new file mode 100644 index 0000000000000..3bed4b23d8984 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/ListFlowsByPipelineResultImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation; + +import com.azure.resourcemanager.datatransfer.fluent.models.ListFlowsByPipelineResultInner; +import com.azure.resourcemanager.datatransfer.models.ListFlowsByPipelineConnection; +import com.azure.resourcemanager.datatransfer.models.ListFlowsByPipelineResult; +import java.util.Collections; +import java.util.List; + +public final class ListFlowsByPipelineResultImpl implements ListFlowsByPipelineResult { + private ListFlowsByPipelineResultInner innerObject; + + private final com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager; + + ListFlowsByPipelineResultImpl(ListFlowsByPipelineResultInner innerObject, + com.azure.resourcemanager.datatransfer.DataTransferManager 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.datatransfer.DataTransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/ListPipelineMetadataResultImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/ListPipelineMetadataResultImpl.java new file mode 100644 index 0000000000000..3e7728858296c --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/ListPipelineMetadataResultImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation; + +import com.azure.resourcemanager.datatransfer.fluent.models.ListPipelineMetadataResultInner; +import com.azure.resourcemanager.datatransfer.models.DirectionSettings; +import com.azure.resourcemanager.datatransfer.models.ListPipelineMetadataResult; + +public final class ListPipelineMetadataResultImpl implements ListPipelineMetadataResult { + private ListPipelineMetadataResultInner innerObject; + + private final com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager; + + ListPipelineMetadataResultImpl(ListPipelineMetadataResultInner innerObject, + com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public DirectionSettings send() { + return this.innerModel().send(); + } + + public DirectionSettings receive() { + return this.innerModel().receive(); + } + + public ListPipelineMetadataResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datatransfer.DataTransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/OperationImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/OperationImpl.java new file mode 100644 index 0000000000000..16fbeb73eb01a --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/OperationImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation; + +import com.azure.resourcemanager.datatransfer.fluent.models.OperationInner; +import com.azure.resourcemanager.datatransfer.models.ActionType; +import com.azure.resourcemanager.datatransfer.models.Operation; +import com.azure.resourcemanager.datatransfer.models.OperationDisplay; +import com.azure.resourcemanager.datatransfer.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager; + + OperationImpl(OperationInner innerObject, + com.azure.resourcemanager.datatransfer.DataTransferManager 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.datatransfer.DataTransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/OperationsClientImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..7c79b83210492 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/OperationsClientImpl.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.datatransfer.fluent.OperationsClient; +import com.azure.resourcemanager.datatransfer.fluent.models.OperationInner; +import com.azure.resourcemanager.datatransfer.implementation.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public final class OperationsClientImpl implements OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OperationsService service; + + /** + * The service client containing this operation class. + */ + private final DataTransferManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(DataTransferManagementClientImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataTransferManagementClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DataTransferManagementClientOperations") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.AzureDataTransfer/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.AzureDataTransfer/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/OperationsImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..ea836cf1956a6 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.fluent.OperationsClient; +import com.azure.resourcemanager.datatransfer.fluent.models.OperationInner; +import com.azure.resourcemanager.datatransfer.models.Operation; +import com.azure.resourcemanager.datatransfer.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.datatransfer.DataTransferManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.datatransfer.DataTransferManager 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.datatransfer.DataTransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/PendingConnectionImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/PendingConnectionImpl.java new file mode 100644 index 0000000000000..904950191a8f5 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/PendingConnectionImpl.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.datatransfer.fluent.models.PendingConnectionInner; +import com.azure.resourcemanager.datatransfer.models.ConnectionStatus; +import com.azure.resourcemanager.datatransfer.models.Direction; +import com.azure.resourcemanager.datatransfer.models.FlowProfileMetadata; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ForceDisabledStatus; +import com.azure.resourcemanager.datatransfer.models.LinkStatus; +import com.azure.resourcemanager.datatransfer.models.PendingConnection; +import com.azure.resourcemanager.datatransfer.models.ProvisioningState; +import com.azure.resourcemanager.datatransfer.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.datatransfer.DataTransferManager serviceManager; + + PendingConnectionImpl(PendingConnectionInner innerObject, + com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String subscriptionId() { + return this.innerModel().subscriptionId(); + } + + 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 List flowProfileList() { + List inner = this.innerModel().flowProfileList(); + 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 String apiHostname() { + return this.innerModel().apiHostname(); + } + + 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 PendingConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datatransfer.DataTransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/PendingFlowImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/PendingFlowImpl.java new file mode 100644 index 0000000000000..88405e97a7020 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/PendingFlowImpl.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.datatransfer.fluent.models.PendingFlowInner; +import com.azure.resourcemanager.datatransfer.fluent.models.StreamSourceAddressesInner; +import com.azure.resourcemanager.datatransfer.models.ApiFlowOptions; +import com.azure.resourcemanager.datatransfer.models.DataClass; +import com.azure.resourcemanager.datatransfer.models.DataType; +import com.azure.resourcemanager.datatransfer.models.FlowProfileMetadata; +import com.azure.resourcemanager.datatransfer.models.FlowStatus; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ForceDisabledStatus; +import com.azure.resourcemanager.datatransfer.models.LinkStatus; +import com.azure.resourcemanager.datatransfer.models.MessagingOptions; +import com.azure.resourcemanager.datatransfer.models.PendingFlow; +import com.azure.resourcemanager.datatransfer.models.ProvisioningState; +import com.azure.resourcemanager.datatransfer.models.Schema; +import com.azure.resourcemanager.datatransfer.models.SelectedResource; +import com.azure.resourcemanager.datatransfer.models.StreamProtocol; +import com.azure.resourcemanager.datatransfer.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.datatransfer.DataTransferManager serviceManager; + + PendingFlowImpl(PendingFlowInner innerObject, + com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String subscriptionId() { + return this.innerModel().subscriptionId(); + } + + public String connectionId() { + return this.innerModel().connectionId(); + } + + 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 FlowProfileMetadata flowProfile() { + return this.innerModel().flowProfile(); + } + + public DataClass flowDataType() { + return this.innerModel().flowDataType(); + } + + 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 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 PendingFlowInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datatransfer.DataTransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/PipelineImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/PipelineImpl.java new file mode 100644 index 0000000000000..efaafeea9a8a3 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/PipelineImpl.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.fluent.models.PipelineInner; +import com.azure.resourcemanager.datatransfer.models.Action; +import com.azure.resourcemanager.datatransfer.models.Connection; +import com.azure.resourcemanager.datatransfer.models.ConnectionIdList; +import com.azure.resourcemanager.datatransfer.models.ListFlowsByPipelineResult; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.datatransfer.models.Pipeline; +import com.azure.resourcemanager.datatransfer.models.PipelineProperties; +import com.azure.resourcemanager.datatransfer.models.ResourceBody; +import com.azure.resourcemanager.datatransfer.models.Schema; +import com.azure.resourcemanager.datatransfer.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.datatransfer.DataTransferManager 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.datatransfer.DataTransferManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String pipelineName; + + 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.datatransfer.DataTransferManager serviceManager) { + this.innerObject = new PipelineInner(); + this.serviceManager = serviceManager; + this.pipelineName = name; + } + + public PipelineImpl update() { + return this; + } + + public Pipeline apply() { + this.innerObject = serviceManager.serviceClient() + .getPipelines() + .createOrUpdate(resourceGroupName, pipelineName, this.innerModel(), Context.NONE); + return this; + } + + public Pipeline apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPipelines() + .createOrUpdate(resourceGroupName, pipelineName, this.innerModel(), context); + return this; + } + + PipelineImpl(PipelineInner innerObject, com.azure.resourcemanager.datatransfer.DataTransferManager 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 connection) { + return serviceManager.pipelines().approveConnection(resourceGroupName, pipelineName, connection); + } + + public Connection approveConnection(ResourceBody connection, Context context) { + return serviceManager.pipelines().approveConnection(resourceGroupName, pipelineName, connection, context); + } + + public Pipeline executeAction(Action action) { + return serviceManager.pipelines().executeAction(resourceGroupName, pipelineName, action); + } + + public Pipeline executeAction(Action action, Context context) { + return serviceManager.pipelines().executeAction(resourceGroupName, pipelineName, action, 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 schema, Context context) { + return serviceManager.pipelines().listSchemasListWithResponse(resourceGroupName, pipelineName, schema, context); + } + + public SchemasListResult listSchemasList(Schema schema) { + return serviceManager.pipelines().listSchemasList(resourceGroupName, pipelineName, schema); + } + + public Connection rejectConnection(ResourceBody connection) { + return serviceManager.pipelines().rejectConnection(resourceGroupName, pipelineName, connection); + } + + public Connection rejectConnection(ResourceBody connection, Context context) { + return serviceManager.pipelines().rejectConnection(resourceGroupName, pipelineName, connection, 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) { + this.innerModel().withTags(tags); + return this; + } + + public PipelineImpl withProperties(PipelineProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public PipelineImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/PipelinesClientImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/PipelinesClientImpl.java new file mode 100644 index 0000000000000..bf04d738b5353 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/PipelinesClientImpl.java @@ -0,0 +1,1886 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datatransfer.fluent.PipelinesClient; +import com.azure.resourcemanager.datatransfer.fluent.models.ConnectionInner; +import com.azure.resourcemanager.datatransfer.fluent.models.ListFlowsByPipelineResultInner; +import com.azure.resourcemanager.datatransfer.fluent.models.PipelineInner; +import com.azure.resourcemanager.datatransfer.fluent.models.SchemasListResultInner; +import com.azure.resourcemanager.datatransfer.implementation.models.PipelineListResult; +import com.azure.resourcemanager.datatransfer.models.Action; +import com.azure.resourcemanager.datatransfer.models.ConnectionIdList; +import com.azure.resourcemanager.datatransfer.models.PipelinesPatch; +import com.azure.resourcemanager.datatransfer.models.ResourceBody; +import com.azure.resourcemanager.datatransfer.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 DataTransferManagementClientImpl client; + + /** + * Initializes an instance of PipelinesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PipelinesClientImpl(DataTransferManagementClientImpl client) { + this.service + = RestProxy.create(PipelinesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataTransferManagementClientPipelines to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DataTransferManagementClientPipelines") + public interface PipelinesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("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("endpoint") 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); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PipelineInner pipeline, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PipelineInner pipeline, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PipelinesPatch pipeline, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PipelinesPatch pipeline, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureDataTransfer/pipelines") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscription(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureDataTransfer/pipelines") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/approveConnection") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> approveConnection(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ResourceBody connection, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/approveConnection") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response approveConnectionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ResourceBody connection, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/executeAction") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> executeAction(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") Action action, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/executeAction") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response executeActionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") Action action, 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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ConnectionIdList connections, + 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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ConnectionIdList connections, + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/listSchemas") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSchemasList(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") Schema schema, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/listSchemas") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSchemasListSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") Schema schema, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/rejectConnection") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> rejectConnection(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ResourceBody connection, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/rejectConnection") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response rejectConnectionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ResourceBody connection, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Retrieves the specified Pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> getByResourceGroupWithResponseAsync(String resourceGroupName, + String pipelineName) { + 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())); + } + + /** + * Retrieves the specified Pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getByResourceGroupAsync(String resourceGroupName, String pipelineName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, pipelineName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the specified Pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @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) + public Response getByResourceGroupWithResponse(String resourceGroupName, String pipelineName, + Context context) { + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, accept, context); + } + + /** + * Retrieves the specified Pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getByResourceGroup(String resourceGroupName, String pipelineName) { + return getByResourceGroupWithResponse(resourceGroupName, pipelineName, Context.NONE).getValue(); + } + + /** + * Creates a new Pipeline resource or updates an existing one. This operation is asynchronous and returns the + * resulting Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the Pipeline definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 pipeline) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, contentType, accept, pipeline, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new Pipeline resource or updates an existing one. This operation is asynchronous and returns the + * resulting Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the Pipeline definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 pipeline) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, contentType, accept, pipeline, + Context.NONE); + } + + /** + * Creates a new Pipeline resource or updates an existing one. This operation is asynchronous and returns the + * resulting Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the Pipeline definition. + * @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 pipeline, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, contentType, accept, pipeline, context); + } + + /** + * Creates a new Pipeline resource or updates an existing one. This operation is asynchronous and returns the + * resulting Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the Pipeline definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 pipeline) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, pipelineName, pipeline); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + PipelineInner.class, PipelineInner.class, this.client.getContext()); + } + + /** + * Creates a new Pipeline resource or updates an existing one. This operation is asynchronous and returns the + * resulting Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the Pipeline definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 pipeline) { + Response response = createOrUpdateWithResponse(resourceGroupName, pipelineName, pipeline); + return this.client.getLroResult(response, PipelineInner.class, + PipelineInner.class, Context.NONE); + } + + /** + * Creates a new Pipeline resource or updates an existing one. This operation is asynchronous and returns the + * resulting Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the Pipeline definition. + * @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 pipeline, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, pipelineName, pipeline, context); + return this.client.getLroResult(response, PipelineInner.class, + PipelineInner.class, context); + } + + /** + * Creates a new Pipeline resource or updates an existing one. This operation is asynchronous and returns the + * resulting Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the Pipeline definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 pipeline) { + return beginCreateOrUpdateAsync(resourceGroupName, pipelineName, pipeline).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new Pipeline resource or updates an existing one. This operation is asynchronous and returns the + * resulting Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the Pipeline definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 pipeline) { + return beginCreateOrUpdate(resourceGroupName, pipelineName, pipeline).getFinalResult(); + } + + /** + * Creates a new Pipeline resource or updates an existing one. This operation is asynchronous and returns the + * resulting Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the Pipeline definition. + * @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 pipeline, + Context context) { + return beginCreateOrUpdate(resourceGroupName, pipelineName, pipeline, context).getFinalResult(); + } + + /** + * Applies partial updates to an existing Pipeline resource. This operation supports patch semantics and returns the + * updated Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the updated Pipeline properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the 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 pipeline) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, contentType, accept, pipeline, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Applies partial updates to an existing Pipeline resource. This operation supports patch semantics and returns the + * updated Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the updated Pipeline properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String pipelineName, + PipelinesPatch pipeline) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, contentType, accept, pipeline, + Context.NONE); + } + + /** + * Applies partial updates to an existing Pipeline resource. This operation supports patch semantics and returns the + * updated Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the updated Pipeline properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String pipelineName, + PipelinesPatch pipeline, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, contentType, accept, pipeline, context); + } + + /** + * Applies partial updates to an existing Pipeline resource. This operation supports patch semantics and returns the + * updated Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the updated Pipeline properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUpdateAsync(String resourceGroupName, String pipelineName, + PipelinesPatch pipeline) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, pipelineName, pipeline); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Applies partial updates to an existing Pipeline resource. This operation supports patch semantics and returns the + * updated Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the updated Pipeline properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpdate(String resourceGroupName, String pipelineName, + PipelinesPatch pipeline) { + Response response = updateWithResponse(resourceGroupName, pipelineName, pipeline); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Applies partial updates to an existing Pipeline resource. This operation supports patch semantics and returns the + * updated Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the updated Pipeline properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpdate(String resourceGroupName, String pipelineName, + PipelinesPatch pipeline, Context context) { + Response response = updateWithResponse(resourceGroupName, pipelineName, pipeline, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Applies partial updates to an existing Pipeline resource. This operation supports patch semantics and returns the + * updated Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the updated Pipeline properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String pipelineName, PipelinesPatch pipeline) { + return beginUpdateAsync(resourceGroupName, pipelineName, pipeline).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Applies partial updates to an existing Pipeline resource. This operation supports patch semantics and returns the + * updated Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the updated Pipeline properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void update(String resourceGroupName, String pipelineName, PipelinesPatch pipeline) { + beginUpdate(resourceGroupName, pipelineName, pipeline).getFinalResult(); + } + + /** + * Applies partial updates to an existing Pipeline resource. This operation supports patch semantics and returns the + * updated Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the updated Pipeline properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void update(String resourceGroupName, String pipelineName, PipelinesPatch pipeline, Context context) { + beginUpdate(resourceGroupName, pipelineName, pipeline, context).getFinalResult(); + } + + /** + * Deletes the specified Pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified Pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, Context.NONE); + } + + /** + * Deletes the specified Pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @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) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, context); + } + + /** + * Deletes the specified Pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 specified Pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 specified Pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @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 specified Pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified Pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 specified Pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @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(); + } + + /** + * Lists all Pipeline resources within the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all Pipeline resources within the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Pipeline resources within the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all Pipeline resources within the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all Pipeline resources within the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * Lists all Pipeline resources within the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * Lists all Pipeline resources within the current subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionSinglePageAsync() { + 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())); + } + + /** + * Lists all Pipeline resources within the current subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionAsync() { + return new PagedFlux<>(() -> listBySubscriptionSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Pipeline resources within the current subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionSinglePage() { + 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); + } + + /** + * Lists all Pipeline resources within the current subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionSinglePage(Context context) { + 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); + } + + /** + * Lists all Pipeline resources within the current subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscription() { + return new PagedIterable<>(() -> listBySubscriptionSinglePage(), + nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * Lists all Pipeline resources within the current subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscription(Context context) { + return new PagedIterable<>(() -> listBySubscriptionSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + } + + /** + * Approves a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to approve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 connection) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.approveConnection(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, contentType, accept, connection, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Approves a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to approve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 connection) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.approveConnectionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, contentType, accept, connection, + Context.NONE); + } + + /** + * Approves a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to approve. + * @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 connection, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.approveConnectionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, contentType, accept, connection, context); + } + + /** + * Approves a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to approve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 connection) { + Mono>> mono + = approveConnectionWithResponseAsync(resourceGroupName, pipelineName, connection); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ConnectionInner.class, ConnectionInner.class, this.client.getContext()); + } + + /** + * Approves a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to approve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 connection) { + Response response = approveConnectionWithResponse(resourceGroupName, pipelineName, connection); + return this.client.getLroResult(response, ConnectionInner.class, + ConnectionInner.class, Context.NONE); + } + + /** + * Approves a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to approve. + * @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 connection, Context context) { + Response response + = approveConnectionWithResponse(resourceGroupName, pipelineName, connection, context); + return this.client.getLroResult(response, ConnectionInner.class, + ConnectionInner.class, context); + } + + /** + * Approves a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to approve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 connection) { + return beginApproveConnectionAsync(resourceGroupName, pipelineName, connection).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Approves a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to approve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 connection) { + return beginApproveConnection(resourceGroupName, pipelineName, connection).getFinalResult(); + } + + /** + * Approves a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to approve. + * @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 connection, + Context context) { + return beginApproveConnection(resourceGroupName, pipelineName, connection, context).getFinalResult(); + } + + /** + * Executes a privileged or administrative action on the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param action The action to be executed on the Pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 action) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.executeAction(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, contentType, accept, action, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Executes a privileged or administrative action on the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param action The action to be executed on the Pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 action) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.executeActionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, contentType, accept, action, + Context.NONE); + } + + /** + * Executes a privileged or administrative action on the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param action The action to be executed on the Pipeline. + * @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 action, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.executeActionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, contentType, accept, action, context); + } + + /** + * Executes a privileged or administrative action on the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param action The action to be executed on the Pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 action) { + Mono>> mono = executeActionWithResponseAsync(resourceGroupName, pipelineName, action); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + PipelineInner.class, PipelineInner.class, this.client.getContext()); + } + + /** + * Executes a privileged or administrative action on the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param action The action to be executed on the Pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 action) { + Response response = executeActionWithResponse(resourceGroupName, pipelineName, action); + return this.client.getLroResult(response, PipelineInner.class, + PipelineInner.class, Context.NONE); + } + + /** + * Executes a privileged or administrative action on the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param action The action to be executed on the Pipeline. + * @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 action, Context context) { + Response response = executeActionWithResponse(resourceGroupName, pipelineName, action, context); + return this.client.getLroResult(response, PipelineInner.class, + PipelineInner.class, context); + } + + /** + * Executes a privileged or administrative action on the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param action The action to be executed on the Pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 action) { + return beginExecuteActionAsync(resourceGroupName, pipelineName, action).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Executes a privileged or administrative action on the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param action The action to be executed on the Pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 action) { + return beginExecuteAction(resourceGroupName, pipelineName, action).getFinalResult(); + } + + /** + * Executes a privileged or administrative action on the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param action The action to be executed on the Pipeline. + * @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 action, Context context) { + return beginExecuteAction(resourceGroupName, pipelineName, action, context).getFinalResult(); + } + + /** + * Lists all Flows associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connections A list of connection identifiers used to filter the Flows to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, accept, connections, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all Flows associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 all Flows associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connections A list of connection identifiers used to filter the Flows to be retrieved. + * @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) { + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, pipelineName, accept, connections, context); + } + + /** + * Lists all Flows associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 associated with a specific connection in the Pipeline. This operation has reached end of life + * support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param schema The schema(s) to retrieve for the specified connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 schema) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listSchemasList(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, contentType, accept, schema, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the schemas associated with a specific connection in the Pipeline. This operation has reached end of life + * support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param schema The schema(s) to retrieve for the specified connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 schema) { + return listSchemasListWithResponseAsync(resourceGroupName, pipelineName, schema) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists the schemas associated with a specific connection in the Pipeline. This operation has reached end of life + * support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param schema The schema(s) to retrieve for the specified connection. + * @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 schema, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.listSchemasListSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, contentType, accept, schema, context); + } + + /** + * Lists the schemas associated with a specific connection in the Pipeline. This operation has reached end of life + * support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param schema The schema(s) to retrieve for the specified connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 schema) { + return listSchemasListWithResponse(resourceGroupName, pipelineName, schema, Context.NONE).getValue(); + } + + /** + * Rejects a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to reject. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 connection) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.rejectConnection(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, contentType, accept, connection, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Rejects a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to reject. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 connection) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.rejectConnectionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, contentType, accept, connection, + Context.NONE); + } + + /** + * Rejects a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to reject. + * @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 connection, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.rejectConnectionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, contentType, accept, connection, context); + } + + /** + * Rejects a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to reject. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 connection) { + Mono>> mono + = rejectConnectionWithResponseAsync(resourceGroupName, pipelineName, connection); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ConnectionInner.class, ConnectionInner.class, this.client.getContext()); + } + + /** + * Rejects a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to reject. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 connection) { + Response response = rejectConnectionWithResponse(resourceGroupName, pipelineName, connection); + return this.client.getLroResult(response, ConnectionInner.class, + ConnectionInner.class, Context.NONE); + } + + /** + * Rejects a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to reject. + * @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 connection, Context context) { + Response response + = rejectConnectionWithResponse(resourceGroupName, pipelineName, connection, context); + return this.client.getLroResult(response, ConnectionInner.class, + ConnectionInner.class, context); + } + + /** + * Rejects a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to reject. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 connection) { + return beginRejectConnectionAsync(resourceGroupName, pipelineName, connection).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Rejects a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to reject. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 connection) { + return beginRejectConnection(resourceGroupName, pipelineName, connection).getFinalResult(); + } + + /** + * Rejects a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to reject. + * @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 connection, + Context context) { + return beginRejectConnection(resourceGroupName, pipelineName, connection, 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> listByResourceGroupNextSinglePageAsync(String nextLink) { + 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) { + 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) { + 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 Pipeline list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/PipelinesImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/PipelinesImpl.java new file mode 100644 index 0000000000000..cffbf6db02fd8 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/PipelinesImpl.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.fluent.PipelinesClient; +import com.azure.resourcemanager.datatransfer.fluent.models.ConnectionInner; +import com.azure.resourcemanager.datatransfer.fluent.models.ListFlowsByPipelineResultInner; +import com.azure.resourcemanager.datatransfer.fluent.models.PipelineInner; +import com.azure.resourcemanager.datatransfer.fluent.models.SchemasListResultInner; +import com.azure.resourcemanager.datatransfer.models.Action; +import com.azure.resourcemanager.datatransfer.models.Connection; +import com.azure.resourcemanager.datatransfer.models.ConnectionIdList; +import com.azure.resourcemanager.datatransfer.models.ListFlowsByPipelineResult; +import com.azure.resourcemanager.datatransfer.models.Pipeline; +import com.azure.resourcemanager.datatransfer.models.Pipelines; +import com.azure.resourcemanager.datatransfer.models.PipelinesPatch; +import com.azure.resourcemanager.datatransfer.models.ResourceBody; +import com.azure.resourcemanager.datatransfer.models.Schema; +import com.azure.resourcemanager.datatransfer.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.datatransfer.DataTransferManager serviceManager; + + public PipelinesImpl(PipelinesClient innerClient, + com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String pipelineName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, pipelineName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PipelineImpl(inner.getValue(), this.manager())); + } + + 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 update(String resourceGroupName, String pipelineName, PipelinesPatch pipeline) { + this.serviceClient().update(resourceGroupName, pipelineName, pipeline); + } + + public void update(String resourceGroupName, String pipelineName, PipelinesPatch pipeline, Context context) { + this.serviceClient().update(resourceGroupName, pipelineName, pipeline, context); + } + + 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 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 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 Connection approveConnection(String resourceGroupName, String pipelineName, ResourceBody connection) { + ConnectionInner inner = this.serviceClient().approveConnection(resourceGroupName, pipelineName, connection); + if (inner != null) { + return new ConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Connection approveConnection(String resourceGroupName, String pipelineName, ResourceBody connection, + Context context) { + ConnectionInner inner + = this.serviceClient().approveConnection(resourceGroupName, pipelineName, connection, context); + if (inner != null) { + return new ConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Pipeline executeAction(String resourceGroupName, String pipelineName, Action action) { + PipelineInner inner = this.serviceClient().executeAction(resourceGroupName, pipelineName, action); + if (inner != null) { + return new PipelineImpl(inner, this.manager()); + } else { + return null; + } + } + + public Pipeline executeAction(String resourceGroupName, String pipelineName, Action action, Context context) { + PipelineInner inner = this.serviceClient().executeAction(resourceGroupName, pipelineName, action, 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); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ListFlowsByPipelineResultImpl(inner.getValue(), this.manager())); + } + + 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 schema, Context context) { + Response inner + = this.serviceClient().listSchemasListWithResponse(resourceGroupName, pipelineName, schema, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SchemasListResultImpl(inner.getValue(), this.manager())); + } + + public SchemasListResult listSchemasList(String resourceGroupName, String pipelineName, Schema schema) { + SchemasListResultInner inner = this.serviceClient().listSchemasList(resourceGroupName, pipelineName, schema); + if (inner != null) { + return new SchemasListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Connection rejectConnection(String resourceGroupName, String pipelineName, ResourceBody connection) { + ConnectionInner inner = this.serviceClient().rejectConnection(resourceGroupName, pipelineName, connection); + if (inner != null) { + return new ConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Connection rejectConnection(String resourceGroupName, String pipelineName, ResourceBody connection, + Context context) { + ConnectionInner inner + = this.serviceClient().rejectConnection(resourceGroupName, pipelineName, connection, 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.datatransfer.DataTransferManager manager() { + return this.serviceManager; + } + + public PipelineImpl define(String name) { + return new PipelineImpl(name, this.manager()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/ResourceManagerUtils.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/ResourceManagerUtils.java new file mode 100644 index 0000000000000..a2066265a6834 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/SchemasListResultImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/SchemasListResultImpl.java new file mode 100644 index 0000000000000..dc299f9c3a5db --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/SchemasListResultImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation; + +import com.azure.resourcemanager.datatransfer.fluent.models.SchemasListResultInner; +import com.azure.resourcemanager.datatransfer.models.Schema; +import com.azure.resourcemanager.datatransfer.models.SchemasListResult; +import java.util.Collections; +import java.util.List; + +public final class SchemasListResultImpl implements SchemasListResult { + private SchemasListResultInner innerObject; + + private final com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager; + + SchemasListResultImpl(SchemasListResultInner innerObject, + com.azure.resourcemanager.datatransfer.DataTransferManager 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.datatransfer.DataTransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/StreamSourceAddressesImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/StreamSourceAddressesImpl.java new file mode 100644 index 0000000000000..edf871f9c89e6 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/StreamSourceAddressesImpl.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation; + +import com.azure.resourcemanager.datatransfer.fluent.models.StreamSourceAddressesInner; +import com.azure.resourcemanager.datatransfer.models.StreamSourceAddresses; +import java.util.Collections; +import java.util.List; + +public final class StreamSourceAddressesImpl implements StreamSourceAddresses { + private StreamSourceAddressesInner innerObject; + + private final com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager; + + StreamSourceAddressesImpl(StreamSourceAddressesInner innerObject, + com.azure.resourcemanager.datatransfer.DataTransferManager 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.datatransfer.DataTransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/ValidateSchemaResultImpl.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/ValidateSchemaResultImpl.java new file mode 100644 index 0000000000000..27359448433cb --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/ValidateSchemaResultImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation; + +import com.azure.resourcemanager.datatransfer.fluent.models.ValidateSchemaResultInner; +import com.azure.resourcemanager.datatransfer.models.ValidateSchemaResult; +import com.azure.resourcemanager.datatransfer.models.ValidateSchemaStatus; + +public final class ValidateSchemaResultImpl implements ValidateSchemaResult { + private ValidateSchemaResultInner innerObject; + + private final com.azure.resourcemanager.datatransfer.DataTransferManager serviceManager; + + ValidateSchemaResultImpl(ValidateSchemaResultInner innerObject, + com.azure.resourcemanager.datatransfer.DataTransferManager 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.datatransfer.DataTransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/ConnectionListResult.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/ConnectionListResult.java new file mode 100644 index 0000000000000..21ed7055b6f00 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/ConnectionListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datatransfer.fluent.models.ConnectionInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Connection list operation. + */ +@Immutable +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. + */ + private ConnectionListResult() { + } + + /** + * Get the value property: The Connection items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/FlowListResult.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/FlowListResult.java new file mode 100644 index 0000000000000..9f762b5b8d805 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/FlowListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datatransfer.fluent.models.FlowInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Flow list operation. + */ +@Immutable +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. + */ + private FlowListResult() { + } + + /** + * Get the value property: The Flow items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/FlowProfileListResult.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/FlowProfileListResult.java new file mode 100644 index 0000000000000..85649fb40f763 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/FlowProfileListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datatransfer.fluent.models.FlowProfileInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a FlowProfile list operation. + */ +@Immutable +public final class FlowProfileListResult implements JsonSerializable { + /* + * The FlowProfile items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of FlowProfileListResult class. + */ + private FlowProfileListResult() { + } + + /** + * Get the value property: The FlowProfile items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlowProfileListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlowProfileListResult 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 FlowProfileListResult. + */ + public static FlowProfileListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlowProfileListResult deserializedFlowProfileListResult = new FlowProfileListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> FlowProfileInner.fromJson(reader1)); + deserializedFlowProfileListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedFlowProfileListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFlowProfileListResult; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/OperationListResult.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/OperationListResult.java new file mode 100644 index 0000000000000..8a489ac60b59b --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/OperationListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datatransfer.fluent.models.OperationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult implements JsonSerializable { + /* + * The Operation items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + private OperationListResult() { + } + + /** + * Get the value property: The Operation items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/PendingConnectionListResult.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/PendingConnectionListResult.java new file mode 100644 index 0000000000000..758e7b8af2bbc --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/PendingConnectionListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datatransfer.fluent.models.PendingConnectionInner; +import java.io.IOException; +import java.util.List; + +/** + * The custom response of a list operation. + */ +@Immutable +public final class PendingConnectionListResult implements JsonSerializable { + /* + * The items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of PendingConnectionListResult class. + */ + private PendingConnectionListResult() { + } + + /** + * Get the value property: The items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/PendingFlowListResult.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/PendingFlowListResult.java new file mode 100644 index 0000000000000..26518d0da9a12 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/PendingFlowListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datatransfer.fluent.models.PendingFlowInner; +import java.io.IOException; +import java.util.List; + +/** + * The custom response of a list operation. + */ +@Immutable +public final class PendingFlowListResult implements JsonSerializable { + /* + * The items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of PendingFlowListResult class. + */ + private PendingFlowListResult() { + } + + /** + * Get the value property: The items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/PipelineListResult.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/PipelineListResult.java new file mode 100644 index 0000000000000..39e8877864b59 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/PipelineListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datatransfer.fluent.models.PipelineInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Pipeline list operation. + */ +@Immutable +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. + */ + private PipelineListResult() { + } + + /** + * Get the value property: The Pipeline items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/package-info.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/package-info.java new file mode 100644 index 0000000000000..d96a107516305 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/implementation/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the implementations for DataTransfer. + */ +package com.azure.resourcemanager.datatransfer.implementation; diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Action.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Action.java new file mode 100644 index 0000000000000..568085d8878ea --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Action.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 action to be executed. + */ +@Fluent +public final class Action implements JsonSerializable { + /* + * Type of action to be executed + */ + private DateTransferActionType 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 DateTransferActionType 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(DateTransferActionType 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; + } + + /** + * {@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 = DateTransferActionType.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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ActionType.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ActionType.java new file mode 100644 index 0000000000000..920fc11e5dcb4 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ActionType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Actions are for internal-only APIs. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/AntivirusRuleset.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/AntivirusRuleset.java new file mode 100644 index 0000000000000..92edb3188d143 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/AntivirusRuleset.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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; + +/** + * Antivirus scanning rules for replicating data. By default, all antivirus scanning solutions are disabled. + */ +@Fluent +public final class AntivirusRuleset implements JsonSerializable { + /* + * Optional. The list of antiviruses to be used as a scanning solution for replicating data. + */ + private List avSolutions; + + /** + * Creates an instance of AntivirusRuleset class. + */ + public AntivirusRuleset() { + } + + /** + * Get the avSolutions property: Optional. The list of antiviruses to be used as a scanning solution for replicating + * data. + * + * @return the avSolutions value. + */ + public List avSolutions() { + return this.avSolutions; + } + + /** + * Set the avSolutions property: Optional. The list of antiviruses to be used as a scanning solution for replicating + * data. + * + * @param avSolutions the avSolutions value to set. + * @return the AntivirusRuleset object itself. + */ + public AntivirusRuleset withAvSolutions(List avSolutions) { + this.avSolutions = avSolutions; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("avSolutions", this.avSolutions, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AntivirusRuleset from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AntivirusRuleset 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 AntivirusRuleset. + */ + public static AntivirusRuleset fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AntivirusRuleset deserializedAntivirusRuleset = new AntivirusRuleset(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("avSolutions".equals(fieldName)) { + List avSolutions + = reader.readArray(reader1 -> AntivirusSolutions.fromString(reader1.getString())); + deserializedAntivirusRuleset.avSolutions = avSolutions; + } else { + reader.skipChildren(); + } + } + + return deserializedAntivirusRuleset; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/AntivirusSolutions.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/AntivirusSolutions.java new file mode 100644 index 0000000000000..238093d576424 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/AntivirusSolutions.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The list of Antivirus solutions currently provided. + */ +public final class AntivirusSolutions extends ExpandableStringEnum { + /** + * Option to use Microsoft Defender antivirus scanning software as the scanning solution. + */ + public static final AntivirusSolutions DEFENDER = fromString("Defender"); + + /** + * Option to use the external ClamAV open-source software as an antivirus scanning solution. + */ + public static final AntivirusSolutions CLAM_AV = fromString("ClamAv"); + + /** + * Creates a new instance of AntivirusSolutions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AntivirusSolutions() { + } + + /** + * Creates or finds a AntivirusSolutions from its string representation. + * + * @param name a name to look for. + * @return the corresponding AntivirusSolutions. + */ + public static AntivirusSolutions fromString(String name) { + return fromString(name, AntivirusSolutions.class); + } + + /** + * Gets known AntivirusSolutions values. + * + * @return known AntivirusSolutions values. + */ + public static Collection values() { + return values(AntivirusSolutions.class); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ApiFlowOptions.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ApiFlowOptions.java new file mode 100644 index 0000000000000..2d7813b61d353 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ApiFlowOptions.java @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 specific to API Flow Type. + */ +@Fluent +public final class ApiFlowOptions implements JsonSerializable { + /* + * Remote host to which communication needs to be made. The property has reached end of life support starting + * version 2025-05-30-preview. Please create and use the remoteEndpointSettings.endpoint property instead. + */ + 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; + + /* + * Determines which identity to use for extracting the user token for Azure Data Transfer API Flow. The property has + * reached end of life support starting version 2025-05-30-preview. Please create and use the authentication + * property instead. + */ + private IdentityTranslation identityTranslation; + + /* + * Sender's app user assigned Manage Identity client ID. The property has reached end of life support starting + * version 2025-05-30-preview. Please create and use the authentication property instead. + */ + private String senderClientId; + + /* + * Remote stub app registration Client ID. The property has reached end of life support starting version + * 2025-05-30-preview. Please create and use the authentication property instead. + */ + private String remoteCallingModeClientId; + + /* + * Optional field to override the audience of the remote endpoint. The property has reached end of life support + * starting version 2025-05-30-preview. Please create and use the authentication property instead. + */ + private String audienceOverride; + + /* + * Optional and for advanced used only. A list of authentication methods to use when accessing the Azure Data + * Transfer API Flow. If not provided, the default S2S authentication using Entra (API Flow Managed Identity) and + * RBAC will be applied. + */ + private List authentication; + + /* + * Defines the destination remote endpoint for the API calls. + */ + private RemoteEndpointSettings remoteEndpointSettings; + + /** + * Creates an instance of ApiFlowOptions class. + */ + public ApiFlowOptions() { + } + + /** + * Get the remoteEndpoint property: Remote host to which communication needs to be made. The property has reached + * end of life support starting version 2025-05-30-preview. Please create and use the + * remoteEndpointSettings.endpoint property instead. + * + * @return the remoteEndpoint value. + */ + public String remoteEndpoint() { + return this.remoteEndpoint; + } + + /** + * Set the remoteEndpoint property: Remote host to which communication needs to be made. The property has reached + * end of life support starting version 2025-05-30-preview. Please create and use the + * remoteEndpointSettings.endpoint property instead. + * + * @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: Determines which identity to use for extracting the user token for Azure + * Data Transfer API Flow. The property has reached end of life support starting version 2025-05-30-preview. Please + * create and use the authentication property instead. + * + * @return the identityTranslation value. + */ + public IdentityTranslation identityTranslation() { + return this.identityTranslation; + } + + /** + * Set the identityTranslation property: Determines which identity to use for extracting the user token for Azure + * Data Transfer API Flow. The property has reached end of life support starting version 2025-05-30-preview. Please + * create and use the authentication property instead. + * + * @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. The property has reached + * end of life support starting version 2025-05-30-preview. Please create and use the authentication property + * instead. + * + * @return the senderClientId value. + */ + public String senderClientId() { + return this.senderClientId; + } + + /** + * Set the senderClientId property: Sender's app user assigned Manage Identity client ID. The property has reached + * end of life support starting version 2025-05-30-preview. Please create and use the authentication property + * instead. + * + * @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. The property has reached end + * of life support starting version 2025-05-30-preview. Please create and use the authentication property instead. + * + * @return the remoteCallingModeClientId value. + */ + public String remoteCallingModeClientId() { + return this.remoteCallingModeClientId; + } + + /** + * Set the remoteCallingModeClientId property: Remote stub app registration Client ID. The property has reached end + * of life support starting version 2025-05-30-preview. Please create and use the authentication property instead. + * + * @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. The property + * has reached end of life support starting version 2025-05-30-preview. Please create and use the authentication + * property instead. + * + * @return the audienceOverride value. + */ + public String audienceOverride() { + return this.audienceOverride; + } + + /** + * Set the audienceOverride property: Optional field to override the audience of the remote endpoint. The property + * has reached end of life support starting version 2025-05-30-preview. Please create and use the authentication + * property instead. + * + * @param audienceOverride the audienceOverride value to set. + * @return the ApiFlowOptions object itself. + */ + public ApiFlowOptions withAudienceOverride(String audienceOverride) { + this.audienceOverride = audienceOverride; + return this; + } + + /** + * Get the authentication property: Optional and for advanced used only. A list of authentication methods to use + * when accessing the Azure Data Transfer API Flow. If not provided, the default S2S authentication using Entra (API + * Flow Managed Identity) and RBAC will be applied. + * + * @return the authentication value. + */ + public List authentication() { + return this.authentication; + } + + /** + * Set the authentication property: Optional and for advanced used only. A list of authentication methods to use + * when accessing the Azure Data Transfer API Flow. If not provided, the default S2S authentication using Entra (API + * Flow Managed Identity) and RBAC will be applied. + * + * @param authentication the authentication value to set. + * @return the ApiFlowOptions object itself. + */ + public ApiFlowOptions withAuthentication(List authentication) { + this.authentication = authentication; + return this; + } + + /** + * Get the remoteEndpointSettings property: Defines the destination remote endpoint for the API calls. + * + * @return the remoteEndpointSettings value. + */ + public RemoteEndpointSettings remoteEndpointSettings() { + return this.remoteEndpointSettings; + } + + /** + * Set the remoteEndpointSettings property: Defines the destination remote endpoint for the API calls. + * + * @param remoteEndpointSettings the remoteEndpointSettings value to set. + * @return the ApiFlowOptions object itself. + */ + public ApiFlowOptions withRemoteEndpointSettings(RemoteEndpointSettings remoteEndpointSettings) { + this.remoteEndpointSettings = remoteEndpointSettings; + return this; + } + + /** + * {@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); + jsonWriter.writeArrayField("authentication", this.authentication, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("remoteEndpointSettings", this.remoteEndpointSettings); + 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 if ("authentication".equals(fieldName)) { + List authentication = reader.readArray(reader1 -> Authentication.fromJson(reader1)); + deserializedApiFlowOptions.authentication = authentication; + } else if ("remoteEndpointSettings".equals(fieldName)) { + deserializedApiFlowOptions.remoteEndpointSettings = RemoteEndpointSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApiFlowOptions; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ApiMode.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ApiMode.java new file mode 100644 index 0000000000000..fef6f7eedab61 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ApiMode.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 { + /** + * The API flow will forward calls to a custom Software Development Kit implementation. + */ + public static final ApiMode SDK = fromString("SDK"); + + /** + * The API flow will forward calls to a specified endpoint. + */ + 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ArchiveRuleset.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ArchiveRuleset.java new file mode 100644 index 0000000000000..b745d3ad242f5 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ArchiveRuleset.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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; + +/** + * Rules for regulating supported archive files (BZip2, Cpio, Deb, GZip, Rpm, Tar, Zip) during data replication. All + * properties are optional and only the configured options will be applied against archives. As an example, suppose + * minimumSizeForExpansion is 10 MiB and maximumExpansionSizeLimit is 1 GiB. Then all archives smaller than 10 MiB will + * be treated as though the archive ruleset is disabled, although other rulesets will apply as usual. Furthermore, all + * archives at least 10 MiB in size but with a decompressed size greater than 1 GiB will fail the ruleset. All other + * archives will have their contents extracted and each extracted element will be applied to all rulesets. + */ +@Fluent +public final class ArchiveRuleset implements JsonSerializable { + /* + * Optional. Default is 0. The minimum archive file size (in bytes) required to trigger expansion during + * replication. Any archive file size below the configured threshold will skip the rest of the configured rulesets + * for archives. + */ + private Long minimumSizeForExpansion; + + /* + * Optional. The combined maximum size (in bytes) of all extracted files that an expanded archive is allowed to + * reach. Archives exceeding the max limit will be denied for replication. + */ + private Long maximumExpansionSizeLimit; + + /* + * Optional. The maximum depth of nested archives that can be expanded. Limits how many layers of embedded archives + * will be processed. Archives exceeding the max limit will be denied for replication. + */ + private Long maximumDepthLimit; + + /* + * Optional. Provides the multiplication value for an archive in total based on the initial object being validated. + * This value takes the root object size and multiplies it by this value to create a maximum. Once this maximum is + * exceeded, the archive is failed. Used to detect and block archives with suspiciously high compression (e.g., zip + * bombs). + */ + private Double maximumCompressionRatioLimit; + + /** + * Creates an instance of ArchiveRuleset class. + */ + public ArchiveRuleset() { + } + + /** + * Get the minimumSizeForExpansion property: Optional. Default is 0. The minimum archive file size (in bytes) + * required to trigger expansion during replication. Any archive file size below the configured threshold will skip + * the rest of the configured rulesets for archives. + * + * @return the minimumSizeForExpansion value. + */ + public Long minimumSizeForExpansion() { + return this.minimumSizeForExpansion; + } + + /** + * Set the minimumSizeForExpansion property: Optional. Default is 0. The minimum archive file size (in bytes) + * required to trigger expansion during replication. Any archive file size below the configured threshold will skip + * the rest of the configured rulesets for archives. + * + * @param minimumSizeForExpansion the minimumSizeForExpansion value to set. + * @return the ArchiveRuleset object itself. + */ + public ArchiveRuleset withMinimumSizeForExpansion(Long minimumSizeForExpansion) { + this.minimumSizeForExpansion = minimumSizeForExpansion; + return this; + } + + /** + * Get the maximumExpansionSizeLimit property: Optional. The combined maximum size (in bytes) of all extracted files + * that an expanded archive is allowed to reach. Archives exceeding the max limit will be denied for replication. + * + * @return the maximumExpansionSizeLimit value. + */ + public Long maximumExpansionSizeLimit() { + return this.maximumExpansionSizeLimit; + } + + /** + * Set the maximumExpansionSizeLimit property: Optional. The combined maximum size (in bytes) of all extracted files + * that an expanded archive is allowed to reach. Archives exceeding the max limit will be denied for replication. + * + * @param maximumExpansionSizeLimit the maximumExpansionSizeLimit value to set. + * @return the ArchiveRuleset object itself. + */ + public ArchiveRuleset withMaximumExpansionSizeLimit(Long maximumExpansionSizeLimit) { + this.maximumExpansionSizeLimit = maximumExpansionSizeLimit; + return this; + } + + /** + * Get the maximumDepthLimit property: Optional. The maximum depth of nested archives that can be expanded. Limits + * how many layers of embedded archives will be processed. Archives exceeding the max limit will be denied for + * replication. + * + * @return the maximumDepthLimit value. + */ + public Long maximumDepthLimit() { + return this.maximumDepthLimit; + } + + /** + * Set the maximumDepthLimit property: Optional. The maximum depth of nested archives that can be expanded. Limits + * how many layers of embedded archives will be processed. Archives exceeding the max limit will be denied for + * replication. + * + * @param maximumDepthLimit the maximumDepthLimit value to set. + * @return the ArchiveRuleset object itself. + */ + public ArchiveRuleset withMaximumDepthLimit(Long maximumDepthLimit) { + this.maximumDepthLimit = maximumDepthLimit; + return this; + } + + /** + * Get the maximumCompressionRatioLimit property: Optional. Provides the multiplication value for an archive in + * total based on the initial object being validated. This value takes the root object size and multiplies it by + * this value to create a maximum. Once this maximum is exceeded, the archive is failed. Used to detect and block + * archives with suspiciously high compression (e.g., zip bombs). + * + * @return the maximumCompressionRatioLimit value. + */ + public Double maximumCompressionRatioLimit() { + return this.maximumCompressionRatioLimit; + } + + /** + * Set the maximumCompressionRatioLimit property: Optional. Provides the multiplication value for an archive in + * total based on the initial object being validated. This value takes the root object size and multiplies it by + * this value to create a maximum. Once this maximum is exceeded, the archive is failed. Used to detect and block + * archives with suspiciously high compression (e.g., zip bombs). + * + * @param maximumCompressionRatioLimit the maximumCompressionRatioLimit value to set. + * @return the ArchiveRuleset object itself. + */ + public ArchiveRuleset withMaximumCompressionRatioLimit(Double maximumCompressionRatioLimit) { + this.maximumCompressionRatioLimit = maximumCompressionRatioLimit; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("minimumSizeForExpansion", this.minimumSizeForExpansion); + jsonWriter.writeNumberField("maximumExpansionSizeLimit", this.maximumExpansionSizeLimit); + jsonWriter.writeNumberField("maximumDepthLimit", this.maximumDepthLimit); + jsonWriter.writeNumberField("maximumCompressionRatioLimit", this.maximumCompressionRatioLimit); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ArchiveRuleset from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ArchiveRuleset 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 ArchiveRuleset. + */ + public static ArchiveRuleset fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ArchiveRuleset deserializedArchiveRuleset = new ArchiveRuleset(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("minimumSizeForExpansion".equals(fieldName)) { + deserializedArchiveRuleset.minimumSizeForExpansion = reader.getNullable(JsonReader::getLong); + } else if ("maximumExpansionSizeLimit".equals(fieldName)) { + deserializedArchiveRuleset.maximumExpansionSizeLimit = reader.getNullable(JsonReader::getLong); + } else if ("maximumDepthLimit".equals(fieldName)) { + deserializedArchiveRuleset.maximumDepthLimit = reader.getNullable(JsonReader::getLong); + } else if ("maximumCompressionRatioLimit".equals(fieldName)) { + deserializedArchiveRuleset.maximumCompressionRatioLimit = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedArchiveRuleset; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Authentication.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Authentication.java new file mode 100644 index 0000000000000..4c0f63f9dec5f --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Authentication.java @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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; + +/** + * Configures the authentication method and parameters for an Azure Data Transfer API Flow. + */ +@Fluent +public final class Authentication implements JsonSerializable { + /* + * Type of authentication mechanism. JWT by default. + */ + private AuthenticationType type; + + /* + * The identity provider's token service instance. + */ + private String instance; + + /* + * A unique identifier representing the tenant of the identity provider's token service. + */ + private String tenantId; + + /* + * The full URL endpoint used to acquire tokens, typically combining the instance and tenant ID to target a specific + * authentication context. + */ + private String authority; + + /* + * List of applicationIds allowed to authorize to this flow. This is used as an alternative to the RBAC + * authorization check. + */ + private List applicationIds; + + /* + * Audience of the identity of the remote endpoint service. By default, remoteEndpointSettings.endpoint will be used + * if a value is not provided. + */ + private String audience; + + /* + * The Flow can use an Entra app identity that is provided by the Flow user to obtain the token to call the remote + * endpoint. This field specifies the user provided app's clientId. + */ + private String clientIdOverride; + + /* + * Determines which identity to use for extracting the user token for Azure Data Transfer API Flow. + */ + private IdentityTranslation identityTranslation; + + /** + * Creates an instance of Authentication class. + */ + public Authentication() { + } + + /** + * Get the type property: Type of authentication mechanism. JWT by default. + * + * @return the type value. + */ + public AuthenticationType type() { + return this.type; + } + + /** + * Set the type property: Type of authentication mechanism. JWT by default. + * + * @param type the type value to set. + * @return the Authentication object itself. + */ + public Authentication withType(AuthenticationType type) { + this.type = type; + return this; + } + + /** + * Get the instance property: The identity provider's token service instance. + * + * @return the instance value. + */ + public String instance() { + return this.instance; + } + + /** + * Set the instance property: The identity provider's token service instance. + * + * @param instance the instance value to set. + * @return the Authentication object itself. + */ + public Authentication withInstance(String instance) { + this.instance = instance; + return this; + } + + /** + * Get the tenantId property: A unique identifier representing the tenant of the identity provider's token service. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: A unique identifier representing the tenant of the identity provider's token service. + * + * @param tenantId the tenantId value to set. + * @return the Authentication object itself. + */ + public Authentication withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the authority property: The full URL endpoint used to acquire tokens, typically combining the instance and + * tenant ID to target a specific authentication context. + * + * @return the authority value. + */ + public String authority() { + return this.authority; + } + + /** + * Set the authority property: The full URL endpoint used to acquire tokens, typically combining the instance and + * tenant ID to target a specific authentication context. + * + * @param authority the authority value to set. + * @return the Authentication object itself. + */ + public Authentication withAuthority(String authority) { + this.authority = authority; + return this; + } + + /** + * Get the applicationIds property: List of applicationIds allowed to authorize to this flow. This is used as an + * alternative to the RBAC authorization check. + * + * @return the applicationIds value. + */ + public List applicationIds() { + return this.applicationIds; + } + + /** + * Set the applicationIds property: List of applicationIds allowed to authorize to this flow. This is used as an + * alternative to the RBAC authorization check. + * + * @param applicationIds the applicationIds value to set. + * @return the Authentication object itself. + */ + public Authentication withApplicationIds(List applicationIds) { + this.applicationIds = applicationIds; + return this; + } + + /** + * Get the audience property: Audience of the identity of the remote endpoint service. By default, + * remoteEndpointSettings.endpoint will be used if a value is not provided. + * + * @return the audience value. + */ + public String audience() { + return this.audience; + } + + /** + * Set the audience property: Audience of the identity of the remote endpoint service. By default, + * remoteEndpointSettings.endpoint will be used if a value is not provided. + * + * @param audience the audience value to set. + * @return the Authentication object itself. + */ + public Authentication withAudience(String audience) { + this.audience = audience; + return this; + } + + /** + * Get the clientIdOverride property: The Flow can use an Entra app identity that is provided by the Flow user to + * obtain the token to call the remote endpoint. This field specifies the user provided app's clientId. + * + * @return the clientIdOverride value. + */ + public String clientIdOverride() { + return this.clientIdOverride; + } + + /** + * Set the clientIdOverride property: The Flow can use an Entra app identity that is provided by the Flow user to + * obtain the token to call the remote endpoint. This field specifies the user provided app's clientId. + * + * @param clientIdOverride the clientIdOverride value to set. + * @return the Authentication object itself. + */ + public Authentication withClientIdOverride(String clientIdOverride) { + this.clientIdOverride = clientIdOverride; + return this; + } + + /** + * Get the identityTranslation property: Determines which identity to use for extracting the user token for Azure + * Data Transfer API Flow. + * + * @return the identityTranslation value. + */ + public IdentityTranslation identityTranslation() { + return this.identityTranslation; + } + + /** + * Set the identityTranslation property: Determines which identity to use for extracting the user token for Azure + * Data Transfer API Flow. + * + * @param identityTranslation the identityTranslation value to set. + * @return the Authentication object itself. + */ + public Authentication withIdentityTranslation(IdentityTranslation identityTranslation) { + this.identityTranslation = identityTranslation; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("instance", this.instance); + jsonWriter.writeStringField("tenantId", this.tenantId); + jsonWriter.writeStringField("authority", this.authority); + jsonWriter.writeArrayField("applicationIds", this.applicationIds, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("audience", this.audience); + jsonWriter.writeStringField("clientIdOverride", this.clientIdOverride); + jsonWriter.writeStringField("identityTranslation", + this.identityTranslation == null ? null : this.identityTranslation.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Authentication from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Authentication 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 Authentication. + */ + public static Authentication fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Authentication deserializedAuthentication = new Authentication(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedAuthentication.type = AuthenticationType.fromString(reader.getString()); + } else if ("instance".equals(fieldName)) { + deserializedAuthentication.instance = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedAuthentication.tenantId = reader.getString(); + } else if ("authority".equals(fieldName)) { + deserializedAuthentication.authority = reader.getString(); + } else if ("applicationIds".equals(fieldName)) { + List applicationIds = reader.readArray(reader1 -> reader1.getString()); + deserializedAuthentication.applicationIds = applicationIds; + } else if ("audience".equals(fieldName)) { + deserializedAuthentication.audience = reader.getString(); + } else if ("clientIdOverride".equals(fieldName)) { + deserializedAuthentication.clientIdOverride = reader.getString(); + } else if ("identityTranslation".equals(fieldName)) { + deserializedAuthentication.identityTranslation = IdentityTranslation.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAuthentication; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/AuthenticationType.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/AuthenticationType.java new file mode 100644 index 0000000000000..64a02c795b8fd --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/AuthenticationType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of authentication mechanism for Azure Data Transfer API Flows. + */ +public final class AuthenticationType extends ExpandableStringEnum { + /** + * Option to use a JWT Bearer Authentication Token. + */ + public static final AuthenticationType JWT = fromString("JWT"); + + /** + * Option to not use any form of Authentication. + */ + public static final AuthenticationType NONE = fromString("None"); + + /** + * Creates a new instance of AuthenticationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AuthenticationType() { + } + + /** + * Creates or finds a AuthenticationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AuthenticationType. + */ + public static AuthenticationType fromString(String name) { + return fromString(name, AuthenticationType.class); + } + + /** + * Gets known AuthenticationType values. + * + * @return known AuthenticationType values. + */ + public static Collection values() { + return values(AuthenticationType.class); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/AzureDataTransfers.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/AzureDataTransfers.java new file mode 100644 index 0000000000000..c754da0b2f88a --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/AzureDataTransfers.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of AzureDataTransfers. + */ +public interface AzureDataTransfers { + /** + * Retrieves the list of approved schemas available for Azure Data Transfer. This operation has reached end of life + * support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile resource. + * + * @param pipeline The request payload for listing approved schemas. + * @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 pipeline, Context context); + + /** + * Retrieves the list of approved schemas available for Azure Data Transfer. This operation has reached end of life + * support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile resource. + * + * @param pipeline The request payload for listing approved schemas. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 pipeline); + + /** + * Retrieves a list of FlowProfile resources associated with a specified pipeline. + * + * @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 flow profiles list result along with {@link Response}. + */ + Response listFlowProfilesWithResponse(ListFlowProfilesRequest body, Context context); + + /** + * Retrieves a list of FlowProfile resources associated with a specified pipeline. + * + * @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 flow profiles list result. + */ + FlowProfilesListResult listFlowProfiles(ListFlowProfilesRequest body); + + /** + * Validates the structure and content of a schema for use in Azure Data Transfer. This operation has reached end of + * life support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile + * resource. + * + * @param schema 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 schema, Context context); + + /** + * Validates the structure and content of a schema for use in Azure Data Transfer. This operation has reached end of + * life support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile + * resource. + * + * @param schema 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 schema); + + /** + * Retrieves the pipeline metadata associated with a specified pipeline. + * + * @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 defines the response body for retrieving Pipeline metadata for a provided pipeline along with + * {@link Response}. + */ + Response listPipelineMetadataWithResponse(ListPipelineMetadataRequest body, + Context context); + + /** + * Retrieves the pipeline metadata associated with a specified pipeline. + * + * @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 defines the response body for retrieving Pipeline metadata for a provided pipeline. + */ + ListPipelineMetadataResult listPipelineMetadata(ListPipelineMetadataRequest body); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Casing.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Casing.java new file mode 100644 index 0000000000000..6fcf05781513c --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Casing.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Text casing comparison options - diacritics casing is also supported. + */ +public final class Casing extends ExpandableStringEnum { + /** + * Ignores casing when performing pattern matching. For example, "Hello World" would be found in "hello world". + */ + public static final Casing INSENSITIVE = fromString("Insensitive"); + + /** + * Requires exact casing for the pattern match. For example, "Hello World" would NOT not be found in "hello world". + */ + public static final Casing SENSITIVE = fromString("Sensitive"); + + /** + * Creates a new instance of Casing value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Casing() { + } + + /** + * Creates or finds a Casing from its string representation. + * + * @param name a name to look for. + * @return the corresponding Casing. + */ + public static Casing fromString(String name) { + return fromString(name, Casing.class); + } + + /** + * Gets known Casing values. + * + * @return known Casing values. + */ + public static Collection values() { + return values(Casing.class); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Connection.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Connection.java new file mode 100644 index 0000000000000..62702101fa3f0 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Connection.java @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.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.datatransfer.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.WithProperties, 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 properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of connection. + * + * @param properties Properties of connection. + * @return the next definition stage. + */ + Update withProperties(ConnectionProperties properties); + } + + /** + * 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 connection 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 connection); + + /** + * Links the connection to its pending connection. + * + * @param connection 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 connection, Context context); + + /** + * Lists all pending remote connections that are linkable to this 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 custom response of a list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all pending remote connections that are linkable to this 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 custom response of a list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Lists all remote flows that have not yet been linked to local flows. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom response of a list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listPendingFlowsList(); + + /** + * Lists all remote flows that have not yet been linked to local flows. + * + * @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 custom response of a list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listPendingFlowsList(Context context); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ConnectionIdList.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ConnectionIdList.java new file mode 100644 index 0000000000000..f9339ee1b971e --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ConnectionIdList.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ConnectionProperties.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ConnectionProperties.java new file mode 100644 index 0000000000000..af6dd7431a5fa --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ConnectionProperties.java @@ -0,0 +1,607 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import 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. This FlowType property has reached end of life support + * starting version 2025-05-30-preview. Please create a FlowProfile resource instead. + */ + private List flowTypes; + + /* + * Provides a list of FlowProfiles . + */ + private List flowProfileList; + + /* + * 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. The policies property has reached end of life support starting version + * 2025-05-30-preview. Please create and use a FlowProfile resource instead. + */ + private List policies; + + /* + * The schemas for this connection. The schemas property has reached end of life support starting version + * 2025-05-30-preview. Please create and use a FlowProfile resource instead. + */ + private List schemas; + + /* + * The schema URIs for this connection. The schemaUris property has reached end of life support starting version + * 2025-05-30-preview. Please create and use a FlowProfile resource instead. + */ + private List schemaUris; + + /* + * Hostname specific to API Flows + */ + private String apiHostname; + + /** + * 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. This FlowType property has + * reached end of life support starting version 2025-05-30-preview. Please create a FlowProfile resource instead. + * + * @return the flowTypes value. + */ + public List flowTypes() { + return this.flowTypes; + } + + /** + * Set the flowTypes property: The flow types being requested for this connection. This FlowType property has + * reached end of life support starting version 2025-05-30-preview. Please create a FlowProfile resource instead. + * + * @param flowTypes the flowTypes value to set. + * @return the ConnectionProperties object itself. + */ + public ConnectionProperties withFlowTypes(List flowTypes) { + this.flowTypes = flowTypes; + return this; + } + + /** + * Get the flowProfileList property: Provides a list of FlowProfiles . + * + * @return the flowProfileList value. + */ + public List flowProfileList() { + return this.flowProfileList; + } + + /** + * Set the flowProfileList property: Provides a list of FlowProfiles . + * + * @param flowProfileList the flowProfileList value to set. + * @return the ConnectionProperties object itself. + */ + public ConnectionProperties withFlowProfileList(List flowProfileList) { + this.flowProfileList = flowProfileList; + 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. The policies property has reached end of life + * support starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @return the policies value. + */ + public List policies() { + return this.policies; + } + + /** + * Set the policies property: The policies for this connection. The policies property has reached end of life + * support starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @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. The schemas property has reached end of life support + * starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @return the schemas value. + */ + public List schemas() { + return this.schemas; + } + + /** + * Set the schemas property: The schemas for this connection. The schemas property has reached end of life support + * starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @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. The schemaUris property has reached end of life + * support starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @return the schemaUris value. + */ + public List schemaUris() { + return this.schemaUris; + } + + /** + * Set the schemaUris property: The schema URIs for this connection. The schemaUris property has reached end of life + * support starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @param schemaUris the schemaUris value to set. + * @return the ConnectionProperties object itself. + */ + public ConnectionProperties withSchemaUris(List schemaUris) { + this.schemaUris = schemaUris; + return this; + } + + /** + * Get the apiHostname property: Hostname specific to API Flows. + * + * @return the apiHostname value. + */ + public String apiHostname() { + return this.apiHostname; + } + + /** + * Set the apiHostname property: Hostname specific to API Flows. + * + * @param apiHostname the apiHostname value to set. + * @return the ConnectionProperties object itself. + */ + public ConnectionProperties withApiHostname(String apiHostname) { + this.apiHostname = apiHostname; + return this; + } + + /** + * {@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.writeArrayField("flowProfileList", this.flowProfileList, + (writer, element) -> writer.writeJson(element)); + 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.writeStringField("apiHostname", this.apiHostname); + 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 ("flowProfileList".equals(fieldName)) { + List flowProfileList + = reader.readArray(reader1 -> FlowProfileMetadata.fromJson(reader1)); + deserializedConnectionProperties.flowProfileList = flowProfileList; + } 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 if ("apiHostname".equals(fieldName)) { + deserializedConnectionProperties.apiHostname = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionProperties; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ConnectionStatus.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ConnectionStatus.java new file mode 100644 index 0000000000000..397f5e7d0afb2 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ConnectionStatus.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status of the connection. + */ +public final class ConnectionStatus extends ExpandableStringEnum { + /** + * This connection has been created but is under review by the pipeline owner. + */ + public static final ConnectionStatus IN_REVIEW = fromString("InReview"); + + /** + * This connection has been approved by the pipeline owner and is ready for use. + */ + public static final ConnectionStatus APPROVED = fromString("Approved"); + + /** + * This connection has been rejected by the pipeline owner and cannot be used. + */ + public static final ConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Creation of the connection has been accepted. + */ + 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Connections.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Connections.java new file mode 100644 index 0000000000000..558b83b782951 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Connections.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @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 to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * Updates the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param connection 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. + */ + void update(String resourceGroupName, String connectionName, ConnectionsPatch connection); + + /** + * Updates the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param connection 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. + */ + void update(String resourceGroupName, String connectionName, ConnectionsPatch connection, 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 to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 to perform the operation on. + * @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); + + /** + * 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 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); + + /** + * 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 to perform the operation on. + * @param connection 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 connection); + + /** + * 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 to perform the operation on. + * @param connection 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 connection, Context context); + + /** + * Lists all pending remote connections that are linkable to this connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom response of a list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String connectionName); + + /** + * Lists all pending remote connections that are linkable to this connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @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 custom response of a list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String connectionName, Context context); + + /** + * Lists all remote flows that have not yet been linked to local flows. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom response of a list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listPendingFlowsList(String resourceGroupName, String connectionName); + + /** + * Lists all remote flows that have not yet been linked to local flows. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @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 custom response of a 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ConnectionsPatch.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ConnectionsPatch.java new file mode 100644 index 0000000000000..676d7865745a9 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ConnectionsPatch.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/DataClass.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/DataClass.java new file mode 100644 index 0000000000000..a47aa802866b7 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/DataClass.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The list of data types supported for replication. + */ +public final class DataClass extends ExpandableStringEnum { + /** + * (Messaging) Replicates messages from Azure Service Bus for downstream processing or analysis. + */ + public static final DataClass SERVICE_BUS = fromString("ServiceBus"); + + /** + * (Messaging) Replicates messages from Azure Event Hub for downstream processing or analysis. + */ + public static final DataClass EVENT_HUB = fromString("EventHub"); + + /** + * (API) Replicates request/response data through RESTful API endpoints. + */ + public static final DataClass API_ENDPOINT = fromString("ApiEndpoint"); + + /** + * (API) Replicates request/response data through SDK-based integrations. + */ + public static final DataClass API_SDK = fromString("ApiSDK"); + + /** + * (Stream) Enables replication of real-time video streaming data. + */ + public static final DataClass VIDEO = fromString("Video"); + + /** + * (Files/SoftwareArtifacts/Complex) Replicates generic blobs data using Azure Blob Storage. + */ + public static final DataClass BLOB = fromString("Blob"); + + /** + * (Files) Replicates structured NoSQL data using Azure Table Storage. + */ + public static final DataClass TABLE = fromString("Table"); + + /** + * Creates a new instance of DataClass value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataClass() { + } + + /** + * Creates or finds a DataClass from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataClass. + */ + public static DataClass fromString(String name) { + return fromString(name, DataClass.class); + } + + /** + * Gets known DataClass values. + * + * @return known DataClass values. + */ + public static Collection values() { + return values(DataClass.class); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/DataClassType.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/DataClassType.java new file mode 100644 index 0000000000000..e330c8a57d6b7 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/DataClassType.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines the supported replication scenarios for Azure Data Transfer. + */ +public final class DataClassType extends ExpandableStringEnum { + /** + * Represents standard message-based data, including Azure Service and Event Hub, used in message replication. + */ + public static final DataClassType MESSAGING = fromString("Messaging"); + + /** + * Represents transactional request/response data types from API endpoints. + */ + public static final DataClassType API = fromString("API"); + + /** + * Represents data types that require continuous, real-time streaming replication (e.g., video). + */ + public static final DataClassType STREAM = fromString("Stream"); + + /** + * Represents standard file-based data, including Azure Blob and Table Storage, used in general-purpose replication. + */ + public static final DataClassType FILES = fromString("Files"); + + /** + * Represents data related to development, security, and operations workflows such as build artifacts subject to an + * NCDSMO policy. + */ + public static final DataClassType SOFTWARE_ARTIFACTS = fromString("SoftwareArtifacts"); + + /** + * Represents rich content types such as documents (e.g., Word, PDF) and images that require specialized replication + * handling. + */ + public static final DataClassType COMPLEX = fromString("Complex"); + + /** + * Creates a new instance of DataClassType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataClassType() { + } + + /** + * Creates or finds a DataClassType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataClassType. + */ + public static DataClassType fromString(String name) { + return fromString(name, DataClassType.class); + } + + /** + * Gets known DataClassType values. + * + * @return known DataClassType values. + */ + public static Collection values() { + return values(DataClassType.class); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/DataSizeRuleset.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/DataSizeRuleset.java new file mode 100644 index 0000000000000..875ee46e94e4e --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/DataSizeRuleset.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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; + +/** + * Defines rules that enforce minimum and maximum file size limits for data replication. + */ +@Fluent +public final class DataSizeRuleset implements JsonSerializable { + /* + * Optional. Specifies the maximum allowed size (in bytes) for files to be replicated. Any file size greater than + * maximum will be denied replication. + */ + private Long maximum; + + /* + * Optional. Default is 0. Specifies the minimum required size (in bytes) for a file to be eligible for replication. + * Any file size less than minimum will be denied replication. + */ + private Long minimum; + + /** + * Creates an instance of DataSizeRuleset class. + */ + public DataSizeRuleset() { + } + + /** + * Get the maximum property: Optional. Specifies the maximum allowed size (in bytes) for files to be replicated. Any + * file size greater than maximum will be denied replication. + * + * @return the maximum value. + */ + public Long maximum() { + return this.maximum; + } + + /** + * Set the maximum property: Optional. Specifies the maximum allowed size (in bytes) for files to be replicated. Any + * file size greater than maximum will be denied replication. + * + * @param maximum the maximum value to set. + * @return the DataSizeRuleset object itself. + */ + public DataSizeRuleset withMaximum(Long maximum) { + this.maximum = maximum; + return this; + } + + /** + * Get the minimum property: Optional. Default is 0. Specifies the minimum required size (in bytes) for a file to be + * eligible for replication. Any file size less than minimum will be denied replication. + * + * @return the minimum value. + */ + public Long minimum() { + return this.minimum; + } + + /** + * Set the minimum property: Optional. Default is 0. Specifies the minimum required size (in bytes) for a file to be + * eligible for replication. Any file size less than minimum will be denied replication. + * + * @param minimum the minimum value to set. + * @return the DataSizeRuleset object itself. + */ + public DataSizeRuleset withMinimum(Long minimum) { + this.minimum = minimum; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("maximum", this.maximum); + jsonWriter.writeNumberField("minimum", this.minimum); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataSizeRuleset from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataSizeRuleset 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 DataSizeRuleset. + */ + public static DataSizeRuleset fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataSizeRuleset deserializedDataSizeRuleset = new DataSizeRuleset(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maximum".equals(fieldName)) { + deserializedDataSizeRuleset.maximum = reader.getNullable(JsonReader::getLong); + } else if ("minimum".equals(fieldName)) { + deserializedDataSizeRuleset.minimum = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedDataSizeRuleset; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/DataType.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/DataType.java new file mode 100644 index 0000000000000..302f75fb1cf53 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/DataType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Transfer Storage Blobs or Tables. + */ +public final class DataType extends ExpandableStringEnum { + /** + * The flow uses Azure Storage blobs to send or receive data. + */ + public static final DataType BLOB = fromString("Blob"); + + /** + * The flow uses Azure Storage tables to send or receive data. + */ + 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/DateTransferActionType.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/DateTransferActionType.java new file mode 100644 index 0000000000000..68580b3f54aa7 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/DateTransferActionType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of action to be executed. + */ +public final class DateTransferActionType extends ExpandableStringEnum { + /** + * Allow a pipeline, connection, or flow to be updated. + */ + public static final DateTransferActionType ALLOW_UPDATES = fromString("AllowUpdates"); + + /** + * Force disable a pipeline, connection, or flow. + */ + public static final DateTransferActionType FORCE_DISABLE = fromString("ForceDisable"); + + /** + * Creates a new instance of DateTransferActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DateTransferActionType() { + } + + /** + * Creates or finds a DateTransferActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DateTransferActionType. + */ + public static DateTransferActionType fromString(String name) { + return fromString(name, DateTransferActionType.class); + } + + /** + * Gets known DateTransferActionType values. + * + * @return known DateTransferActionType values. + */ + public static Collection values() { + return values(DateTransferActionType.class); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Direction.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Direction.java new file mode 100644 index 0000000000000..b9d28475fae3b --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Direction.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Direction of data movement. + */ +public final class Direction extends ExpandableStringEnum { + /** + * The direction is on the sending side of a pipeline, connection, or flow. + */ + public static final Direction SEND = fromString("Send"); + + /** + * The direction is on the receiving side side of a pipeline, connection, or flow. + */ + 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/DirectionSettings.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/DirectionSettings.java new file mode 100644 index 0000000000000..a887d5ca06d3a --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/DirectionSettings.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes the available settings and supported features for a specific + * transfer direction (Send or Receive) within a pipeline. + */ +@Immutable +public final class DirectionSettings implements JsonSerializable { + /* + * Indicates whether this direction completes the connection linking process. + */ + private EnablementStatus completeLinking; + + /* + * Indicates whether connections in this direction require approval. + */ + private EnablementStatus connectionApprovals; + + /* + * Indicates whether flow approvals are required for this direction. + */ + private EnablementStatus flowApprovals; + + /* + * The flow types supported for this direction. + */ + private List flowTypesAvailable; + + /* + * Indicates whether schema validation is required for data transfer in this direction. + */ + private EnablementStatus messagingFlowTypeSchemaValidation; + + /* + * The data class types available for FlowProfile-based transfers in this direction. + */ + private List flowProfileDataClassesAvailable; + + /* + * The pricing options available for messaging flows in this direction. + */ + private List messagingFlowsPricingOptions; + + /** + * Creates an instance of DirectionSettings class. + */ + private DirectionSettings() { + } + + /** + * Get the completeLinking property: Indicates whether this direction completes the connection linking process. + * + * @return the completeLinking value. + */ + public EnablementStatus completeLinking() { + return this.completeLinking; + } + + /** + * Get the connectionApprovals property: Indicates whether connections in this direction require approval. + * + * @return the connectionApprovals value. + */ + public EnablementStatus connectionApprovals() { + return this.connectionApprovals; + } + + /** + * Get the flowApprovals property: Indicates whether flow approvals are required for this direction. + * + * @return the flowApprovals value. + */ + public EnablementStatus flowApprovals() { + return this.flowApprovals; + } + + /** + * Get the flowTypesAvailable property: The flow types supported for this direction. + * + * @return the flowTypesAvailable value. + */ + public List flowTypesAvailable() { + return this.flowTypesAvailable; + } + + /** + * Get the messagingFlowTypeSchemaValidation property: Indicates whether schema validation is required for data + * transfer in this direction. + * + * @return the messagingFlowTypeSchemaValidation value. + */ + public EnablementStatus messagingFlowTypeSchemaValidation() { + return this.messagingFlowTypeSchemaValidation; + } + + /** + * Get the flowProfileDataClassesAvailable property: The data class types available for FlowProfile-based transfers + * in this direction. + * + * @return the flowProfileDataClassesAvailable value. + */ + public List flowProfileDataClassesAvailable() { + return this.flowProfileDataClassesAvailable; + } + + /** + * Get the messagingFlowsPricingOptions property: The pricing options available for messaging flows in this + * direction. + * + * @return the messagingFlowsPricingOptions value. + */ + public List messagingFlowsPricingOptions() { + return this.messagingFlowsPricingOptions; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("completeLinking", + this.completeLinking == null ? null : this.completeLinking.toString()); + jsonWriter.writeStringField("connectionApprovals", + this.connectionApprovals == null ? null : this.connectionApprovals.toString()); + jsonWriter.writeStringField("flowApprovals", this.flowApprovals == null ? null : this.flowApprovals.toString()); + jsonWriter.writeArrayField("flowTypesAvailable", this.flowTypesAvailable, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("messagingFlowTypeSchemaValidation", + this.messagingFlowTypeSchemaValidation == null ? null : this.messagingFlowTypeSchemaValidation.toString()); + jsonWriter.writeArrayField("flowProfileDataClassesAvailable", this.flowProfileDataClassesAvailable, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("messagingFlowsPricingOptions", this.messagingFlowsPricingOptions, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DirectionSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DirectionSettings 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 DirectionSettings. + */ + public static DirectionSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DirectionSettings deserializedDirectionSettings = new DirectionSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("completeLinking".equals(fieldName)) { + deserializedDirectionSettings.completeLinking = EnablementStatus.fromString(reader.getString()); + } else if ("connectionApprovals".equals(fieldName)) { + deserializedDirectionSettings.connectionApprovals = EnablementStatus.fromString(reader.getString()); + } else if ("flowApprovals".equals(fieldName)) { + deserializedDirectionSettings.flowApprovals = EnablementStatus.fromString(reader.getString()); + } else if ("flowTypesAvailable".equals(fieldName)) { + List flowTypesAvailable + = reader.readArray(reader1 -> FlowType.fromString(reader1.getString())); + deserializedDirectionSettings.flowTypesAvailable = flowTypesAvailable; + } else if ("messagingFlowTypeSchemaValidation".equals(fieldName)) { + deserializedDirectionSettings.messagingFlowTypeSchemaValidation + = EnablementStatus.fromString(reader.getString()); + } else if ("flowProfileDataClassesAvailable".equals(fieldName)) { + List flowProfileDataClassesAvailable + = reader.readArray(reader1 -> DataClassType.fromString(reader1.getString())); + deserializedDirectionSettings.flowProfileDataClassesAvailable = flowProfileDataClassesAvailable; + } else if ("messagingFlowsPricingOptions".equals(fieldName)) { + List messagingFlowsPricingOptions + = reader.readArray(reader1 -> FlowBillingTier.fromString(reader1.getString())); + deserializedDirectionSettings.messagingFlowsPricingOptions = messagingFlowsPricingOptions; + } else { + reader.skipChildren(); + } + } + + return deserializedDirectionSettings; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/EnablementStatus.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/EnablementStatus.java new file mode 100644 index 0000000000000..ac8c97526a3d3 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/EnablementStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enablement statuses. + */ +public final class EnablementStatus extends ExpandableStringEnum { + /** + * Represents an enabled status. + */ + public static final EnablementStatus ENABLED = fromString("Enabled"); + + /** + * Represents a disabled status. + */ + public static final EnablementStatus DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of EnablementStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EnablementStatus() { + } + + /** + * Creates or finds a EnablementStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding EnablementStatus. + */ + public static EnablementStatus fromString(String name) { + return fromString(name, EnablementStatus.class); + } + + /** + * Gets known EnablementStatus values. + * + * @return known EnablementStatus values. + */ + public static Collection values() { + return values(EnablementStatus.class); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FilterType.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FilterType.java new file mode 100644 index 0000000000000..b7fb1e341d5df --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FilterType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies whether the filter applies an allow or deny policy. + */ +public final class FilterType extends ExpandableStringEnum { + /** + * Defines an allow filter used for allowlist. + */ + public static final FilterType ALLOW = fromString("Allow"); + + /** + * Defines a denying filter used for blocklisting. + */ + public static final FilterType DENY = fromString("Deny"); + + /** + * Creates a new instance of FilterType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FilterType() { + } + + /** + * Creates or finds a FilterType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FilterType. + */ + public static FilterType fromString(String name) { + return fromString(name, FilterType.class); + } + + /** + * Gets known FilterType values. + * + * @return known FilterType values. + */ + public static Collection values() { + return values(FilterType.class); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Flow.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Flow.java new file mode 100644 index 0000000000000..8f38b604acda9 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Flow.java @@ -0,0 +1,591 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.fluent.models.FlowInner; +import com.azure.resourcemanager.datatransfer.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.datatransfer.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 to perform the operation on. + * @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.WithProperties, UpdateStages.WithPlan, 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 properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of flow. + * + * @param properties Properties of flow. + * @return the next definition stage. + */ + Update withProperties(FlowPropertiesInner properties); + } + + /** + * The stage of the Flow update 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. + */ + Update withPlan(Plan plan); + } + + /** + * 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. + * + * @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 along with {@link Response}. + */ + Response getDestinationEndpointPortsWithResponse(Context context); + + /** + * Get the destination endpoint ports 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 destination endpoint ports for the specified flow. + */ + GetDestinationEndpointPortsResult getDestinationEndpointPorts(); + + /** + * Get the destination endpoints 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 destination endpoints for the specified flow along with {@link Response}. + */ + Response getDestinationEndpointsWithResponse(Context context); + + /** + * Get the destination endpoints 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 destination endpoints for the specified flow. + */ + 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 flow 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 flow); + + /** + * Links the specified flow. + * + * @param flow 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 flow, Context context); + + /** + * Set the destination endpoint ports for the specified flow. + * + * @param streamDestinationEndpointPorts The 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 streamDestinationEndpointPorts); + + /** + * Set the destination endpoint ports for the specified flow. + * + * @param streamDestinationEndpointPorts The 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 streamDestinationEndpointPorts, Context context); + + /** + * Set the destination endpoints for the specified flow. + * + * @param streamDestinationEndpoints 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 streamDestinationEndpoints); + + /** + * Set the destination endpoints for the specified flow. + * + * @param streamDestinationEndpoints 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 streamDestinationEndpoints, Context context); + + /** + * Sets the passphrase of the specified flow. + * + * @param passphrase 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 passphrase); + + /** + * Sets the passphrase of the specified flow. + * + * @param passphrase 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 passphrase, Context context); + + /** + * Set the source addresses for the specified flow. + * + * @param sourceAddresses 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 sourceAddresses); + + /** + * Set the source addresses for the specified flow. + * + * @param sourceAddresses 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 sourceAddresses, Context context); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowBillingTier.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowBillingTier.java new file mode 100644 index 0000000000000..59a679185b3d8 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowBillingTier.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Billing tier for this messaging flow. + */ +public final class FlowBillingTier extends ExpandableStringEnum { + /** + * Billing tier for messaging processing that charges based on how much data is transferred. + */ + public static final FlowBillingTier BLOB_TRANSPORT = fromString("BlobTransport"); + + /** + * Billing tier for standard messaging processing that charges based on having the messaging resource allocated. + */ + public static final FlowBillingTier STANDARD = fromString("Standard"); + + /** + * Billing tier for premium messaging processing that charges based on having the messaging resource allocated. + */ + 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfile.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfile.java new file mode 100644 index 0000000000000..6a540acda59ca --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfile.java @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datatransfer.fluent.models.FlowProfileInner; +import java.util.Map; + +/** + * An immutable client-side representation of FlowProfile. + */ +public interface FlowProfile { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The set of configuration properties that define the behavior and rules of the + * FlowProfile. + * + * @return the properties value. + */ + FlowProfileProperties 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.datatransfer.fluent.models.FlowProfileInner object. + * + * @return the inner object. + */ + FlowProfileInner innerModel(); + + /** + * The entirety of the FlowProfile definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The FlowProfile definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the FlowProfile definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the FlowProfile 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 FlowProfile definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, pipelineName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @return the next definition stage. + */ + WithCreate withExistingPipeline(String resourceGroupName, String pipelineName); + } + + /** + * The stage of the FlowProfile 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. + */ + FlowProfile create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FlowProfile create(Context context); + } + + /** + * The stage of the FlowProfile 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 FlowProfile definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The set of configuration properties that define the behavior and rules + * of the FlowProfile.. + * + * @param properties The set of configuration properties that define the behavior and rules of the + * FlowProfile. + * @return the next definition stage. + */ + WithCreate withProperties(FlowProfileProperties properties); + } + + /** + * The stage of the FlowProfile 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 FlowProfile resource. + * + * @return the stage of resource update. + */ + FlowProfile.Update update(); + + /** + * The template for FlowProfile update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithIdentity { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FlowProfile apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FlowProfile apply(Context context); + } + + /** + * The FlowProfile update stages. + */ + interface UpdateStages { + /** + * The stage of the FlowProfile 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 FlowProfile update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of FlowProfile patch body.. + * + * @param properties Properties of FlowProfile patch body. + * @return the next definition stage. + */ + Update withProperties(FlowProfilePatchProperties properties); + } + + /** + * The stage of the FlowProfile 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. + */ + FlowProfile refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FlowProfile refresh(Context context); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfileMetadata.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfileMetadata.java new file mode 100644 index 0000000000000..555b8069360c8 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfileMetadata.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 FlowProfile Metadata used to concisely provide all publicly viewable information. + */ +@Fluent +public final class FlowProfileMetadata implements JsonSerializable { + /* + * The name of the parent Pipeline Azure resource associated with this FlowProfile. + */ + private String pipeline; + + /* + * The name of the FlowProfile. + */ + private String name; + + /* + * The data replication scenario handled by this FlowProfile. Please note, that this value cannot be updated after + * creation. See the FlowProfilePatchProperties to see updateable properties. + */ + private DataClassType replicationScenario; + + /* + * A guid represented as a string for the FlowProfile resource, assigned by the system. + */ + private String flowProfileId; + + /* + * The operational status of the FlowProfile. + */ + private FlowProfileStatus status; + + /* + * A description of the FlowProfile and its rulesets. The description should describe the flowprofile's purpose and + * rulesets applied. + */ + private String description; + + /** + * Creates an instance of FlowProfileMetadata class. + */ + public FlowProfileMetadata() { + } + + /** + * Get the pipeline property: The name of the parent Pipeline Azure resource associated with this FlowProfile. + * + * @return the pipeline value. + */ + public String pipeline() { + return this.pipeline; + } + + /** + * Set the pipeline property: The name of the parent Pipeline Azure resource associated with this FlowProfile. + * + * @param pipeline the pipeline value to set. + * @return the FlowProfileMetadata object itself. + */ + public FlowProfileMetadata withPipeline(String pipeline) { + this.pipeline = pipeline; + return this; + } + + /** + * Get the name property: The name of the FlowProfile. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the FlowProfile. + * + * @param name the name value to set. + * @return the FlowProfileMetadata object itself. + */ + public FlowProfileMetadata withName(String name) { + this.name = name; + return this; + } + + /** + * Get the replicationScenario property: The data replication scenario handled by this FlowProfile. Please note, + * that this value cannot be updated after creation. See the FlowProfilePatchProperties to see updateable + * properties. + * + * @return the replicationScenario value. + */ + public DataClassType replicationScenario() { + return this.replicationScenario; + } + + /** + * Set the replicationScenario property: The data replication scenario handled by this FlowProfile. Please note, + * that this value cannot be updated after creation. See the FlowProfilePatchProperties to see updateable + * properties. + * + * @param replicationScenario the replicationScenario value to set. + * @return the FlowProfileMetadata object itself. + */ + public FlowProfileMetadata withReplicationScenario(DataClassType replicationScenario) { + this.replicationScenario = replicationScenario; + return this; + } + + /** + * Get the flowProfileId property: A guid represented as a string for the FlowProfile resource, assigned by the + * system. + * + * @return the flowProfileId value. + */ + public String flowProfileId() { + return this.flowProfileId; + } + + /** + * Set the flowProfileId property: A guid represented as a string for the FlowProfile resource, assigned by the + * system. + * + * @param flowProfileId the flowProfileId value to set. + * @return the FlowProfileMetadata object itself. + */ + public FlowProfileMetadata withFlowProfileId(String flowProfileId) { + this.flowProfileId = flowProfileId; + return this; + } + + /** + * Get the status property: The operational status of the FlowProfile. + * + * @return the status value. + */ + public FlowProfileStatus status() { + return this.status; + } + + /** + * Set the status property: The operational status of the FlowProfile. + * + * @param status the status value to set. + * @return the FlowProfileMetadata object itself. + */ + public FlowProfileMetadata withStatus(FlowProfileStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: A description of the FlowProfile and its rulesets. The description should describe + * the flowprofile's purpose and rulesets applied. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description of the FlowProfile and its rulesets. The description should describe + * the flowprofile's purpose and rulesets applied. + * + * @param description the description value to set. + * @return the FlowProfileMetadata object itself. + */ + public FlowProfileMetadata withDescription(String description) { + this.description = description; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("pipeline", this.pipeline); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("replicationScenario", + this.replicationScenario == null ? null : this.replicationScenario.toString()); + jsonWriter.writeStringField("flowProfileId", this.flowProfileId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlowProfileMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlowProfileMetadata 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 FlowProfileMetadata. + */ + public static FlowProfileMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlowProfileMetadata deserializedFlowProfileMetadata = new FlowProfileMetadata(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("pipeline".equals(fieldName)) { + deserializedFlowProfileMetadata.pipeline = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFlowProfileMetadata.name = reader.getString(); + } else if ("replicationScenario".equals(fieldName)) { + deserializedFlowProfileMetadata.replicationScenario = DataClassType.fromString(reader.getString()); + } else if ("flowProfileId".equals(fieldName)) { + deserializedFlowProfileMetadata.flowProfileId = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedFlowProfileMetadata.status = FlowProfileStatus.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedFlowProfileMetadata.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFlowProfileMetadata; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfilePatch.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfilePatch.java new file mode 100644 index 0000000000000..18c8933ccbcff --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfilePatch.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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; + +/** + * Defines the patchable properties for a FlowProfile resource. + */ +@Fluent +public final class FlowProfilePatch implements JsonSerializable { + /* + * Properties of FlowProfile patch body. + */ + private FlowProfilePatchProperties properties; + + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of FlowProfilePatch class. + */ + public FlowProfilePatch() { + } + + /** + * Get the properties property: Properties of FlowProfile patch body. + * + * @return the properties value. + */ + public FlowProfilePatchProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of FlowProfile patch body. + * + * @param properties the properties value to set. + * @return the FlowProfilePatch object itself. + */ + public FlowProfilePatch withProperties(FlowProfilePatchProperties 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 FlowProfilePatch object itself. + */ + public FlowProfilePatch 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 FlowProfilePatch object itself. + */ + public FlowProfilePatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlowProfilePatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlowProfilePatch 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 FlowProfilePatch. + */ + public static FlowProfilePatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlowProfilePatch deserializedFlowProfilePatch = new FlowProfilePatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedFlowProfilePatch.properties = FlowProfilePatchProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedFlowProfilePatch.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedFlowProfilePatch.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedFlowProfilePatch; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfilePatchProperties.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfilePatchProperties.java new file mode 100644 index 0000000000000..845ca200ab682 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfilePatchProperties.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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; + +/** + * Represents the updatable properties of a FlowProfile. + */ +@Fluent +public final class FlowProfilePatchProperties implements JsonSerializable { + /* + * The current provisioning state of the FlowProfile resource. + */ + private ProvisioningState provisioningState; + + /* + * A description of the FlowProfile that defines the replication scenario. + */ + private String description; + + /* + * A set of configurable rulesets applied to this FlowProfile. + */ + private FlowProfileRulesets rulesets; + + /* + * The operational status of the FlowProfile. + */ + private FlowProfileStatus status; + + /** + * Creates an instance of FlowProfilePatchProperties class. + */ + public FlowProfilePatchProperties() { + } + + /** + * Get the provisioningState property: The current provisioning state of the FlowProfile resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the description property: A description of the FlowProfile that defines the replication scenario. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description of the FlowProfile that defines the replication scenario. + * + * @param description the description value to set. + * @return the FlowProfilePatchProperties object itself. + */ + public FlowProfilePatchProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the rulesets property: A set of configurable rulesets applied to this FlowProfile. + * + * @return the rulesets value. + */ + public FlowProfileRulesets rulesets() { + return this.rulesets; + } + + /** + * Set the rulesets property: A set of configurable rulesets applied to this FlowProfile. + * + * @param rulesets the rulesets value to set. + * @return the FlowProfilePatchProperties object itself. + */ + public FlowProfilePatchProperties withRulesets(FlowProfileRulesets rulesets) { + this.rulesets = rulesets; + return this; + } + + /** + * Get the status property: The operational status of the FlowProfile. + * + * @return the status value. + */ + public FlowProfileStatus status() { + return this.status; + } + + /** + * Set the status property: The operational status of the FlowProfile. + * + * @param status the status value to set. + * @return the FlowProfilePatchProperties object itself. + */ + public FlowProfilePatchProperties withStatus(FlowProfileStatus status) { + this.status = status; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("rulesets", this.rulesets); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlowProfilePatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlowProfilePatchProperties 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 FlowProfilePatchProperties. + */ + public static FlowProfilePatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlowProfilePatchProperties deserializedFlowProfilePatchProperties = new FlowProfilePatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedFlowProfilePatchProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedFlowProfilePatchProperties.description = reader.getString(); + } else if ("rulesets".equals(fieldName)) { + deserializedFlowProfilePatchProperties.rulesets = FlowProfileRulesets.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedFlowProfilePatchProperties.status = FlowProfileStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFlowProfilePatchProperties; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfileProperties.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfileProperties.java new file mode 100644 index 0000000000000..6e5fcd19f1960 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfileProperties.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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; + +/** + * Defines the full set of properties for a FlowProfile resource. + */ +@Fluent +public final class FlowProfileProperties implements JsonSerializable { + /* + * The current provisioning state of the FlowProfile. + */ + private ProvisioningState provisioningState; + + /* + * A guid represented as a string for the FlowProfile resource, assigned by the system. + */ + private String flowProfileId; + + /* + * The data replication scenario handled by this FlowProfile. Please not, that this value cannot be updated after + * creation. + */ + private DataClassType replicationScenario; + + /* + * The operational status of the FlowProfile. + */ + private FlowProfileStatus status; + + /* + * A user-defined description of the FlowProfile. + */ + private String description; + + /* + * A set of configurable rulesets applied to this FlowProfile. + */ + private FlowProfileRulesets rulesets; + + /** + * Creates an instance of FlowProfileProperties class. + */ + public FlowProfileProperties() { + } + + /** + * Get the provisioningState property: The current provisioning state of the FlowProfile. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the flowProfileId property: A guid represented as a string for the FlowProfile resource, assigned by the + * system. + * + * @return the flowProfileId value. + */ + public String flowProfileId() { + return this.flowProfileId; + } + + /** + * Get the replicationScenario property: The data replication scenario handled by this FlowProfile. Please not, that + * this value cannot be updated after creation. + * + * @return the replicationScenario value. + */ + public DataClassType replicationScenario() { + return this.replicationScenario; + } + + /** + * Set the replicationScenario property: The data replication scenario handled by this FlowProfile. Please not, that + * this value cannot be updated after creation. + * + * @param replicationScenario the replicationScenario value to set. + * @return the FlowProfileProperties object itself. + */ + public FlowProfileProperties withReplicationScenario(DataClassType replicationScenario) { + this.replicationScenario = replicationScenario; + return this; + } + + /** + * Get the status property: The operational status of the FlowProfile. + * + * @return the status value. + */ + public FlowProfileStatus status() { + return this.status; + } + + /** + * Set the status property: The operational status of the FlowProfile. + * + * @param status the status value to set. + * @return the FlowProfileProperties object itself. + */ + public FlowProfileProperties withStatus(FlowProfileStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: A user-defined description of the FlowProfile. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A user-defined description of the FlowProfile. + * + * @param description the description value to set. + * @return the FlowProfileProperties object itself. + */ + public FlowProfileProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the rulesets property: A set of configurable rulesets applied to this FlowProfile. + * + * @return the rulesets value. + */ + public FlowProfileRulesets rulesets() { + return this.rulesets; + } + + /** + * Set the rulesets property: A set of configurable rulesets applied to this FlowProfile. + * + * @param rulesets the rulesets value to set. + * @return the FlowProfileProperties object itself. + */ + public FlowProfileProperties withRulesets(FlowProfileRulesets rulesets) { + this.rulesets = rulesets; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("replicationScenario", + this.replicationScenario == null ? null : this.replicationScenario.toString()); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("rulesets", this.rulesets); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlowProfileProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlowProfileProperties 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 FlowProfileProperties. + */ + public static FlowProfileProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlowProfileProperties deserializedFlowProfileProperties = new FlowProfileProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("replicationScenario".equals(fieldName)) { + deserializedFlowProfileProperties.replicationScenario + = DataClassType.fromString(reader.getString()); + } else if ("status".equals(fieldName)) { + deserializedFlowProfileProperties.status = FlowProfileStatus.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedFlowProfileProperties.description = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedFlowProfileProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("flowProfileId".equals(fieldName)) { + deserializedFlowProfileProperties.flowProfileId = reader.getString(); + } else if ("rulesets".equals(fieldName)) { + deserializedFlowProfileProperties.rulesets = FlowProfileRulesets.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFlowProfileProperties; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfileRulesets.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfileRulesets.java new file mode 100644 index 0000000000000..4ebb0fa38dffc --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfileRulesets.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 allowed set of configurable rulesets for a FlowProfile resource, used during data replication. All rulesets are + * optional, and any ruleset configured will be applied to every applicable replicating data. Any data that fails a + * ruleset will be denied replication. If a ruleset is not configured then the ruleset is considered disabled and will + * not apply towards replicating data. + */ +@Fluent +public final class FlowProfileRulesets implements JsonSerializable { + /* + * Antivirus scanning rules for replicated data. + */ + private AntivirusRuleset antivirus; + + /* + * Rules for handling archive files during replication. + */ + private ArchiveRuleset archives; + + /* + * Rules that enforce minimum and maximum data size limits. + */ + private DataSizeRuleset dataSize; + + /* + * Rules for filtering files based on MIME types. + */ + private MimeFilterRuleset mimeFilters; + + /* + * Rules for filtering XML content using XSD schemas. + */ + private XmlFilterRuleset xmlFilters; + + /* + * Rules for detecting and blocking specific text patterns. + */ + private TextMatchingRuleset textMatching; + + /** + * Creates an instance of FlowProfileRulesets class. + */ + public FlowProfileRulesets() { + } + + /** + * Get the antivirus property: Antivirus scanning rules for replicated data. + * + * @return the antivirus value. + */ + public AntivirusRuleset antivirus() { + return this.antivirus; + } + + /** + * Set the antivirus property: Antivirus scanning rules for replicated data. + * + * @param antivirus the antivirus value to set. + * @return the FlowProfileRulesets object itself. + */ + public FlowProfileRulesets withAntivirus(AntivirusRuleset antivirus) { + this.antivirus = antivirus; + return this; + } + + /** + * Get the archives property: Rules for handling archive files during replication. + * + * @return the archives value. + */ + public ArchiveRuleset archives() { + return this.archives; + } + + /** + * Set the archives property: Rules for handling archive files during replication. + * + * @param archives the archives value to set. + * @return the FlowProfileRulesets object itself. + */ + public FlowProfileRulesets withArchives(ArchiveRuleset archives) { + this.archives = archives; + return this; + } + + /** + * Get the dataSize property: Rules that enforce minimum and maximum data size limits. + * + * @return the dataSize value. + */ + public DataSizeRuleset dataSize() { + return this.dataSize; + } + + /** + * Set the dataSize property: Rules that enforce minimum and maximum data size limits. + * + * @param dataSize the dataSize value to set. + * @return the FlowProfileRulesets object itself. + */ + public FlowProfileRulesets withDataSize(DataSizeRuleset dataSize) { + this.dataSize = dataSize; + return this; + } + + /** + * Get the mimeFilters property: Rules for filtering files based on MIME types. + * + * @return the mimeFilters value. + */ + public MimeFilterRuleset mimeFilters() { + return this.mimeFilters; + } + + /** + * Set the mimeFilters property: Rules for filtering files based on MIME types. + * + * @param mimeFilters the mimeFilters value to set. + * @return the FlowProfileRulesets object itself. + */ + public FlowProfileRulesets withMimeFilters(MimeFilterRuleset mimeFilters) { + this.mimeFilters = mimeFilters; + return this; + } + + /** + * Get the xmlFilters property: Rules for filtering XML content using XSD schemas. + * + * @return the xmlFilters value. + */ + public XmlFilterRuleset xmlFilters() { + return this.xmlFilters; + } + + /** + * Set the xmlFilters property: Rules for filtering XML content using XSD schemas. + * + * @param xmlFilters the xmlFilters value to set. + * @return the FlowProfileRulesets object itself. + */ + public FlowProfileRulesets withXmlFilters(XmlFilterRuleset xmlFilters) { + this.xmlFilters = xmlFilters; + return this; + } + + /** + * Get the textMatching property: Rules for detecting and blocking specific text patterns. + * + * @return the textMatching value. + */ + public TextMatchingRuleset textMatching() { + return this.textMatching; + } + + /** + * Set the textMatching property: Rules for detecting and blocking specific text patterns. + * + * @param textMatching the textMatching value to set. + * @return the FlowProfileRulesets object itself. + */ + public FlowProfileRulesets withTextMatching(TextMatchingRuleset textMatching) { + this.textMatching = textMatching; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("antivirus", this.antivirus); + jsonWriter.writeJsonField("archives", this.archives); + jsonWriter.writeJsonField("dataSize", this.dataSize); + jsonWriter.writeJsonField("mimeFilters", this.mimeFilters); + jsonWriter.writeJsonField("xmlFilters", this.xmlFilters); + jsonWriter.writeJsonField("textMatching", this.textMatching); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlowProfileRulesets from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlowProfileRulesets 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 FlowProfileRulesets. + */ + public static FlowProfileRulesets fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlowProfileRulesets deserializedFlowProfileRulesets = new FlowProfileRulesets(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("antivirus".equals(fieldName)) { + deserializedFlowProfileRulesets.antivirus = AntivirusRuleset.fromJson(reader); + } else if ("archives".equals(fieldName)) { + deserializedFlowProfileRulesets.archives = ArchiveRuleset.fromJson(reader); + } else if ("dataSize".equals(fieldName)) { + deserializedFlowProfileRulesets.dataSize = DataSizeRuleset.fromJson(reader); + } else if ("mimeFilters".equals(fieldName)) { + deserializedFlowProfileRulesets.mimeFilters = MimeFilterRuleset.fromJson(reader); + } else if ("xmlFilters".equals(fieldName)) { + deserializedFlowProfileRulesets.xmlFilters = XmlFilterRuleset.fromJson(reader); + } else if ("textMatching".equals(fieldName)) { + deserializedFlowProfileRulesets.textMatching = TextMatchingRuleset.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFlowProfileRulesets; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfileStatus.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfileStatus.java new file mode 100644 index 0000000000000..9bd33eda9d795 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfileStatus.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The allowed statuses of a FlowProfile. + */ +public final class FlowProfileStatus extends ExpandableStringEnum { + /** + * Defines a FlowProfile that can no longer be selected. + */ + public static final FlowProfileStatus OBSOLETE = fromString("Obsolete"); + + /** + * Defines a FlowProfile that is enabled. + */ + public static final FlowProfileStatus ENABLED = fromString("Enabled"); + + /** + * Defines a FlowProfile that is disabled. + */ + public static final FlowProfileStatus DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of FlowProfileStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FlowProfileStatus() { + } + + /** + * Creates or finds a FlowProfileStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding FlowProfileStatus. + */ + public static FlowProfileStatus fromString(String name) { + return fromString(name, FlowProfileStatus.class); + } + + /** + * Gets known FlowProfileStatus values. + * + * @return known FlowProfileStatus values. + */ + public static Collection values() { + return values(FlowProfileStatus.class); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfiles.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfiles.java new file mode 100644 index 0000000000000..418ba866e7475 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfiles.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 FlowProfiles. + */ +public interface FlowProfiles { + /** + * Retrieves the specified FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @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 represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String pipelineName, String flowProfileName, + Context context); + + /** + * Retrieves the specified FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules. + */ + FlowProfile get(String resourceGroupName, String pipelineName, String flowProfileName); + + /** + * Deletes the specified FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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, String flowProfileName); + + /** + * Deletes the specified FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param flowProfileName The name of the FlowProfile resource to operate on. Must be 3 to 64 characters long and + * contain only alphanumeric characters or hyphens. + * @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, String flowProfileName, Context context); + + /** + * Lists all FlowProfiles under a given Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 FlowProfile list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByPipeline(String resourceGroupName, String pipelineName); + + /** + * Lists all FlowProfiles under a given Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @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 FlowProfile list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByPipeline(String resourceGroupName, String pipelineName, Context context); + + /** + * Retrieves the specified FlowProfile 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 represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules along with {@link Response}. + */ + FlowProfile getById(String id); + + /** + * Retrieves the specified FlowProfile 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 represents a FlowProfile Azure resource, which defines a data replication scenario with a specific data + * classification and a set of configurable policy rules along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified FlowProfile 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 specified FlowProfile 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 FlowProfile resource. + * + * @param name resource name. + * @return the first stage of the new FlowProfile definition. + */ + FlowProfile.DefinitionStages.Blank define(String name); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfilesListResult.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfilesListResult.java new file mode 100644 index 0000000000000..bce0e1f06d613 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfilesListResult.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.resourcemanager.datatransfer.fluent.models.FlowProfilesListResultInner; +import java.util.List; + +/** + * An immutable client-side representation of FlowProfilesListResult. + */ +public interface FlowProfilesListResult { + /** + * Gets the value property: FlowProfileMetadata array. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.datatransfer.fluent.models.FlowProfilesListResultInner object. + * + * @return the inner object. + */ + FlowProfilesListResultInner innerModel(); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProperties.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProperties.java new file mode 100644 index 0000000000000..4ad485b3ad5f2 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProperties.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.resourcemanager.datatransfer.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: URI to a Key Vault Secret containing a 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 flowProfile property: Type of FlowProfile to use for transfer via the flow. + * + * @return the flowProfile value. + */ + FlowProfileMetadata flowProfile(); + + /** + * Gets the flowDataType property: The Flow's data class. + * + * @return the flowDataType value. + */ + DataClass flowDataType(); + + /** + * Gets the flowType property: The flow type for this flow. The property has reached end of life support starting + * version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @return the flowType value. + */ + FlowType flowType(); + + /** + * Gets the dataType property: Type of data to transfer via the flow. The property has reached end of life support + * starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @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. The property has reached end of life support starting + * version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @return the policies value. + */ + List policies(); + + /** + * Gets the schema property: The selected schema for this flow. The property has reached end of life support + * starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @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.datatransfer.fluent.models.FlowPropertiesInner object. + * + * @return the inner object. + */ + FlowPropertiesInner innerModel(); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowStatus.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowStatus.java new file mode 100644 index 0000000000000..1a8c59129f7b7 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status of the current flow. + */ +public final class FlowStatus extends ExpandableStringEnum { + /** + * The flow is currently enabled and able to send or receive data. + */ + public static final FlowStatus ENABLED = fromString("Enabled"); + + /** + * The flow is currently disabled and cannot send or receive data. + */ + 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowType.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowType.java new file mode 100644 index 0000000000000..26ea98a6e235f --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowType.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Flow type for the specified resource. FlowType will be deprecated starting from version 2025_05_30_preview - please + * create a FlowProfile resource instead. + */ +public final class FlowType extends ExpandableStringEnum { + /** + * This type of flow is not set. + */ + public static final FlowType UNKNOWN = fromString("Unknown"); + + /** + * This flow sends complex documents, such as Microsoft Office documents of Portable document format files. + */ + public static final FlowType COMPLEX = fromString("Complex"); + + /** + * This flow sends source code files and artifacts. + */ + public static final FlowType DEV_SEC_OPS = fromString("DevSecOps"); + + /** + * This flow over the Azure Data Transfer low latency messaging subsystem. + */ + public static final FlowType MESSAGING = fromString("Messaging"); + + /** + * This flow sends standard data but is subject to strict cloud owner approval. + */ + public static final FlowType MISSION = fromString("Mission"); + + /** + * This flow is assigned to internal Microsoft use cases. + */ + public static final FlowType MICROSOFT_INTERNAL = fromString("MicrosoftInternal"); + + /** + * This flow sends blobs that can be used for multiple use cases. + */ + public static final FlowType BASIC_FILES = fromString("BasicFiles"); + + /** + * This flow sends blobs that can be used for multiple use cases. + */ + public static final FlowType DATA = fromString("Data"); + + /** + * This flow sends blobs that can be used for multiple use cases. + */ + public static final FlowType STANDARD = fromString("Standard"); + + /** + * This flow sends video streams. + */ + public static final FlowType STREAMING_VIDEO = fromString("StreamingVideo"); + + /** + * This flow sends blobs but is subject to cloud owner approval. + */ + public static final FlowType OPAQUE = fromString("Opaque"); + + /** + * This flow sends Extensible Markup Language that is subject to strict cloud owner approval. + */ + public static final FlowType MISSION_OPAQUE_XML = fromString("MissionOpaqueXML"); + + /** + * This flow sends blobs that can be used for Virtual Machines. + */ + public static final FlowType DISK_IMAGES = fromString("DiskImages"); + + /** + * This flow sends data via an Application Programmer Interface. + */ + 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Flows.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Flows.java new file mode 100644 index 0000000000000..7e7dd8d038bb6 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Flows.java @@ -0,0 +1,519 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * Updates the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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. + */ + void update(String resourceGroupName, String connectionName, String flowName, FlowsPatch flow); + + /** + * Updates the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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. + */ + void update(String resourceGroupName, String connectionName, String flowName, FlowsPatch flow, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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); + + /** + * 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 to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 to perform the operation on. + * @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); + + /** + * Disables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 along with {@link Response}. + */ + Response getDestinationEndpointPortsWithResponse(String resourceGroupName, + String connectionName, String flowName, Context context); + + /** + * Get the destination endpoint ports for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + GetDestinationEndpointPortsResult getDestinationEndpointPorts(String resourceGroupName, String connectionName, + String flowName); + + /** + * Get the destination endpoints for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 along with {@link Response}. + */ + Response getDestinationEndpointsWithResponse(String resourceGroupName, + String connectionName, String flowName, Context context); + + /** + * Get the destination endpoints for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 flow); + + /** + * Links the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param flow 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 flow, Context context); + + /** + * Set the destination endpoint ports for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpointPorts The 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 streamDestinationEndpointPorts); + + /** + * Set the destination endpoint ports for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpointPorts The 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 streamDestinationEndpointPorts, Context context); + + /** + * Set the destination endpoints for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpoints 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 streamDestinationEndpoints); + + /** + * Set the destination endpoints for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param streamDestinationEndpoints 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 streamDestinationEndpoints, 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param passphrase 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 passphrase); + + /** + * 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param passphrase 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 passphrase, + 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param sourceAddresses 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 sourceAddresses); + + /** + * 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 to perform the operation on. + * @param flowName The name for the flow to perform the operation on. + * @param sourceAddresses 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 sourceAddresses, 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowsPatch.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowsPatch.java new file mode 100644 index 0000000000000..09d63f9ecc3a6 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowsPatch.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 { + /* + * Properties of flows patch body. + */ + private FlowsPatchProperties properties; + + /* + * 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 properties property: Properties of flows patch body. + * + * @return the properties value. + */ + public FlowsPatchProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of flows patch body. + * + * @param properties the properties value to set. + * @return the FlowsPatch object itself. + */ + public FlowsPatch withProperties(FlowsPatchProperties 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 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + 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 ("properties".equals(fieldName)) { + deserializedFlowsPatch.properties = FlowsPatchProperties.fromJson(reader); + } else 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowsPatchProperties.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowsPatchProperties.java new file mode 100644 index 0000000000000..44572cfdf3374 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/FlowsPatchProperties.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 of flows patch body. + */ +@Fluent +public final class FlowsPatchProperties implements JsonSerializable { + /* + * The protocol of the stream + */ + private StreamProtocol streamProtocol; + + /* + * The passphrase used for SRT streams + */ + private String passphrase; + + /* + * The flow stream identifier + */ + private String streamId; + + /* + * The latency of the stream in milliseconds + */ + private Long streamLatency; + + /** + * Creates an instance of FlowsPatchProperties class. + */ + public FlowsPatchProperties() { + } + + /** + * 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 FlowsPatchProperties object itself. + */ + public FlowsPatchProperties withStreamProtocol(StreamProtocol streamProtocol) { + this.streamProtocol = streamProtocol; + 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 FlowsPatchProperties object itself. + */ + public FlowsPatchProperties withPassphrase(String passphrase) { + this.passphrase = passphrase; + 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 FlowsPatchProperties object itself. + */ + public FlowsPatchProperties withStreamId(String streamId) { + this.streamId = streamId; + 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 FlowsPatchProperties object itself. + */ + public FlowsPatchProperties withStreamLatency(Long streamLatency) { + this.streamLatency = streamLatency; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("streamProtocol", + this.streamProtocol == null ? null : this.streamProtocol.toString()); + jsonWriter.writeStringField("passphrase", this.passphrase); + jsonWriter.writeStringField("streamId", this.streamId); + jsonWriter.writeNumberField("streamLatency", this.streamLatency); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlowsPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlowsPatchProperties 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 FlowsPatchProperties. + */ + public static FlowsPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlowsPatchProperties deserializedFlowsPatchProperties = new FlowsPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("streamProtocol".equals(fieldName)) { + deserializedFlowsPatchProperties.streamProtocol = StreamProtocol.fromString(reader.getString()); + } else if ("passphrase".equals(fieldName)) { + deserializedFlowsPatchProperties.passphrase = reader.getString(); + } else if ("streamId".equals(fieldName)) { + deserializedFlowsPatchProperties.streamId = reader.getString(); + } else if ("streamLatency".equals(fieldName)) { + deserializedFlowsPatchProperties.streamLatency = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedFlowsPatchProperties; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ForceDisabledStatus.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ForceDisabledStatus.java new file mode 100644 index 0000000000000..b0dca9f3609cb --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ForceDisabledStatus.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines different disablement statuses and the circumstances in why they were disabled. + */ +public final class ForceDisabledStatus extends ExpandableStringEnum { + /** + * Defines disablement of a Flow due to the parent connection being disabled. + */ + public static final ForceDisabledStatus CONNECTION_FORCE_DISABLED = fromString("ConnectionForceDisabled"); + + /** + * Defines disablement of a Flow due to the linked flow type being disabled. + */ + public static final ForceDisabledStatus FLOW_TYPE_FORCE_DISABLED = fromString("FlowTypeForceDisabled"); + + /** + * Defines disablement of a Flow due to the Pipeline being disabled. + */ + public static final ForceDisabledStatus PIPELINE_FORCE_DISABLED = fromString("PipelineForceDisabled"); + + /** + * Defines disablement of a Flow due to the FlowProfile being disabled. + */ + public static final ForceDisabledStatus FLOW_PROFILE_FORCE_DISABLED = fromString("FlowProfileForceDisabled"); + + /** + * 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/GetDestinationEndpointPortsResult.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/GetDestinationEndpointPortsResult.java new file mode 100644 index 0000000000000..f5e2da9b4234f --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/GetDestinationEndpointPortsResult.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.resourcemanager.datatransfer.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.datatransfer.fluent.models.GetDestinationEndpointPortsResultInner + * object. + * + * @return the inner object. + */ + GetDestinationEndpointPortsResultInner innerModel(); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/GetDestinationEndpointsResult.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/GetDestinationEndpointsResult.java new file mode 100644 index 0000000000000..a4630596c9ef8 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/GetDestinationEndpointsResult.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.resourcemanager.datatransfer.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.datatransfer.fluent.models.GetDestinationEndpointsResultInner object. + * + * @return the inner object. + */ + GetDestinationEndpointsResultInner innerModel(); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/GetStreamConnectionStringResult.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/GetStreamConnectionStringResult.java new file mode 100644 index 0000000000000..dc98139e3f60a --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/GetStreamConnectionStringResult.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.resourcemanager.datatransfer.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.datatransfer.fluent.models.GetStreamConnectionStringResultInner object. + * + * @return the inner object. + */ + GetStreamConnectionStringResultInner innerModel(); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/IdentityTranslation.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/IdentityTranslation.java new file mode 100644 index 0000000000000..caa17046f595d --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/IdentityTranslation.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 { + /** + * The API flow will make use of the user identity that called this API flow, and pass that token through the + * boundary. + */ + public static final IdentityTranslation USER_IDENTITY = fromString("UserIdentity"); + + /** + * The API flow will make use of the Azure Data Transfer Flow managed identity on the other side of the boundary. + */ + 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/InternalMetadataProperties.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/InternalMetadataProperties.java new file mode 100644 index 0000000000000..d8facf08596d3 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/InternalMetadataProperties.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.BinaryData; +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. + */ +@Immutable +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. + */ + private InternalMetadataProperties() { + } + + /** + * Get the operationStatus property: Operation status associated with the last patch request. + * + * @return the operationStatus value. + */ + public OperationStatusProperties operationStatus() { + return this.operationStatus; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeFieldName(additionalProperty.getKey()); + if (additionalProperty.getValue() == null) { + jsonWriter.writeNull(); + } else { + additionalProperty.getValue().writeTo(jsonWriter); + } + } + } + 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.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); + } + } + deserializedInternalMetadataProperties.additionalProperties = additionalProperties; + + return deserializedInternalMetadataProperties; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/LinkStatus.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/LinkStatus.java new file mode 100644 index 0000000000000..bbe655bd3992f --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/LinkStatus.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 { + /** + * The pipeline, connection, or flow is currently linked with another corresponding pipeline, connection, or flow, + * and can be used. + */ + public static final LinkStatus LINKED = fromString("Linked"); + + /** + * The pipeline, connection, or flow is not linked with another corresponding pipeline, connection, or flow, and + * cannot be used. + */ + 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ListApprovedSchemasRequest.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ListApprovedSchemasRequest.java new file mode 100644 index 0000000000000..404d53c971d38 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ListApprovedSchemasRequest.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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. ListApprovedSchemaRequest has reached end of + * life support starting version 2025-05-30-preview. Please manage schemas with a FlowProfile resource instead. + */ +@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; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ListFlowProfilesRequest.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ListFlowProfilesRequest.java new file mode 100644 index 0000000000000..dbcef6e6e0c64 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ListFlowProfilesRequest.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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; + +/** + * Defines the required request body for retrieving FlowProfile information for a provided pipeline. + */ +@Fluent +public final class ListFlowProfilesRequest implements JsonSerializable { + /* + * The name of the pipeline for which to retrieve associated FlowProfiles. + */ + private String pipeline; + + /** + * Creates an instance of ListFlowProfilesRequest class. + */ + public ListFlowProfilesRequest() { + } + + /** + * Get the pipeline property: The name of the pipeline for which to retrieve associated FlowProfiles. + * + * @return the pipeline value. + */ + public String pipeline() { + return this.pipeline; + } + + /** + * Set the pipeline property: The name of the pipeline for which to retrieve associated FlowProfiles. + * + * @param pipeline the pipeline value to set. + * @return the ListFlowProfilesRequest object itself. + */ + public ListFlowProfilesRequest withPipeline(String pipeline) { + this.pipeline = pipeline; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("pipeline", this.pipeline); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListFlowProfilesRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListFlowProfilesRequest 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 ListFlowProfilesRequest. + */ + public static ListFlowProfilesRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListFlowProfilesRequest deserializedListFlowProfilesRequest = new ListFlowProfilesRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("pipeline".equals(fieldName)) { + deserializedListFlowProfilesRequest.pipeline = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListFlowProfilesRequest; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ListFlowsByPipelineConnection.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ListFlowsByPipelineConnection.java new file mode 100644 index 0000000000000..70ff016de0cb9 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ListFlowsByPipelineConnection.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.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. + */ +@Immutable +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. + */ + private ListFlowsByPipelineConnection() { + } + + /** + * Get the id property: ID of the connection. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the flows property: List of flows associated with the connection. + * + * @return the flows value. + */ + public List flows() { + return this.flows; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ListFlowsByPipelineResult.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ListFlowsByPipelineResult.java new file mode 100644 index 0000000000000..b7f4107a248bd --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ListFlowsByPipelineResult.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.resourcemanager.datatransfer.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.datatransfer.fluent.models.ListFlowsByPipelineResultInner object. + * + * @return the inner object. + */ + ListFlowsByPipelineResultInner innerModel(); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ListPipelineMetadataRequest.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ListPipelineMetadataRequest.java new file mode 100644 index 0000000000000..a8545be82390a --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ListPipelineMetadataRequest.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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; + +/** + * Defines the required request body for retrieving Pipeline metadata for a provided pipeline. + */ +@Fluent +public final class ListPipelineMetadataRequest implements JsonSerializable { + /* + * The name of the pipeline for which to retrieve associated metadata. + */ + private String pipeline; + + /** + * Creates an instance of ListPipelineMetadataRequest class. + */ + public ListPipelineMetadataRequest() { + } + + /** + * Get the pipeline property: The name of the pipeline for which to retrieve associated metadata. + * + * @return the pipeline value. + */ + public String pipeline() { + return this.pipeline; + } + + /** + * Set the pipeline property: The name of the pipeline for which to retrieve associated metadata. + * + * @param pipeline the pipeline value to set. + * @return the ListPipelineMetadataRequest object itself. + */ + public ListPipelineMetadataRequest withPipeline(String pipeline) { + this.pipeline = pipeline; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("pipeline", this.pipeline); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListPipelineMetadataRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListPipelineMetadataRequest 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 ListPipelineMetadataRequest. + */ + public static ListPipelineMetadataRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListPipelineMetadataRequest deserializedListPipelineMetadataRequest = new ListPipelineMetadataRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("pipeline".equals(fieldName)) { + deserializedListPipelineMetadataRequest.pipeline = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListPipelineMetadataRequest; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ListPipelineMetadataResult.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ListPipelineMetadataResult.java new file mode 100644 index 0000000000000..9120dd8dc932f --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ListPipelineMetadataResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.resourcemanager.datatransfer.fluent.models.ListPipelineMetadataResultInner; + +/** + * An immutable client-side representation of ListPipelineMetadataResult. + */ +public interface ListPipelineMetadataResult { + /** + * Gets the send property: Returns the settings associated with send direction of the pipeline. + * + * @return the send value. + */ + DirectionSettings send(); + + /** + * Gets the receive property: Returns the settings associated with receive direction of the pipeline. + * + * @return the receive value. + */ + DirectionSettings receive(); + + /** + * Gets the inner com.azure.resourcemanager.datatransfer.fluent.models.ListPipelineMetadataResultInner object. + * + * @return the inner object. + */ + ListPipelineMetadataResultInner innerModel(); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ManagedServiceIdentity.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ManagedServiceIdentity.java new file mode 100644 index 0000000000000..44b119ecb7df2 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ManagedServiceIdentity.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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; + +/** + * 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 String principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private String tenantId; + + /* + * The type of managed identity assigned to this resource. + */ + private ManagedServiceIdentityType type; + + /* + * The identities assigned to this resource by the user. + */ + 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 String 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 String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of managed identity assigned to this resource. + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of managed identity assigned to this resource. + * + * @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 identities assigned to this resource by the user. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * {@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.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId = reader.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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ManagedServiceIdentityType.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ManagedServiceIdentityType.java new file mode 100644 index 0000000000000..761a696eafd35 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ManagedServiceIdentityType.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 { + /** + * No managed identity. + */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** + * System assigned managed identity. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * User assigned managed identity. + */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * System and user assigned managed identity. + */ + 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/MatchType.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/MatchType.java new file mode 100644 index 0000000000000..4448bf5ad8918 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/MatchType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The text pattern matching conditions for text comparison. + */ +public final class MatchType extends ExpandableStringEnum { + /** + * The option to pattern match substrings within all text content. For example, "hello world" would be found in + * "chello worlds". + */ + public static final MatchType PARTIAL = fromString("Partial"); + + /** + * The option to pattern match the entire string explicitly. For example, "hello world" would NOT be found in + * "chello worlds". + */ + public static final MatchType COMPLETE = fromString("Complete"); + + /** + * Creates a new instance of MatchType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MatchType() { + } + + /** + * Creates or finds a MatchType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MatchType. + */ + public static MatchType fromString(String name) { + return fromString(name, MatchType.class); + } + + /** + * Gets known MatchType values. + * + * @return known MatchType values. + */ + public static Collection values() { + return values(MatchType.class); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/MessagingOptions.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/MessagingOptions.java new file mode 100644 index 0000000000000..685780d912e2c --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/MessagingOptions.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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; + + /* + * Field indicating whether to enable guaranteed delivery on the flow or not. The default disabled option chooses + * speed over consistency. When enabled, messages are delivered with minimal delay, but delivery is not guaranteed + * under all conditions + */ + private EnablementStatus performancePriority; + + /** + * 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; + } + + /** + * Get the performancePriority property: Field indicating whether to enable guaranteed delivery on the flow or not. + * The default disabled option chooses speed over consistency. When enabled, messages are delivered with minimal + * delay, but delivery is not guaranteed under all conditions. + * + * @return the performancePriority value. + */ + public EnablementStatus performancePriority() { + return this.performancePriority; + } + + /** + * Set the performancePriority property: Field indicating whether to enable guaranteed delivery on the flow or not. + * The default disabled option chooses speed over consistency. When enabled, messages are delivered with minimal + * delay, but delivery is not guaranteed under all conditions. + * + * @param performancePriority the performancePriority value to set. + * @return the MessagingOptions object itself. + */ + public MessagingOptions withPerformancePriority(EnablementStatus performancePriority) { + this.performancePriority = performancePriority; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("billingTier", this.billingTier == null ? null : this.billingTier.toString()); + jsonWriter.writeStringField("performancePriority", + this.performancePriority == null ? null : this.performancePriority.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 if ("performancePriority".equals(fieldName)) { + deserializedMessagingOptions.performancePriority = EnablementStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMessagingOptions; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/MimeFilterRuleset.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/MimeFilterRuleset.java new file mode 100644 index 0000000000000..04c556c5d9910 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/MimeFilterRuleset.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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; + +/** + * Rules for filtering files based on Media types (f.k.a MIME types). + */ +@Fluent +public final class MimeFilterRuleset implements JsonSerializable { + /* + * Specifies whether the filter is an allow list or deny list. For more detail, please refer to the FilterType + * model. + */ + private FilterType type; + + /* + * Defines the Media types (f.k.a MIME types) and associated file extensions to be filtered. For more detail, please + * refer to the MimeTypeFiler model. + */ + private List filters; + + /** + * Creates an instance of MimeFilterRuleset class. + */ + public MimeFilterRuleset() { + } + + /** + * Get the type property: Specifies whether the filter is an allow list or deny list. For more detail, please refer + * to the FilterType model. + * + * @return the type value. + */ + public FilterType type() { + return this.type; + } + + /** + * Set the type property: Specifies whether the filter is an allow list or deny list. For more detail, please refer + * to the FilterType model. + * + * @param type the type value to set. + * @return the MimeFilterRuleset object itself. + */ + public MimeFilterRuleset withType(FilterType type) { + this.type = type; + return this; + } + + /** + * Get the filters property: Defines the Media types (f.k.a MIME types) and associated file extensions to be + * filtered. For more detail, please refer to the MimeTypeFiler model. + * + * @return the filters value. + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters property: Defines the Media types (f.k.a MIME types) and associated file extensions to be + * filtered. For more detail, please refer to the MimeTypeFiler model. + * + * @param filters the filters value to set. + * @return the MimeFilterRuleset object itself. + */ + public MimeFilterRuleset withFilters(List filters) { + this.filters = filters; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeArrayField("filters", this.filters, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MimeFilterRuleset from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MimeFilterRuleset 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 MimeFilterRuleset. + */ + public static MimeFilterRuleset fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MimeFilterRuleset deserializedMimeFilterRuleset = new MimeFilterRuleset(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedMimeFilterRuleset.type = FilterType.fromString(reader.getString()); + } else if ("filters".equals(fieldName)) { + List filters = reader.readArray(reader1 -> MimeTypeFilter.fromJson(reader1)); + deserializedMimeFilterRuleset.filters = filters; + } else { + reader.skipChildren(); + } + } + + return deserializedMimeFilterRuleset; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/MimeTypeFilter.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/MimeTypeFilter.java new file mode 100644 index 0000000000000..40879f8e906d8 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/MimeTypeFilter.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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; + +/** + * Defines a list of Media types (f.k.a MIME Types) and associated file extensions subject to filtering. + */ +@Fluent +public final class MimeTypeFilter implements JsonSerializable { + /* + * The Media Types (f.k.a MIME types), following IANA standards (e.g., application/json, image/png). For a more + * detailed list of allowed media types please refer to the Tika documentation: + * https://github.com/apache/tika/blob/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml + */ + private String media; + + /* + * A list of file extensions associated with the specified Media type (e.g., .json, .png). To specify files with no + * extension, use an empty string ""." + */ + private List extensions; + + /** + * Creates an instance of MimeTypeFilter class. + */ + public MimeTypeFilter() { + } + + /** + * Get the media property: The Media Types (f.k.a MIME types), following IANA standards (e.g., application/json, + * image/png). For a more detailed list of allowed media types please refer to the Tika documentation: + * https://github.com/apache/tika/blob/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml. + * + * @return the media value. + */ + public String media() { + return this.media; + } + + /** + * Set the media property: The Media Types (f.k.a MIME types), following IANA standards (e.g., application/json, + * image/png). For a more detailed list of allowed media types please refer to the Tika documentation: + * https://github.com/apache/tika/blob/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml. + * + * @param media the media value to set. + * @return the MimeTypeFilter object itself. + */ + public MimeTypeFilter withMedia(String media) { + this.media = media; + return this; + } + + /** + * Get the extensions property: A list of file extensions associated with the specified Media type (e.g., .json, + * .png). To specify files with no extension, use an empty string "".". + * + * @return the extensions value. + */ + public List extensions() { + return this.extensions; + } + + /** + * Set the extensions property: A list of file extensions associated with the specified Media type (e.g., .json, + * .png). To specify files with no extension, use an empty string "".". + * + * @param extensions the extensions value to set. + * @return the MimeTypeFilter object itself. + */ + public MimeTypeFilter withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("media", this.media); + jsonWriter.writeArrayField("extensions", this.extensions, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MimeTypeFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MimeTypeFilter 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 MimeTypeFilter. + */ + public static MimeTypeFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MimeTypeFilter deserializedMimeTypeFilter = new MimeTypeFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("media".equals(fieldName)) { + deserializedMimeTypeFilter.media = reader.getString(); + } else if ("extensions".equals(fieldName)) { + List extensions = reader.readArray(reader1 -> reader1.getString()); + deserializedMimeTypeFilter.extensions = extensions; + } else { + reader.skipChildren(); + } + } + + return deserializedMimeTypeFilter; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Operation.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Operation.java new file mode 100644 index 0000000000000..76cc72462dd4a --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Operation.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.resourcemanager.datatransfer.fluent.models.OperationInner; + +/** + * An immutable client-side representation of Operation. + */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.datatransfer.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/OperationDisplay.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/OperationDisplay.java new file mode 100644 index 0000000000000..744dc8e94a48f --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Localized display information for an operation. + */ +@Immutable +public final class OperationDisplay implements JsonSerializable { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". + */ + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". + */ + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + */ + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + private OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/OperationStatusEnum.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/OperationStatusEnum.java new file mode 100644 index 0000000000000..082efdefbfe60 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/OperationStatusEnum.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 { + /** + * The last patch request for this connection completed with an error. + */ + public static final OperationStatusEnum FAILED = fromString("Failed"); + + /** + * The last patch request for this connection completed. + */ + 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/OperationStatusProperties.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/OperationStatusProperties.java new file mode 100644 index 0000000000000..88d5adcb07b38 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/OperationStatusProperties.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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. + */ + private 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; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Operations.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Operations.java new file mode 100644 index 0000000000000..5dbdaf4a4610f --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Operations.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Origin.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Origin.java new file mode 100644 index 0000000000000..22f4823003e93 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Origin.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Indicates the operation is initiated by a user. + */ + public static final Origin USER = fromString("user"); + + /** + * Indicates the operation is initiated by a system. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Indicates the operation is initiated by a user or system. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/PendingConnection.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/PendingConnection.java new file mode 100644 index 0000000000000..6d242d109033d --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/PendingConnection.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.datatransfer.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 subscriptionId property: Subscription ID of the pending connection. + * + * @return the subscriptionId value. + */ + String subscriptionId(); + + /** + * 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. This FlowType property has + * reached end of life support starting version 2025-05-30-preview. Please create a FlowProfile resource instead. + * + * @return the flowTypes value. + */ + List flowTypes(); + + /** + * Gets the flowProfileList property: Provides a list of FlowProfiles . + * + * @return the flowProfileList value. + */ + List flowProfileList(); + + /** + * 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. The policies property has reached end of life + * support starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @return the policies value. + */ + List policies(); + + /** + * Gets the schemas property: The schemas for this connection. The schemas property has reached end of life support + * starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @return the schemas value. + */ + List schemas(); + + /** + * Gets the schemaUris property: The schema URIs for this connection. The schemaUris property has reached end of + * life support starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @return the schemaUris value. + */ + List schemaUris(); + + /** + * Gets the apiHostname property: Hostname specific to API Flows. + * + * @return the apiHostname value. + */ + String apiHostname(); + + /** + * 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 inner com.azure.resourcemanager.datatransfer.fluent.models.PendingConnectionInner object. + * + * @return the inner object. + */ + PendingConnectionInner innerModel(); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/PendingFlow.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/PendingFlow.java new file mode 100644 index 0000000000000..0dc12e02f635f --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/PendingFlow.java @@ -0,0 +1,301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.datatransfer.fluent.models.PendingFlowInner; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of PendingFlow. + */ +public interface PendingFlow { + /** + * 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 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: URI to a Key Vault Secret containing a 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 flowProfile property: Type of FlowProfile to use for transfer via the flow. + * + * @return the flowProfile value. + */ + FlowProfileMetadata flowProfile(); + + /** + * Gets the flowDataType property: The Flow's data class. + * + * @return the flowDataType value. + */ + DataClass flowDataType(); + + /** + * Gets the flowType property: The flow type for this flow. The property has reached end of life support starting + * version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @return the flowType value. + */ + FlowType flowType(); + + /** + * Gets the dataType property: Type of data to transfer via the flow. The property has reached end of life support + * starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @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. The property has reached end of life support starting + * version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @return the policies value. + */ + List policies(); + + /** + * Gets the schema property: The selected schema for this flow. The property has reached end of life support + * starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @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 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 inner com.azure.resourcemanager.datatransfer.fluent.models.PendingFlowInner object. + * + * @return the inner object. + */ + PendingFlowInner innerModel(); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Pipeline.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Pipeline.java new file mode 100644 index 0000000000000..db64e0871166f --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Pipeline.java @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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.datatransfer.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: The set of configurable properties for the Pipeline resource. + * + * @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.datatransfer.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: The set of configurable properties for the Pipeline resource.. + * + * @param properties The set of configurable properties for the Pipeline resource. + * @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: The set of configurable properties for the Pipeline resource.. + * + * @param properties The set of configurable properties for the Pipeline resource. + * @return the next definition stage. + */ + Update withProperties(PipelineProperties 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 a pending connection request associated with the specified Pipeline. + * + * @param connection The request body containing the connection to approve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 connection); + + /** + * Approves a pending connection request associated with the specified Pipeline. + * + * @param connection The request body containing the connection to approve. + * @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 connection, Context context); + + /** + * Executes a privileged or administrative action on the specified Pipeline. + * + * @param action The action to be executed on the Pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 action); + + /** + * Executes a privileged or administrative action on the specified Pipeline. + * + * @param action The action to be executed on the Pipeline. + * @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 action, Context context); + + /** + * Lists all Flows associated with the specified Pipeline. + * + * @param connections A list of connection identifiers used to filter the Flows to be retrieved. + * @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 all Flows associated with the specified 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 associated with a specific connection in the Pipeline. This operation has reached end of life + * support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile resource. + * + * @param schema The schema(s) to retrieve for the specified 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 schemas list result along with {@link Response}. + */ + Response listSchemasListWithResponse(Schema schema, Context context); + + /** + * Lists the schemas associated with a specific connection in the Pipeline. This operation has reached end of life + * support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile resource. + * + * @param schema The schema(s) to retrieve for the specified connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 schema); + + /** + * Rejects a pending connection request associated with the specified Pipeline. + * + * @param connection The request body containing the connection to reject. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 connection); + + /** + * Rejects a pending connection request associated with the specified Pipeline. + * + * @param connection The request body containing the connection to reject. + * @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 connection, Context context); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/PipelineConnectionProperties.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/PipelineConnectionProperties.java new file mode 100644 index 0000000000000..9e00d7697498e --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/PipelineConnectionProperties.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.BinaryData; +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. + */ +@Immutable +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. + */ + private PipelineConnectionProperties() { + } + + /** + * Get the internalMetadata property: Internal metadata of the connection inside pipeline. + * + * @return the internalMetadata value. + */ + public InternalMetadataProperties internalMetadata() { + return this.internalMetadata; + } + + /** + * Get the additionalProperties property: Connection properties inside pipeline. + * + * @return the additionalProperties value. + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeFieldName(additionalProperty.getKey()); + if (additionalProperty.getValue() == null) { + jsonWriter.writeNull(); + } else { + additionalProperty.getValue().writeTo(jsonWriter); + } + } + } + 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.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); + } + } + deserializedPipelineConnectionProperties.additionalProperties = additionalProperties; + + return deserializedPipelineConnectionProperties; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/PipelineProperties.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/PipelineProperties.java new file mode 100644 index 0000000000000..955aeda1aa63f --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/PipelineProperties.java @@ -0,0 +1,389 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 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. The policies property has reached end of life support starting version + * 2025-05-30-preview. Please create and use a FlowProfile resource instead. + */ + private List policies; + + /* + * The flow type for this flow. The flowTypes property has reached end of life support starting version + * 2025-05-30-preview. Please create and use a FlowProfile resource instead. + */ + private List flowTypes; + + /* + * The flow types that are disabled for this pipeline + */ + private List disabledFlowTypes; + + /* + * The DataClasses that are disabled for this pipeline + */ + private List disabledDataClass; + + /* + * 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. The policies property has reached end of life support + * starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @return the policies value. + */ + public List policies() { + return this.policies; + } + + /** + * Set the policies property: The policies for this pipeline. The policies property has reached end of life support + * starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @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 type for this flow. The flowTypes property has reached end of life support + * starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @return the flowTypes value. + */ + public List flowTypes() { + return this.flowTypes; + } + + /** + * Set the flowTypes property: The flow type for this flow. The flowTypes property has reached end of life support + * starting version 2025-05-30-preview. Please create and use a FlowProfile resource instead. + * + * @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 disabledDataClass property: The DataClasses that are disabled for this pipeline. + * + * @return the disabledDataClass value. + */ + public List disabledDataClass() { + return this.disabledDataClass; + } + + /** + * Set the disabledDataClass property: The DataClasses that are disabled for this pipeline. + * + * @param disabledDataClass the disabledDataClass value to set. + * @return the PipelineProperties object itself. + */ + public PipelineProperties withDisabledDataClass(List disabledDataClass) { + this.disabledDataClass = disabledDataClass; + 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; + } + + /** + * {@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.writeArrayField("disabledDataClass", this.disabledDataClass, + (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 -> ReadPipelineConnection.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 ("disabledDataClass".equals(fieldName)) { + List disabledDataClass + = reader.readArray(reader1 -> DataClass.fromString(reader1.getString())); + deserializedPipelineProperties.disabledDataClass = disabledDataClass; + } 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/PipelineStatus.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/PipelineStatus.java new file mode 100644 index 0000000000000..cd001ddfe4751 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/PipelineStatus.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status of the current pipeline. + */ +public final class PipelineStatus extends ExpandableStringEnum { + /** + * The pipeline is currently enabled and all child connection and flow resources below able to send or receive data. + */ + public static final PipelineStatus ENABLED = fromString("Enabled"); + + /** + * The pipeline is currently disabled and all child connection and flow resources below are unable to send or + * receive data. + */ + 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Pipelines.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Pipelines.java new file mode 100644 index 0000000000000..aa6dcdddf6b70 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Pipelines.java @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 { + /** + * Retrieves the specified Pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String pipelineName, Context context); + + /** + * Retrieves the specified Pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 getByResourceGroup(String resourceGroupName, String pipelineName); + + /** + * Applies partial updates to an existing Pipeline resource. This operation supports patch semantics and returns the + * updated Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the updated Pipeline properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void update(String resourceGroupName, String pipelineName, PipelinesPatch pipeline); + + /** + * Applies partial updates to an existing Pipeline resource. This operation supports patch semantics and returns the + * updated Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param pipeline The request body containing the updated Pipeline properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void update(String resourceGroupName, String pipelineName, PipelinesPatch pipeline, Context context); + + /** + * Deletes the specified Pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 specified Pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @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); + + /** + * Lists all Pipeline resources within the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all Pipeline resources within the specified resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all Pipeline resources within the current subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listBySubscription(); + + /** + * Lists all Pipeline resources within the current subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listBySubscription(Context context); + + /** + * Approves a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to approve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 connection); + + /** + * Approves a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to approve. + * @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 connection, + Context context); + + /** + * Executes a privileged or administrative action on the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param action The action to be executed on the Pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 action); + + /** + * Executes a privileged or administrative action on the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param action The action to be executed on the Pipeline. + * @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 action, Context context); + + /** + * Lists all Flows associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connections A list of connection identifiers used to filter the Flows to be retrieved. + * @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 all Flows associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 associated with a specific connection in the Pipeline. This operation has reached end of life + * support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param schema The schema(s) to retrieve for the specified 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 schemas list result along with {@link Response}. + */ + Response listSchemasListWithResponse(String resourceGroupName, String pipelineName, + Schema schema, Context context); + + /** + * Lists the schemas associated with a specific connection in the Pipeline. This operation has reached end of life + * support starting version 2025-05-30-preview. For schema support please create and use a FlowProfile resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param schema The schema(s) to retrieve for the specified connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 schema); + + /** + * Rejects a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to reject. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 connection); + + /** + * Rejects a pending connection request associated with the specified Pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name of the pipeline on which to operate. + * @param connection The request body containing the connection to reject. + * @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 connection, + Context context); + + /** + * Retrieves the specified 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 the pipeline resource definition along with {@link Response}. + */ + Pipeline getById(String id); + + /** + * Retrieves the specified 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 the pipeline resource definition along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified 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 specified 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/PipelinesPatch.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/PipelinesPatch.java new file mode 100644 index 0000000000000..3e058b08b4f52 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/PipelinesPatch.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/PipelinesPatchProperties.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/PipelinesPatchProperties.java new file mode 100644 index 0000000000000..a38b950b6febe --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/PipelinesPatchProperties.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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. The property has reached end of life support starting version 2025-05-30-preview. + * Please create and use the FlowProfile resource instead. + */ +@Fluent +public final class PipelinesPatchProperties implements JsonSerializable { + /* + * The flow types allowed for this pipeline. FlowTypes has reached end of life support starting version + * 2025-05-30-preview. Please create and use the FlowProfile property instead. + */ + private List flowTypes; + + /** + * Creates an instance of PipelinesPatchProperties class. + */ + public PipelinesPatchProperties() { + } + + /** + * Get the flowTypes property: The flow types allowed for this pipeline. FlowTypes has reached end of life support + * starting version 2025-05-30-preview. Please create and use the FlowProfile property instead. + * + * @return the flowTypes value. + */ + public List flowTypes() { + return this.flowTypes; + } + + /** + * Set the flowTypes property: The flow types allowed for this pipeline. FlowTypes has reached end of life support + * starting version 2025-05-30-preview. Please create and use the FlowProfile property instead. + * + * @param flowTypes the flowTypes value to set. + * @return the PipelinesPatchProperties object itself. + */ + public PipelinesPatchProperties withFlowTypes(List flowTypes) { + this.flowTypes = flowTypes; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + 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 ("flowTypes".equals(fieldName)) { + List flowTypes = reader.readArray(reader1 -> FlowType.fromString(reader1.getString())); + deserializedPipelinesPatchProperties.flowTypes = flowTypes; + } else { + reader.skipChildren(); + } + } + + return deserializedPipelinesPatchProperties; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Plan.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Plan.java new file mode 100644 index 0000000000000..66f16c7b74c80 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Plan.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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; + +/** + * 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; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ProvisioningState.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ProvisioningState.java new file mode 100644 index 0000000000000..c4f2e2af43d6b --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ProvisioningState.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of the pipeline, connection, flow. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Resource has been created. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Resource creation failed. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Resource creation was canceled. + */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Resource has been accepted for creation. + */ + 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ReadPipelineConnection.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ReadPipelineConnection.java new file mode 100644 index 0000000000000..a66862b7bf534 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ReadPipelineConnection.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SystemData; +import com.azure.core.util.BinaryData; +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; + +/** + * The ReadPipelineconnection. + */ +@Immutable +public final class ReadPipelineConnection 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; + + /* + * The ReadPipelineconnection. + */ + private Map additionalProperties; + + /** + * Creates an instance of ReadPipelineConnection class. + */ + private ReadPipelineConnection() { + } + + /** + * Get the id property: Connection id inside pipeline. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * 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; + } + + /** + * Get the additionalProperties property: The ReadPipelineconnection. + * + * @return the additionalProperties value. + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeStringField("etag", this.etag); + jsonWriter.writeJsonField("systemData", this.systemData); + jsonWriter.writeJsonField("properties", this.properties); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeFieldName(additionalProperty.getKey()); + if (additionalProperty.getValue() == null) { + jsonWriter.writeNull(); + } else { + additionalProperty.getValue().writeTo(jsonWriter); + } + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReadPipelineConnection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReadPipelineConnection 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 ReadPipelineConnection. + */ + public static ReadPipelineConnection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReadPipelineConnection deserializedReadPipelineConnection = new ReadPipelineConnection(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedReadPipelineConnection.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedReadPipelineConnection.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedReadPipelineConnection.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedReadPipelineConnection.location = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedReadPipelineConnection.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedReadPipelineConnection.systemData = SystemData.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedReadPipelineConnection.properties = PipelineConnectionProperties.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, + reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); + } + } + deserializedReadPipelineConnection.additionalProperties = additionalProperties; + + return deserializedReadPipelineConnection; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/RemoteEndpointSettings.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/RemoteEndpointSettings.java new file mode 100644 index 0000000000000..1fd7d79186b4c --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/RemoteEndpointSettings.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 to configure the destination remote endpoint for API calls. + */ +@Fluent +public final class RemoteEndpointSettings implements JsonSerializable { + /* + * The remote endpoint uri all API calls. + */ + private String endpoint; + + /* + * Optional and for advanced used only. A list of authentication methods to use when accessing the remote endpoint. + * If not provided, the default S2S authentication using Entra (API Flow Managed Identity) and RBAC will be applied. + */ + private List authentication; + + /** + * Creates an instance of RemoteEndpointSettings class. + */ + public RemoteEndpointSettings() { + } + + /** + * Get the endpoint property: The remote endpoint uri all API calls. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint property: The remote endpoint uri all API calls. + * + * @param endpoint the endpoint value to set. + * @return the RemoteEndpointSettings object itself. + */ + public RemoteEndpointSettings withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Get the authentication property: Optional and for advanced used only. A list of authentication methods to use + * when accessing the remote endpoint. If not provided, the default S2S authentication using Entra (API Flow Managed + * Identity) and RBAC will be applied. + * + * @return the authentication value. + */ + public List authentication() { + return this.authentication; + } + + /** + * Set the authentication property: Optional and for advanced used only. A list of authentication methods to use + * when accessing the remote endpoint. If not provided, the default S2S authentication using Entra (API Flow Managed + * Identity) and RBAC will be applied. + * + * @param authentication the authentication value to set. + * @return the RemoteEndpointSettings object itself. + */ + public RemoteEndpointSettings withAuthentication(List authentication) { + this.authentication = authentication; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("endpoint", this.endpoint); + jsonWriter.writeArrayField("authentication", this.authentication, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RemoteEndpointSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RemoteEndpointSettings 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 RemoteEndpointSettings. + */ + public static RemoteEndpointSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RemoteEndpointSettings deserializedRemoteEndpointSettings = new RemoteEndpointSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endpoint".equals(fieldName)) { + deserializedRemoteEndpointSettings.endpoint = reader.getString(); + } else if ("authentication".equals(fieldName)) { + List authentication = reader.readArray(reader1 -> Authentication.fromJson(reader1)); + deserializedRemoteEndpointSettings.authentication = authentication; + } else { + reader.skipChildren(); + } + } + + return deserializedRemoteEndpointSettings; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ResourceBody.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ResourceBody.java new file mode 100644 index 0000000000000..870663168fa0c --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ResourceBody.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 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; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Schema.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Schema.java new file mode 100644 index 0000000000000..e28c0a881ab64 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Schema.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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. Schemas has reached end of life support starting version 2025-05-30-preview. Please manage schemas + * with a FlowProfile resource instead. + */ +@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; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SchemaStatus.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SchemaStatus.java new file mode 100644 index 0000000000000..89b92f67449b1 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SchemaStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status of the schema. + */ +public final class SchemaStatus extends ExpandableStringEnum { + /** + * A schema that has not been approved and is awaiting review. + */ + public static final SchemaStatus NEW = fromString("New"); + + /** + * A schema that has been approved and is ready for use. + */ + 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SchemaType.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SchemaType.java new file mode 100644 index 0000000000000..1a69bebd585c1 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SchemaType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The Schema Type. + */ +public final class SchemaType extends ExpandableStringEnum { + /** + * The schema represents a single XML schema definition file. + */ + public static final SchemaType XSD = fromString("Xsd"); + + /** + * The schema represents a ZIP file with multiple XML schema definition files within it. + */ + 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SchemasListResult.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SchemasListResult.java new file mode 100644 index 0000000000000..9546d15cc456e --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SchemasListResult.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.resourcemanager.datatransfer.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.datatransfer.fluent.models.SchemasListResultInner object. + * + * @return the inner object. + */ + SchemasListResultInner innerModel(); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SelectedResource.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SelectedResource.java new file mode 100644 index 0000000000000..f16eee5af5594 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SelectedResource.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A 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; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SetDestinationEndpointPorts.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SetDestinationEndpointPorts.java new file mode 100644 index 0000000000000..31325fa2bee98 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SetDestinationEndpointPorts.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 flow. + */ +@Fluent +public final class SetDestinationEndpointPorts implements JsonSerializable { + /* + * The specified flow destination endpoint ports + */ + private List ports; + + /** + * Creates an instance of SetDestinationEndpointPorts class. + */ + public SetDestinationEndpointPorts() { + } + + /** + * Get the ports property: The specified flow destination endpoint ports. + * + * @return the ports value. + */ + public List ports() { + return this.ports; + } + + /** + * Set the ports property: The specified flow 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; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SetDestinationEndpoints.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SetDestinationEndpoints.java new file mode 100644 index 0000000000000..83fc471f343bf --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SetDestinationEndpoints.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 flow. + */ +@Fluent +public final class SetDestinationEndpoints implements JsonSerializable { + /* + * The specified flow destination endpoints. + */ + private List endpoints; + + /** + * Creates an instance of SetDestinationEndpoints class. + */ + public SetDestinationEndpoints() { + } + + /** + * Get the endpoints property: The specified flow destination endpoints. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: The specified flow destination endpoints. + * + * @param endpoints the endpoints value to set. + * @return the SetDestinationEndpoints object itself. + */ + public SetDestinationEndpoints withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SetSourceAddresses.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SetSourceAddresses.java new file mode 100644 index 0000000000000..9fc9041de3420 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SetSourceAddresses.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 flow. + */ +@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; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SetStreamPassphrase.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SetStreamPassphrase.java new file mode 100644 index 0000000000000..4dcf655a7c56e --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/SetStreamPassphrase.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/StreamProtocol.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/StreamProtocol.java new file mode 100644 index 0000000000000..4a1eaa4a579a5 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/StreamProtocol.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The protocol of the stream. + */ +public final class StreamProtocol extends ExpandableStringEnum { + /** + * This Flow is using User Datagram Protocol for the video stream. + */ + public static final StreamProtocol UDP = fromString("UDP"); + + /** + * This Flow is using Secure Reliable Transfer for the video stream. + */ + public static final StreamProtocol SRT = fromString("SRT"); + + /** + * This Flow is using Real-time Transport Protocol for the video stream. + */ + 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/StreamSourceAddresses.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/StreamSourceAddresses.java new file mode 100644 index 0000000000000..34bda057b510a --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/StreamSourceAddresses.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.resourcemanager.datatransfer.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.datatransfer.fluent.models.StreamSourceAddressesInner object. + * + * @return the inner object. + */ + StreamSourceAddressesInner innerModel(); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Subscriber.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Subscriber.java new file mode 100644 index 0000000000000..8820649d8c7f6 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/Subscriber.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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; + } + + /** + * {@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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/TargetType.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/TargetType.java new file mode 100644 index 0000000000000..65eedd03763d6 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/TargetType.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 { + /** + * The action executing is targeting a pipeline. + */ + public static final TargetType PIPELINE = fromString("Pipeline"); + + /** + * The action executing is targeting a connection. + */ + public static final TargetType CONNECTION = fromString("Connection"); + + /** + * The action executing is targeting a flow type. + */ + public static final TargetType FLOW_TYPE = fromString("FlowType"); + + /** + * The action executing is targeting a flow profile. + */ + public static final TargetType FLOW_PROFILE = fromString("FlowProfile"); + + /** + * 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/TextMatchingRuleset.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/TextMatchingRuleset.java new file mode 100644 index 0000000000000..64d434abec112 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/TextMatchingRuleset.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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; + +/** + * Rules for detecting and blocking specific text patterns. If a file contains a text pattern that is part of the + * configured deny list, the file will be denied. + */ +@Fluent +public final class TextMatchingRuleset implements JsonSerializable { + /* + * A list of text patterns to block, each with matching rules and case sensitivity options. + */ + private List deny; + + /** + * Creates an instance of TextMatchingRuleset class. + */ + public TextMatchingRuleset() { + } + + /** + * Get the deny property: A list of text patterns to block, each with matching rules and case sensitivity options. + * + * @return the deny value. + */ + public List deny() { + return this.deny; + } + + /** + * Set the deny property: A list of text patterns to block, each with matching rules and case sensitivity options. + * + * @param deny the deny value to set. + * @return the TextMatchingRuleset object itself. + */ + public TextMatchingRuleset withDeny(List deny) { + this.deny = deny; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("deny", this.deny, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextMatchingRuleset from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextMatchingRuleset 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 TextMatchingRuleset. + */ + public static TextMatchingRuleset fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextMatchingRuleset deserializedTextMatchingRuleset = new TextMatchingRuleset(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deny".equals(fieldName)) { + List deny + = reader.readArray(reader1 -> TextMatchingRulesetDeny.fromJson(reader1)); + deserializedTextMatchingRuleset.deny = deny; + } else { + reader.skipChildren(); + } + } + + return deserializedTextMatchingRuleset; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/TextMatchingRulesetDeny.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/TextMatchingRulesetDeny.java new file mode 100644 index 0000000000000..433bf4e157efa --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/TextMatchingRulesetDeny.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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 TextMatchingRulesetDeny model. + */ +@Fluent +public final class TextMatchingRulesetDeny implements JsonSerializable { + /* + * The word or phrase to match against replicated content. A phrase with spaces will be considered a single + * substring. + */ + private String text; + + /* + * Specifies the text matching condition for text comparison. For more detail please refer to the MatchType model. + */ + private MatchType matchType; + + /* + * Specifies the text matching conditions based on casing. For more detail please refer to the Casing model. + */ + private Casing caseSensitivity; + + /** + * Creates an instance of TextMatchingRulesetDeny class. + */ + public TextMatchingRulesetDeny() { + } + + /** + * Get the text property: The word or phrase to match against replicated content. A phrase with spaces will be + * considered a single substring. + * + * @return the text value. + */ + public String text() { + return this.text; + } + + /** + * Set the text property: The word or phrase to match against replicated content. A phrase with spaces will be + * considered a single substring. + * + * @param text the text value to set. + * @return the TextMatchingRulesetDeny object itself. + */ + public TextMatchingRulesetDeny withText(String text) { + this.text = text; + return this; + } + + /** + * Get the matchType property: Specifies the text matching condition for text comparison. For more detail please + * refer to the MatchType model. + * + * @return the matchType value. + */ + public MatchType matchType() { + return this.matchType; + } + + /** + * Set the matchType property: Specifies the text matching condition for text comparison. For more detail please + * refer to the MatchType model. + * + * @param matchType the matchType value to set. + * @return the TextMatchingRulesetDeny object itself. + */ + public TextMatchingRulesetDeny withMatchType(MatchType matchType) { + this.matchType = matchType; + return this; + } + + /** + * Get the caseSensitivity property: Specifies the text matching conditions based on casing. For more detail please + * refer to the Casing model. + * + * @return the caseSensitivity value. + */ + public Casing caseSensitivity() { + return this.caseSensitivity; + } + + /** + * Set the caseSensitivity property: Specifies the text matching conditions based on casing. For more detail please + * refer to the Casing model. + * + * @param caseSensitivity the caseSensitivity value to set. + * @return the TextMatchingRulesetDeny object itself. + */ + public TextMatchingRulesetDeny withCaseSensitivity(Casing caseSensitivity) { + this.caseSensitivity = caseSensitivity; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("text", this.text); + jsonWriter.writeStringField("matchType", this.matchType == null ? null : this.matchType.toString()); + jsonWriter.writeStringField("caseSensitivity", + this.caseSensitivity == null ? null : this.caseSensitivity.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TextMatchingRulesetDeny from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextMatchingRulesetDeny 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 TextMatchingRulesetDeny. + */ + public static TextMatchingRulesetDeny fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TextMatchingRulesetDeny deserializedTextMatchingRulesetDeny = new TextMatchingRulesetDeny(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("text".equals(fieldName)) { + deserializedTextMatchingRulesetDeny.text = reader.getString(); + } else if ("matchType".equals(fieldName)) { + deserializedTextMatchingRulesetDeny.matchType = MatchType.fromString(reader.getString()); + } else if ("caseSensitivity".equals(fieldName)) { + deserializedTextMatchingRulesetDeny.caseSensitivity = Casing.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedTextMatchingRulesetDeny; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/UserAssignedIdentity.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/UserAssignedIdentity.java new file mode 100644 index 0000000000000..13b19d2ec6aa2 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/UserAssignedIdentity.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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; + +/** + * User assigned identity properties. + */ +@Immutable +public final class UserAssignedIdentity implements JsonSerializable { + /* + * The principal ID of the assigned identity. + */ + private String principalId; + + /* + * The client ID of the assigned identity. + */ + private String 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 String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * {@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.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ValidateSchemaResult.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ValidateSchemaResult.java new file mode 100644 index 0000000000000..f8c3df8744bfe --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ValidateSchemaResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.resourcemanager.datatransfer.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.datatransfer.fluent.models.ValidateSchemaResultInner object. + * + * @return the inner object. + */ + ValidateSchemaResultInner innerModel(); +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ValidateSchemaStatus.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ValidateSchemaStatus.java new file mode 100644 index 0000000000000..8ca922d817ee8 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/ValidateSchemaStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Validation status of the schema. + */ +public final class ValidateSchemaStatus extends ExpandableStringEnum { + /** + * Validation of the schema was successful. + */ + public static final ValidateSchemaStatus SUCCEEDED = fromString("Succeeded"); + + /** + * The schema failed validation, whether due to error or an invalid schema. + */ + 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/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/XmlFilterRuleset.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/XmlFilterRuleset.java new file mode 100644 index 0000000000000..bc64e6ea70a5a --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/XmlFilterRuleset.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.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; + +/** + * Rules for filtering XML content using XSD schemas. + */ +@Fluent +public final class XmlFilterRuleset implements JsonSerializable { + /* + * The default XML namespace used for schema validation. + */ + private String defaultNamespace; + + /* + * Defines the method for referencing the xml schema. + */ + private XmlReferenceType reference; + + /* + * The inline XSD schema to be used for validation. + */ + private String schema; + + /** + * Creates an instance of XmlFilterRuleset class. + */ + public XmlFilterRuleset() { + } + + /** + * Get the defaultNamespace property: The default XML namespace used for schema validation. + * + * @return the defaultNamespace value. + */ + public String defaultNamespace() { + return this.defaultNamespace; + } + + /** + * Set the defaultNamespace property: The default XML namespace used for schema validation. + * + * @param defaultNamespace the defaultNamespace value to set. + * @return the XmlFilterRuleset object itself. + */ + public XmlFilterRuleset withDefaultNamespace(String defaultNamespace) { + this.defaultNamespace = defaultNamespace; + return this; + } + + /** + * Get the reference property: Defines the method for referencing the xml schema. + * + * @return the reference value. + */ + public XmlReferenceType reference() { + return this.reference; + } + + /** + * Set the reference property: Defines the method for referencing the xml schema. + * + * @param reference the reference value to set. + * @return the XmlFilterRuleset object itself. + */ + public XmlFilterRuleset withReference(XmlReferenceType reference) { + this.reference = reference; + return this; + } + + /** + * Get the schema property: The inline XSD schema to be used for validation. + * + * @return the schema value. + */ + public String schema() { + return this.schema; + } + + /** + * Set the schema property: The inline XSD schema to be used for validation. + * + * @param schema the schema value to set. + * @return the XmlFilterRuleset object itself. + */ + public XmlFilterRuleset withSchema(String schema) { + this.schema = schema; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("defaultNamespace", this.defaultNamespace); + jsonWriter.writeStringField("reference", this.reference == null ? null : this.reference.toString()); + jsonWriter.writeStringField("schema", this.schema); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of XmlFilterRuleset from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of XmlFilterRuleset 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 XmlFilterRuleset. + */ + public static XmlFilterRuleset fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + XmlFilterRuleset deserializedXmlFilterRuleset = new XmlFilterRuleset(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("defaultNamespace".equals(fieldName)) { + deserializedXmlFilterRuleset.defaultNamespace = reader.getString(); + } else if ("reference".equals(fieldName)) { + deserializedXmlFilterRuleset.reference = XmlReferenceType.fromString(reader.getString()); + } else if ("schema".equals(fieldName)) { + deserializedXmlFilterRuleset.schema = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedXmlFilterRuleset; + }); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/XmlReferenceType.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/XmlReferenceType.java new file mode 100644 index 0000000000000..4f6edfb54190d --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/XmlReferenceType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies how to reference the XML for processing. + */ +public final class XmlReferenceType extends ExpandableStringEnum { + /** + * Defines a referencing procedure where the xml schema will be provided inline. + */ + public static final XmlReferenceType INLINE = fromString("Inline"); + + /** + * Creates a new instance of XmlReferenceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public XmlReferenceType() { + } + + /** + * Creates or finds a XmlReferenceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding XmlReferenceType. + */ + public static XmlReferenceType fromString(String name) { + return fromString(name, XmlReferenceType.class); + } + + /** + * Gets known XmlReferenceType values. + * + * @return known XmlReferenceType values. + */ + public static Collection values() { + return values(XmlReferenceType.class); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/package-info.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/package-info.java new file mode 100644 index 0000000000000..332a32d0084e1 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/models/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the data models for DataTransfer. + */ +package com.azure.resourcemanager.datatransfer.models; diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/package-info.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/package-info.java new file mode 100644 index 0000000000000..5cfac9531566f --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/com/azure/resourcemanager/datatransfer/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the classes for DataTransfer. + */ +package com.azure.resourcemanager.datatransfer; diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/module-info.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/module-info.java new file mode 100644 index 0000000000000..7b8ced77615fe --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/java/module-info.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +module com.azure.resourcemanager.datatransfer { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.datatransfer; + exports com.azure.resourcemanager.datatransfer.fluent; + exports com.azure.resourcemanager.datatransfer.fluent.models; + exports com.azure.resourcemanager.datatransfer.models; + + opens com.azure.resourcemanager.datatransfer.fluent.models to com.azure.core; + opens com.azure.resourcemanager.datatransfer.models to com.azure.core; + opens com.azure.resourcemanager.datatransfer.implementation.models to com.azure.core; +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/resources/META-INF/azure-resourcemanager-datatransfer_metadata.json b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/resources/META-INF/azure-resourcemanager-datatransfer_metadata.json new file mode 100644 index 0000000000000..60a827e33a770 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/resources/META-INF/azure-resourcemanager-datatransfer_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.AzureDataTransfer":"2026-02-06-preview"},"crossLanguagePackageId":"Microsoft.AzureDataTransfer","crossLanguageVersion":"011d300cbd38","crossLanguageDefinitions":{"com.azure.resourcemanager.datatransfer.fluent.AzureDataTransfersClient":"Microsoft.AzureDataTransfer.AzureDataTransfer","com.azure.resourcemanager.datatransfer.fluent.AzureDataTransfersClient.listApprovedSchemas":"Microsoft.AzureDataTransfer.AzureDataTransfer.listApprovedSchemas","com.azure.resourcemanager.datatransfer.fluent.AzureDataTransfersClient.listApprovedSchemasWithResponse":"Microsoft.AzureDataTransfer.AzureDataTransfer.listApprovedSchemas","com.azure.resourcemanager.datatransfer.fluent.AzureDataTransfersClient.listFlowProfiles":"Microsoft.AzureDataTransfer.AzureDataTransfer.listFlowProfiles","com.azure.resourcemanager.datatransfer.fluent.AzureDataTransfersClient.listFlowProfilesWithResponse":"Microsoft.AzureDataTransfer.AzureDataTransfer.listFlowProfiles","com.azure.resourcemanager.datatransfer.fluent.AzureDataTransfersClient.listPipelineMetadata":"Microsoft.AzureDataTransfer.AzureDataTransfer.listPipelineMetadata","com.azure.resourcemanager.datatransfer.fluent.AzureDataTransfersClient.listPipelineMetadataWithResponse":"Microsoft.AzureDataTransfer.AzureDataTransfer.listPipelineMetadata","com.azure.resourcemanager.datatransfer.fluent.AzureDataTransfersClient.validateSchema":"Microsoft.AzureDataTransfer.AzureDataTransfer.validateSchema","com.azure.resourcemanager.datatransfer.fluent.AzureDataTransfersClient.validateSchemaWithResponse":"Microsoft.AzureDataTransfer.AzureDataTransfer.validateSchema","com.azure.resourcemanager.datatransfer.fluent.ConnectionsClient":"Microsoft.AzureDataTransfer.Connections","com.azure.resourcemanager.datatransfer.fluent.ConnectionsClient.beginCreateOrUpdate":"Microsoft.AzureDataTransfer.Connections.createOrUpdate","com.azure.resourcemanager.datatransfer.fluent.ConnectionsClient.beginDelete":"Microsoft.AzureDataTransfer.Connections.delete","com.azure.resourcemanager.datatransfer.fluent.ConnectionsClient.beginLink":"Microsoft.AzureDataTransfer.Connections.link","com.azure.resourcemanager.datatransfer.fluent.ConnectionsClient.beginUpdate":"Microsoft.AzureDataTransfer.Connections.update","com.azure.resourcemanager.datatransfer.fluent.ConnectionsClient.createOrUpdate":"Microsoft.AzureDataTransfer.Connections.createOrUpdate","com.azure.resourcemanager.datatransfer.fluent.ConnectionsClient.delete":"Microsoft.AzureDataTransfer.Connections.delete","com.azure.resourcemanager.datatransfer.fluent.ConnectionsClient.getByResourceGroup":"Microsoft.AzureDataTransfer.Connections.get","com.azure.resourcemanager.datatransfer.fluent.ConnectionsClient.getByResourceGroupWithResponse":"Microsoft.AzureDataTransfer.Connections.get","com.azure.resourcemanager.datatransfer.fluent.ConnectionsClient.link":"Microsoft.AzureDataTransfer.Connections.link","com.azure.resourcemanager.datatransfer.fluent.ConnectionsClient.list":"Microsoft.AzureDataTransfer.Connections.list","com.azure.resourcemanager.datatransfer.fluent.ConnectionsClient.listByResourceGroup":"Microsoft.AzureDataTransfer.Connections.listByResourceGroup","com.azure.resourcemanager.datatransfer.fluent.ConnectionsClient.listBySubscription":"Microsoft.AzureDataTransfer.Connections.listBySubscription","com.azure.resourcemanager.datatransfer.fluent.ConnectionsClient.listPendingFlowsList":"Microsoft.AzureDataTransfer.Connections.listPendingFlowsList","com.azure.resourcemanager.datatransfer.fluent.ConnectionsClient.update":"Microsoft.AzureDataTransfer.Connections.update","com.azure.resourcemanager.datatransfer.fluent.DataTransferManagementClient":"Microsoft.AzureDataTransfer","com.azure.resourcemanager.datatransfer.fluent.FlowProfilesClient":"Microsoft.AzureDataTransfer.FlowProfiles","com.azure.resourcemanager.datatransfer.fluent.FlowProfilesClient.beginCreateOrUpdate":"Microsoft.AzureDataTransfer.FlowProfiles.createOrUpdate","com.azure.resourcemanager.datatransfer.fluent.FlowProfilesClient.beginDelete":"Microsoft.AzureDataTransfer.FlowProfiles.delete","com.azure.resourcemanager.datatransfer.fluent.FlowProfilesClient.beginUpdate":"Microsoft.AzureDataTransfer.FlowProfiles.update","com.azure.resourcemanager.datatransfer.fluent.FlowProfilesClient.createOrUpdate":"Microsoft.AzureDataTransfer.FlowProfiles.createOrUpdate","com.azure.resourcemanager.datatransfer.fluent.FlowProfilesClient.delete":"Microsoft.AzureDataTransfer.FlowProfiles.delete","com.azure.resourcemanager.datatransfer.fluent.FlowProfilesClient.get":"Microsoft.AzureDataTransfer.FlowProfiles.get","com.azure.resourcemanager.datatransfer.fluent.FlowProfilesClient.getWithResponse":"Microsoft.AzureDataTransfer.FlowProfiles.get","com.azure.resourcemanager.datatransfer.fluent.FlowProfilesClient.listByPipeline":"Microsoft.AzureDataTransfer.FlowProfiles.listByPipeline","com.azure.resourcemanager.datatransfer.fluent.FlowProfilesClient.update":"Microsoft.AzureDataTransfer.FlowProfiles.update","com.azure.resourcemanager.datatransfer.fluent.FlowsClient":"Microsoft.AzureDataTransfer.Flows","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.beginCreateOrUpdate":"Microsoft.AzureDataTransfer.Flows.createOrUpdate","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.beginDelete":"Microsoft.AzureDataTransfer.Flows.delete","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.beginDisable":"Microsoft.AzureDataTransfer.Flows.disable","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.beginEnable":"Microsoft.AzureDataTransfer.Flows.enable","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.beginGeneratePassphrase":"Microsoft.AzureDataTransfer.Flows.generatePassphrase","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.beginLink":"Microsoft.AzureDataTransfer.Flows.link","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.beginSetDestinationEndpointPorts":"Microsoft.AzureDataTransfer.Flows.setDestinationEndpointPorts","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.beginSetDestinationEndpoints":"Microsoft.AzureDataTransfer.Flows.setDestinationEndpoints","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.beginSetPassphrase":"Microsoft.AzureDataTransfer.Flows.setPassphrase","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.beginSetSourceAddresses":"Microsoft.AzureDataTransfer.Flows.setSourceAddresses","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.beginUpdate":"Microsoft.AzureDataTransfer.Flows.update","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.createOrUpdate":"Microsoft.AzureDataTransfer.Flows.createOrUpdate","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.delete":"Microsoft.AzureDataTransfer.Flows.delete","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.disable":"Microsoft.AzureDataTransfer.Flows.disable","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.enable":"Microsoft.AzureDataTransfer.Flows.enable","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.generatePassphrase":"Microsoft.AzureDataTransfer.Flows.generatePassphrase","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.get":"Microsoft.AzureDataTransfer.Flows.get","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.getDestinationEndpointPorts":"Microsoft.AzureDataTransfer.Flows.getDestinationEndpointPorts","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.getDestinationEndpointPortsWithResponse":"Microsoft.AzureDataTransfer.Flows.getDestinationEndpointPorts","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.getDestinationEndpoints":"Microsoft.AzureDataTransfer.Flows.getDestinationEndpoints","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.getDestinationEndpointsWithResponse":"Microsoft.AzureDataTransfer.Flows.getDestinationEndpoints","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.getSourceAddresses":"Microsoft.AzureDataTransfer.Flows.getSourceAddresses","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.getSourceAddressesWithResponse":"Microsoft.AzureDataTransfer.Flows.getSourceAddresses","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.getStreamConnectionString":"Microsoft.AzureDataTransfer.Flows.getStreamConnectionString","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.getStreamConnectionStringWithResponse":"Microsoft.AzureDataTransfer.Flows.getStreamConnectionString","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.getWithResponse":"Microsoft.AzureDataTransfer.Flows.get","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.link":"Microsoft.AzureDataTransfer.Flows.link","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.listByConnection":"Microsoft.AzureDataTransfer.Flows.listByConnection","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.setDestinationEndpointPorts":"Microsoft.AzureDataTransfer.Flows.setDestinationEndpointPorts","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.setDestinationEndpoints":"Microsoft.AzureDataTransfer.Flows.setDestinationEndpoints","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.setPassphrase":"Microsoft.AzureDataTransfer.Flows.setPassphrase","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.setSourceAddresses":"Microsoft.AzureDataTransfer.Flows.setSourceAddresses","com.azure.resourcemanager.datatransfer.fluent.FlowsClient.update":"Microsoft.AzureDataTransfer.Flows.update","com.azure.resourcemanager.datatransfer.fluent.OperationsClient":"Microsoft.AzureDataTransfer.Operations","com.azure.resourcemanager.datatransfer.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.datatransfer.fluent.PipelinesClient":"Microsoft.AzureDataTransfer.Pipelines","com.azure.resourcemanager.datatransfer.fluent.PipelinesClient.approveConnection":"Microsoft.AzureDataTransfer.Pipelines.approveConnection","com.azure.resourcemanager.datatransfer.fluent.PipelinesClient.beginApproveConnection":"Microsoft.AzureDataTransfer.Pipelines.approveConnection","com.azure.resourcemanager.datatransfer.fluent.PipelinesClient.beginCreateOrUpdate":"Microsoft.AzureDataTransfer.Pipelines.createOrUpdate","com.azure.resourcemanager.datatransfer.fluent.PipelinesClient.beginDelete":"Microsoft.AzureDataTransfer.Pipelines.delete","com.azure.resourcemanager.datatransfer.fluent.PipelinesClient.beginExecuteAction":"Microsoft.AzureDataTransfer.Pipelines.executeAction","com.azure.resourcemanager.datatransfer.fluent.PipelinesClient.beginRejectConnection":"Microsoft.AzureDataTransfer.Pipelines.rejectConnection","com.azure.resourcemanager.datatransfer.fluent.PipelinesClient.beginUpdate":"Microsoft.AzureDataTransfer.Pipelines.update","com.azure.resourcemanager.datatransfer.fluent.PipelinesClient.createOrUpdate":"Microsoft.AzureDataTransfer.Pipelines.createOrUpdate","com.azure.resourcemanager.datatransfer.fluent.PipelinesClient.delete":"Microsoft.AzureDataTransfer.Pipelines.delete","com.azure.resourcemanager.datatransfer.fluent.PipelinesClient.executeAction":"Microsoft.AzureDataTransfer.Pipelines.executeAction","com.azure.resourcemanager.datatransfer.fluent.PipelinesClient.getByResourceGroup":"Microsoft.AzureDataTransfer.Pipelines.get","com.azure.resourcemanager.datatransfer.fluent.PipelinesClient.getByResourceGroupWithResponse":"Microsoft.AzureDataTransfer.Pipelines.get","com.azure.resourcemanager.datatransfer.fluent.PipelinesClient.list":"Microsoft.AzureDataTransfer.Pipelines.list","com.azure.resourcemanager.datatransfer.fluent.PipelinesClient.listByResourceGroup":"Microsoft.AzureDataTransfer.Pipelines.listByResourceGroup","com.azure.resourcemanager.datatransfer.fluent.PipelinesClient.listBySubscription":"Microsoft.AzureDataTransfer.Pipelines.listBySubscription","com.azure.resourcemanager.datatransfer.fluent.PipelinesClient.listSchemasList":"Microsoft.AzureDataTransfer.Pipelines.listSchemasList","com.azure.resourcemanager.datatransfer.fluent.PipelinesClient.listSchemasListWithResponse":"Microsoft.AzureDataTransfer.Pipelines.listSchemasList","com.azure.resourcemanager.datatransfer.fluent.PipelinesClient.listWithResponse":"Microsoft.AzureDataTransfer.Pipelines.list","com.azure.resourcemanager.datatransfer.fluent.PipelinesClient.rejectConnection":"Microsoft.AzureDataTransfer.Pipelines.rejectConnection","com.azure.resourcemanager.datatransfer.fluent.PipelinesClient.update":"Microsoft.AzureDataTransfer.Pipelines.update","com.azure.resourcemanager.datatransfer.fluent.models.ConnectionInner":"Microsoft.AzureDataTransfer.Connection","com.azure.resourcemanager.datatransfer.fluent.models.FlowInner":"Microsoft.AzureDataTransfer.Flow","com.azure.resourcemanager.datatransfer.fluent.models.FlowProfileInner":"Microsoft.AzureDataTransfer.FlowProfile","com.azure.resourcemanager.datatransfer.fluent.models.FlowProfilesListResultInner":"Microsoft.AzureDataTransfer.FlowProfilesListResult","com.azure.resourcemanager.datatransfer.fluent.models.FlowPropertiesInner":"Microsoft.AzureDataTransfer.FlowProperties","com.azure.resourcemanager.datatransfer.fluent.models.GetDestinationEndpointPortsResultInner":"Microsoft.AzureDataTransfer.GetDestinationEndpointPortsResult","com.azure.resourcemanager.datatransfer.fluent.models.GetDestinationEndpointsResultInner":"Microsoft.AzureDataTransfer.GetDestinationEndpointsResult","com.azure.resourcemanager.datatransfer.fluent.models.GetStreamConnectionStringResultInner":"Microsoft.AzureDataTransfer.GetStreamConnectionStringResult","com.azure.resourcemanager.datatransfer.fluent.models.ListFlowsByPipelineResultInner":"Microsoft.AzureDataTransfer.ListFlowsByPipelineResult","com.azure.resourcemanager.datatransfer.fluent.models.ListPipelineMetadataResultInner":"Microsoft.AzureDataTransfer.ListPipelineMetadataResult","com.azure.resourcemanager.datatransfer.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.datatransfer.fluent.models.PendingConnectionInner":"Microsoft.AzureDataTransfer.PendingConnection","com.azure.resourcemanager.datatransfer.fluent.models.PendingFlowInner":"Microsoft.AzureDataTransfer.PendingFlow","com.azure.resourcemanager.datatransfer.fluent.models.PipelineInner":"Microsoft.AzureDataTransfer.Pipeline","com.azure.resourcemanager.datatransfer.fluent.models.SchemasListResultInner":"Microsoft.AzureDataTransfer.SchemasListResult","com.azure.resourcemanager.datatransfer.fluent.models.StreamSourceAddressesInner":"Microsoft.AzureDataTransfer.StreamSourceAddresses","com.azure.resourcemanager.datatransfer.fluent.models.ValidateSchemaResultInner":"Microsoft.AzureDataTransfer.ValidateSchemaResult","com.azure.resourcemanager.datatransfer.implementation.DataTransferManagementClientBuilder":"Microsoft.AzureDataTransfer","com.azure.resourcemanager.datatransfer.implementation.models.ConnectionListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.datatransfer.implementation.models.FlowListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.datatransfer.implementation.models.FlowProfileListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.datatransfer.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.datatransfer.implementation.models.PendingConnectionListResult":"Azure.ResourceManager.ResourceListCustomResult","com.azure.resourcemanager.datatransfer.implementation.models.PendingFlowListResult":"Azure.ResourceManager.ResourceListCustomResult","com.azure.resourcemanager.datatransfer.implementation.models.PipelineListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.datatransfer.models.Action":"Microsoft.AzureDataTransfer.Action","com.azure.resourcemanager.datatransfer.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.datatransfer.models.AntivirusRuleset":"Microsoft.AzureDataTransfer.AntivirusRuleset","com.azure.resourcemanager.datatransfer.models.AntivirusSolutions":"Microsoft.AzureDataTransfer.AntivirusSolutions","com.azure.resourcemanager.datatransfer.models.ApiFlowOptions":"Microsoft.AzureDataTransfer.ApiFlowOptions","com.azure.resourcemanager.datatransfer.models.ApiMode":"Microsoft.AzureDataTransfer.ApiMode","com.azure.resourcemanager.datatransfer.models.ArchiveRuleset":"Microsoft.AzureDataTransfer.ArchiveRuleset","com.azure.resourcemanager.datatransfer.models.Authentication":"Microsoft.AzureDataTransfer.Authentication","com.azure.resourcemanager.datatransfer.models.AuthenticationType":"Microsoft.AzureDataTransfer.AuthenticationType","com.azure.resourcemanager.datatransfer.models.Casing":"Microsoft.AzureDataTransfer.Casing","com.azure.resourcemanager.datatransfer.models.ConnectionIdList":"Microsoft.AzureDataTransfer.ConnectionIdList","com.azure.resourcemanager.datatransfer.models.ConnectionProperties":"Microsoft.AzureDataTransfer.ConnectionProperties","com.azure.resourcemanager.datatransfer.models.ConnectionStatus":"Microsoft.AzureDataTransfer.ConnectionStatus","com.azure.resourcemanager.datatransfer.models.ConnectionsPatch":"Microsoft.AzureDataTransfer.ConnectionsPatch","com.azure.resourcemanager.datatransfer.models.DataClass":"Microsoft.AzureDataTransfer.DataClass","com.azure.resourcemanager.datatransfer.models.DataClassType":"Microsoft.AzureDataTransfer.DataClassType","com.azure.resourcemanager.datatransfer.models.DataSizeRuleset":"Microsoft.AzureDataTransfer.DataSizeRuleset","com.azure.resourcemanager.datatransfer.models.DataType":"Microsoft.AzureDataTransfer.DataType","com.azure.resourcemanager.datatransfer.models.DateTransferActionType":"Microsoft.AzureDataTransfer.ActionType","com.azure.resourcemanager.datatransfer.models.Direction":"Microsoft.AzureDataTransfer.Direction","com.azure.resourcemanager.datatransfer.models.DirectionSettings":"Microsoft.AzureDataTransfer.DirectionSettings","com.azure.resourcemanager.datatransfer.models.EnablementStatus":"Microsoft.AzureDataTransfer.EnablementStatus","com.azure.resourcemanager.datatransfer.models.FilterType":"Microsoft.AzureDataTransfer.FilterType","com.azure.resourcemanager.datatransfer.models.FlowBillingTier":"Microsoft.AzureDataTransfer.FlowBillingTier","com.azure.resourcemanager.datatransfer.models.FlowProfileMetadata":"Microsoft.AzureDataTransfer.FlowProfileMetadata","com.azure.resourcemanager.datatransfer.models.FlowProfilePatch":"Microsoft.AzureDataTransfer.FlowProfilePatch","com.azure.resourcemanager.datatransfer.models.FlowProfilePatchProperties":"Microsoft.AzureDataTransfer.FlowProfilePatchProperties","com.azure.resourcemanager.datatransfer.models.FlowProfileProperties":"Microsoft.AzureDataTransfer.FlowProfileProperties","com.azure.resourcemanager.datatransfer.models.FlowProfileRulesets":"Microsoft.AzureDataTransfer.FlowProfileRulesets","com.azure.resourcemanager.datatransfer.models.FlowProfileStatus":"Microsoft.AzureDataTransfer.FlowProfileStatus","com.azure.resourcemanager.datatransfer.models.FlowStatus":"Microsoft.AzureDataTransfer.FlowStatus","com.azure.resourcemanager.datatransfer.models.FlowType":"Microsoft.AzureDataTransfer.FlowType","com.azure.resourcemanager.datatransfer.models.FlowsPatch":"Microsoft.AzureDataTransfer.FlowsPatch","com.azure.resourcemanager.datatransfer.models.FlowsPatchProperties":"Microsoft.AzureDataTransfer.FlowsPatchProperties","com.azure.resourcemanager.datatransfer.models.ForceDisabledStatus":"Microsoft.AzureDataTransfer.ForceDisabledStatus","com.azure.resourcemanager.datatransfer.models.IdentityTranslation":"Microsoft.AzureDataTransfer.IdentityTranslation","com.azure.resourcemanager.datatransfer.models.InternalMetadataProperties":"Microsoft.AzureDataTransfer.InternalMetadataProperties","com.azure.resourcemanager.datatransfer.models.LinkStatus":"Microsoft.AzureDataTransfer.LinkStatus","com.azure.resourcemanager.datatransfer.models.ListApprovedSchemasRequest":"Microsoft.AzureDataTransfer.ListApprovedSchemasRequest","com.azure.resourcemanager.datatransfer.models.ListFlowProfilesRequest":"Microsoft.AzureDataTransfer.ListFlowProfilesRequest","com.azure.resourcemanager.datatransfer.models.ListFlowsByPipelineConnection":"Microsoft.AzureDataTransfer.ListFlowsByPipelineConnection","com.azure.resourcemanager.datatransfer.models.ListPipelineMetadataRequest":"Microsoft.AzureDataTransfer.ListPipelineMetadataRequest","com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentity":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentity","com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType","com.azure.resourcemanager.datatransfer.models.MatchType":"Microsoft.AzureDataTransfer.MatchType","com.azure.resourcemanager.datatransfer.models.MessagingOptions":"Microsoft.AzureDataTransfer.MessagingOptions","com.azure.resourcemanager.datatransfer.models.MimeFilterRuleset":"Microsoft.AzureDataTransfer.MimeFilterRuleset","com.azure.resourcemanager.datatransfer.models.MimeTypeFilter":"Microsoft.AzureDataTransfer.MimeTypeFilter","com.azure.resourcemanager.datatransfer.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.datatransfer.models.OperationStatusEnum":"Microsoft.AzureDataTransfer.OperationStatusEnum","com.azure.resourcemanager.datatransfer.models.OperationStatusProperties":"Microsoft.AzureDataTransfer.OperationStatusProperties","com.azure.resourcemanager.datatransfer.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.datatransfer.models.PipelineConnectionProperties":"Microsoft.AzureDataTransfer.PipelineConnectionProperties","com.azure.resourcemanager.datatransfer.models.PipelineProperties":"Microsoft.AzureDataTransfer.PipelineProperties","com.azure.resourcemanager.datatransfer.models.PipelineStatus":"Microsoft.AzureDataTransfer.PipelineStatus","com.azure.resourcemanager.datatransfer.models.PipelinesPatch":"Microsoft.AzureDataTransfer.PipelinesPatch","com.azure.resourcemanager.datatransfer.models.PipelinesPatchProperties":"Microsoft.AzureDataTransfer.PipelinesPatchProperties","com.azure.resourcemanager.datatransfer.models.Plan":"Azure.ResourceManager.CommonTypes.Plan","com.azure.resourcemanager.datatransfer.models.ProvisioningState":"Microsoft.AzureDataTransfer.ProvisioningState","com.azure.resourcemanager.datatransfer.models.ReadPipelineConnection":"Microsoft.AzureDataTransfer.ReadPipelineConnection","com.azure.resourcemanager.datatransfer.models.RemoteEndpointSettings":"Microsoft.AzureDataTransfer.RemoteEndpointSettings","com.azure.resourcemanager.datatransfer.models.ResourceBody":"Microsoft.AzureDataTransfer.ResourceBody","com.azure.resourcemanager.datatransfer.models.Schema":"Microsoft.AzureDataTransfer.Schema","com.azure.resourcemanager.datatransfer.models.SchemaStatus":"Microsoft.AzureDataTransfer.SchemaStatus","com.azure.resourcemanager.datatransfer.models.SchemaType":"Microsoft.AzureDataTransfer.SchemaType","com.azure.resourcemanager.datatransfer.models.SelectedResource":"Microsoft.AzureDataTransfer.SelectedResource","com.azure.resourcemanager.datatransfer.models.SetDestinationEndpointPorts":"Microsoft.AzureDataTransfer.SetDestinationEndpointPorts","com.azure.resourcemanager.datatransfer.models.SetDestinationEndpoints":"Microsoft.AzureDataTransfer.SetDestinationEndpoints","com.azure.resourcemanager.datatransfer.models.SetSourceAddresses":"Microsoft.AzureDataTransfer.SetSourceAddresses","com.azure.resourcemanager.datatransfer.models.SetStreamPassphrase":"Microsoft.AzureDataTransfer.SetStreamPassphrase","com.azure.resourcemanager.datatransfer.models.StreamProtocol":"Microsoft.AzureDataTransfer.StreamProtocol","com.azure.resourcemanager.datatransfer.models.Subscriber":"Microsoft.AzureDataTransfer.Subscriber","com.azure.resourcemanager.datatransfer.models.TargetType":"Microsoft.AzureDataTransfer.TargetType","com.azure.resourcemanager.datatransfer.models.TextMatchingRuleset":"Microsoft.AzureDataTransfer.TextMatchingRuleset","com.azure.resourcemanager.datatransfer.models.TextMatchingRulesetDeny":"Microsoft.AzureDataTransfer.TextMatchingRuleset.deny.anonymous","com.azure.resourcemanager.datatransfer.models.UserAssignedIdentity":"Azure.ResourceManager.CommonTypes.UserAssignedIdentity","com.azure.resourcemanager.datatransfer.models.ValidateSchemaStatus":"Microsoft.AzureDataTransfer.ValidateSchemaStatus","com.azure.resourcemanager.datatransfer.models.XmlFilterRuleset":"Microsoft.AzureDataTransfer.XmlFilterRuleset","com.azure.resourcemanager.datatransfer.models.XmlReferenceType":"Microsoft.AzureDataTransfer.XmlReferenceType"},"generatedFiles":["src/main/java/com/azure/resourcemanager/datatransfer/DataTransferManager.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/AzureDataTransfersClient.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/ConnectionsClient.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/DataTransferManagementClient.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/FlowProfilesClient.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/FlowsClient.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/PipelinesClient.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/ConnectionInner.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/FlowInner.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/FlowProfileInner.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/FlowProfilesListResultInner.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/FlowPropertiesInner.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/GetDestinationEndpointPortsResultInner.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/GetDestinationEndpointsResultInner.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/GetStreamConnectionStringResultInner.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/ListFlowsByPipelineResultInner.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/ListPipelineMetadataResultInner.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/PendingConnectionInner.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/PendingFlowInner.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/PipelineInner.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/SchemasListResultInner.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/StreamSourceAddressesInner.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/ValidateSchemaResultInner.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/datatransfer/fluent/package-info.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/AzureDataTransfersClientImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/AzureDataTransfersImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/ConnectionImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/ConnectionsClientImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/ConnectionsImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/DataTransferManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/DataTransferManagementClientImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowProfileImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowProfilesClientImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowProfilesImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowProfilesListResultImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowPropertiesImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowsClientImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/FlowsImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/GetDestinationEndpointPortsResultImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/GetDestinationEndpointsResultImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/GetStreamConnectionStringResultImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/ListFlowsByPipelineResultImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/ListPipelineMetadataResultImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/PendingConnectionImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/PendingFlowImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/PipelineImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/PipelinesClientImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/PipelinesImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/SchemasListResultImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/StreamSourceAddressesImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/ValidateSchemaResultImpl.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/ConnectionListResult.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/FlowListResult.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/FlowProfileListResult.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/PendingConnectionListResult.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/PendingFlowListResult.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/models/PipelineListResult.java","src/main/java/com/azure/resourcemanager/datatransfer/implementation/package-info.java","src/main/java/com/azure/resourcemanager/datatransfer/models/Action.java","src/main/java/com/azure/resourcemanager/datatransfer/models/ActionType.java","src/main/java/com/azure/resourcemanager/datatransfer/models/AntivirusRuleset.java","src/main/java/com/azure/resourcemanager/datatransfer/models/AntivirusSolutions.java","src/main/java/com/azure/resourcemanager/datatransfer/models/ApiFlowOptions.java","src/main/java/com/azure/resourcemanager/datatransfer/models/ApiMode.java","src/main/java/com/azure/resourcemanager/datatransfer/models/ArchiveRuleset.java","src/main/java/com/azure/resourcemanager/datatransfer/models/Authentication.java","src/main/java/com/azure/resourcemanager/datatransfer/models/AuthenticationType.java","src/main/java/com/azure/resourcemanager/datatransfer/models/AzureDataTransfers.java","src/main/java/com/azure/resourcemanager/datatransfer/models/Casing.java","src/main/java/com/azure/resourcemanager/datatransfer/models/Connection.java","src/main/java/com/azure/resourcemanager/datatransfer/models/ConnectionIdList.java","src/main/java/com/azure/resourcemanager/datatransfer/models/ConnectionProperties.java","src/main/java/com/azure/resourcemanager/datatransfer/models/ConnectionStatus.java","src/main/java/com/azure/resourcemanager/datatransfer/models/Connections.java","src/main/java/com/azure/resourcemanager/datatransfer/models/ConnectionsPatch.java","src/main/java/com/azure/resourcemanager/datatransfer/models/DataClass.java","src/main/java/com/azure/resourcemanager/datatransfer/models/DataClassType.java","src/main/java/com/azure/resourcemanager/datatransfer/models/DataSizeRuleset.java","src/main/java/com/azure/resourcemanager/datatransfer/models/DataType.java","src/main/java/com/azure/resourcemanager/datatransfer/models/DateTransferActionType.java","src/main/java/com/azure/resourcemanager/datatransfer/models/Direction.java","src/main/java/com/azure/resourcemanager/datatransfer/models/DirectionSettings.java","src/main/java/com/azure/resourcemanager/datatransfer/models/EnablementStatus.java","src/main/java/com/azure/resourcemanager/datatransfer/models/FilterType.java","src/main/java/com/azure/resourcemanager/datatransfer/models/Flow.java","src/main/java/com/azure/resourcemanager/datatransfer/models/FlowBillingTier.java","src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfile.java","src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfileMetadata.java","src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfilePatch.java","src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfilePatchProperties.java","src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfileProperties.java","src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfileRulesets.java","src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfileStatus.java","src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfiles.java","src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProfilesListResult.java","src/main/java/com/azure/resourcemanager/datatransfer/models/FlowProperties.java","src/main/java/com/azure/resourcemanager/datatransfer/models/FlowStatus.java","src/main/java/com/azure/resourcemanager/datatransfer/models/FlowType.java","src/main/java/com/azure/resourcemanager/datatransfer/models/Flows.java","src/main/java/com/azure/resourcemanager/datatransfer/models/FlowsPatch.java","src/main/java/com/azure/resourcemanager/datatransfer/models/FlowsPatchProperties.java","src/main/java/com/azure/resourcemanager/datatransfer/models/ForceDisabledStatus.java","src/main/java/com/azure/resourcemanager/datatransfer/models/GetDestinationEndpointPortsResult.java","src/main/java/com/azure/resourcemanager/datatransfer/models/GetDestinationEndpointsResult.java","src/main/java/com/azure/resourcemanager/datatransfer/models/GetStreamConnectionStringResult.java","src/main/java/com/azure/resourcemanager/datatransfer/models/IdentityTranslation.java","src/main/java/com/azure/resourcemanager/datatransfer/models/InternalMetadataProperties.java","src/main/java/com/azure/resourcemanager/datatransfer/models/LinkStatus.java","src/main/java/com/azure/resourcemanager/datatransfer/models/ListApprovedSchemasRequest.java","src/main/java/com/azure/resourcemanager/datatransfer/models/ListFlowProfilesRequest.java","src/main/java/com/azure/resourcemanager/datatransfer/models/ListFlowsByPipelineConnection.java","src/main/java/com/azure/resourcemanager/datatransfer/models/ListFlowsByPipelineResult.java","src/main/java/com/azure/resourcemanager/datatransfer/models/ListPipelineMetadataRequest.java","src/main/java/com/azure/resourcemanager/datatransfer/models/ListPipelineMetadataResult.java","src/main/java/com/azure/resourcemanager/datatransfer/models/ManagedServiceIdentity.java","src/main/java/com/azure/resourcemanager/datatransfer/models/ManagedServiceIdentityType.java","src/main/java/com/azure/resourcemanager/datatransfer/models/MatchType.java","src/main/java/com/azure/resourcemanager/datatransfer/models/MessagingOptions.java","src/main/java/com/azure/resourcemanager/datatransfer/models/MimeFilterRuleset.java","src/main/java/com/azure/resourcemanager/datatransfer/models/MimeTypeFilter.java","src/main/java/com/azure/resourcemanager/datatransfer/models/Operation.java","src/main/java/com/azure/resourcemanager/datatransfer/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/datatransfer/models/OperationStatusEnum.java","src/main/java/com/azure/resourcemanager/datatransfer/models/OperationStatusProperties.java","src/main/java/com/azure/resourcemanager/datatransfer/models/Operations.java","src/main/java/com/azure/resourcemanager/datatransfer/models/Origin.java","src/main/java/com/azure/resourcemanager/datatransfer/models/PendingConnection.java","src/main/java/com/azure/resourcemanager/datatransfer/models/PendingFlow.java","src/main/java/com/azure/resourcemanager/datatransfer/models/Pipeline.java","src/main/java/com/azure/resourcemanager/datatransfer/models/PipelineConnectionProperties.java","src/main/java/com/azure/resourcemanager/datatransfer/models/PipelineProperties.java","src/main/java/com/azure/resourcemanager/datatransfer/models/PipelineStatus.java","src/main/java/com/azure/resourcemanager/datatransfer/models/Pipelines.java","src/main/java/com/azure/resourcemanager/datatransfer/models/PipelinesPatch.java","src/main/java/com/azure/resourcemanager/datatransfer/models/PipelinesPatchProperties.java","src/main/java/com/azure/resourcemanager/datatransfer/models/Plan.java","src/main/java/com/azure/resourcemanager/datatransfer/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/datatransfer/models/ReadPipelineConnection.java","src/main/java/com/azure/resourcemanager/datatransfer/models/RemoteEndpointSettings.java","src/main/java/com/azure/resourcemanager/datatransfer/models/ResourceBody.java","src/main/java/com/azure/resourcemanager/datatransfer/models/Schema.java","src/main/java/com/azure/resourcemanager/datatransfer/models/SchemaStatus.java","src/main/java/com/azure/resourcemanager/datatransfer/models/SchemaType.java","src/main/java/com/azure/resourcemanager/datatransfer/models/SchemasListResult.java","src/main/java/com/azure/resourcemanager/datatransfer/models/SelectedResource.java","src/main/java/com/azure/resourcemanager/datatransfer/models/SetDestinationEndpointPorts.java","src/main/java/com/azure/resourcemanager/datatransfer/models/SetDestinationEndpoints.java","src/main/java/com/azure/resourcemanager/datatransfer/models/SetSourceAddresses.java","src/main/java/com/azure/resourcemanager/datatransfer/models/SetStreamPassphrase.java","src/main/java/com/azure/resourcemanager/datatransfer/models/StreamProtocol.java","src/main/java/com/azure/resourcemanager/datatransfer/models/StreamSourceAddresses.java","src/main/java/com/azure/resourcemanager/datatransfer/models/Subscriber.java","src/main/java/com/azure/resourcemanager/datatransfer/models/TargetType.java","src/main/java/com/azure/resourcemanager/datatransfer/models/TextMatchingRuleset.java","src/main/java/com/azure/resourcemanager/datatransfer/models/TextMatchingRulesetDeny.java","src/main/java/com/azure/resourcemanager/datatransfer/models/UserAssignedIdentity.java","src/main/java/com/azure/resourcemanager/datatransfer/models/ValidateSchemaResult.java","src/main/java/com/azure/resourcemanager/datatransfer/models/ValidateSchemaStatus.java","src/main/java/com/azure/resourcemanager/datatransfer/models/XmlFilterRuleset.java","src/main/java/com/azure/resourcemanager/datatransfer/models/XmlReferenceType.java","src/main/java/com/azure/resourcemanager/datatransfer/models/package-info.java","src/main/java/com/azure/resourcemanager/datatransfer/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-datatransfer/proxy-config.json b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-datatransfer/proxy-config.json new file mode 100644 index 0000000000000..283092cdb53f1 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-datatransfer/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.datatransfer.implementation.AzureDataTransfersClientImpl$AzureDataTransfersService"],["com.azure.resourcemanager.datatransfer.implementation.ConnectionsClientImpl$ConnectionsService"],["com.azure.resourcemanager.datatransfer.implementation.FlowProfilesClientImpl$FlowProfilesService"],["com.azure.resourcemanager.datatransfer.implementation.FlowsClientImpl$FlowsService"],["com.azure.resourcemanager.datatransfer.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.datatransfer.implementation.PipelinesClientImpl$PipelinesService"]] \ No newline at end of file diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-datatransfer/reflect-config.json b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-datatransfer/reflect-config.json new file mode 100644 index 0000000000000..0637a088a01e8 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-datatransfer/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/resources/azure-resourcemanager-datatransfer.properties b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/resources/azure-resourcemanager-datatransfer.properties new file mode 100644 index 0000000000000..defbd48204e47 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/main/resources/azure-resourcemanager-datatransfer.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransferListApprovedSchemasSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransferListApprovedSchemasSamples.java new file mode 100644 index 0000000000000..f5919fbaf3fe3 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransferListApprovedSchemasSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.resourcemanager.datatransfer.models.Direction; +import com.azure.resourcemanager.datatransfer.models.ListApprovedSchemasRequest; + +/** + * Samples for AzureDataTransfer ListApprovedSchemas. + */ +public final class AzureDataTransferListApprovedSchemasSamples { + /* + * x-ms-original-file: 2026-02-06-preview/postListApprovedSchemas.json + */ + /** + * Sample code: Performs action request. + * + * @param manager Entry point to DataTransferManager. + */ + public static void performsActionRequest(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.azureDataTransfers() + .listApprovedSchemasWithResponse( + new ListApprovedSchemasRequest().withPipeline("test").withDirection(Direction.SEND), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransferListFlowProfilesSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransferListFlowProfilesSamples.java new file mode 100644 index 0000000000000..87f28a654b339 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransferListFlowProfilesSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.resourcemanager.datatransfer.models.ListFlowProfilesRequest; + +/** + * Samples for AzureDataTransfer ListFlowProfiles. + */ +public final class AzureDataTransferListFlowProfilesSamples { + /* + * x-ms-original-file: 2026-02-06-preview/AzureDataTransfer_ListFlowProfiles_MaximumSet_Gen.json + */ + /** + * Sample code: AzureDataTransfer_ListFlowProfiles_MaximumSet_Gen - generated by [MaximumSet] rule. + * + * @param manager Entry point to DataTransferManager. + */ + public static void azureDataTransferListFlowProfilesMaximumSetGenGeneratedByMaximumSetRule( + com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.azureDataTransfers() + .listFlowProfilesWithResponse(new ListFlowProfilesRequest(), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransferListPipelineMetadataSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransferListPipelineMetadataSamples.java new file mode 100644 index 0000000000000..37eab86f9e833 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransferListPipelineMetadataSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.resourcemanager.datatransfer.models.ListPipelineMetadataRequest; + +/** + * Samples for AzureDataTransfer ListPipelineMetadata. + */ +public final class AzureDataTransferListPipelineMetadataSamples { + /* + * x-ms-original-file: 2026-02-06-preview/AzureDataTransfer_ListPipelineMetadata.json + */ + /** + * Sample code: AzureDataTransfer_ListPipelineMetadata. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + azureDataTransferListPipelineMetadata(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.azureDataTransfers() + .listPipelineMetadataWithResponse(new ListPipelineMetadataRequest().withPipeline("testPipeline"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransferValidateSchemaSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransferValidateSchemaSamples.java new file mode 100644 index 0000000000000..4a84d417fb1d9 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransferValidateSchemaSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.resourcemanager.datatransfer.models.Schema; + +/** + * Samples for AzureDataTransfer ValidateSchema. + */ +public final class AzureDataTransferValidateSchemaSamples { + /* + * x-ms-original-file: 2026-02-06-preview/postValidateSchema.json + */ + /** + * Sample code: Performs action request. + * + * @param manager Entry point to DataTransferManager. + */ + public static void performsActionRequest(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.azureDataTransfers() + .validateSchemaWithResponse(new Schema().withName("schema.xml"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsCreateOrUpdateSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..95381c2bc6d61 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsCreateOrUpdateSamples.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.resourcemanager.datatransfer.models.ConnectionProperties; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.FlowProfileMetadata; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import java.util.Arrays; + +/** + * Samples for Connections CreateOrUpdate. + */ +public final class ConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-02-06-preview/createOrUpdateConnection.json + */ + /** + * Sample code: Creates or updates the connection resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + createsOrUpdatesTheConnectionResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.connections() + .define("testConnection") + .withRegion("East US") + .withExistingResourceGroup("testRG") + .withProperties(new ConnectionProperties().withPipeline("testdc") + .withJustification("justification") + .withFlowProfileList(Arrays.asList( + new FlowProfileMetadata().withPipeline("pipelinea") + .withName("flowProfileNamea") + .withReplicationScenario(DataClassType.FILES) + .withFlowProfileId("25f2c41a-6e29-4c40-a033-b4de81d4a681") + .withStatus(FlowProfileStatus.ENABLED) + .withDescription("Testing 123"), + new FlowProfileMetadata().withPipeline("pipelinea") + .withName("flowProfileNameb") + .withReplicationScenario(DataClassType.FILES) + .withFlowProfileId("66b00598-cabb-4a85-b3d8-88905ac899b8") + .withStatus(FlowProfileStatus.ENABLED) + .withDescription("Testing 123"))) + .withRequirementId("id")) + .create(); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsDeleteSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..dea9954687b01 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for Connections Delete. + */ +public final class ConnectionsDeleteSamples { + /* + * x-ms-original-file: 2026-02-06-preview/deleteConnection.json + */ + /** + * Sample code: Deletes the connection resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + deletesTheConnectionResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.connections().delete("testRG", "testConnection", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsGetByResourceGroupSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..769b5ebd0dc20 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for Connections GetByResourceGroup. + */ +public final class ConnectionsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-02-06-preview/getConnection.json + */ + /** + * Sample code: Gets connection resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void getsConnectionResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.connections() + .getByResourceGroupWithResponse("testRG", "testConnection", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsLinkSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsLinkSamples.java new file mode 100644 index 0000000000000..456539c2b97b1 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsLinkSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.resourcemanager.datatransfer.models.ResourceBody; + +/** + * Samples for Connections Link. + */ +public final class ConnectionsLinkSamples { + /* + * x-ms-original-file: 2026-02-06-preview/linkConnection.json + */ + /** + * Sample code: Links the specified connection. + * + * @param manager Entry point to DataTransferManager. + */ + public static void linksTheSpecifiedConnection(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.connections() + .link("testRG", "testConnection", new ResourceBody().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.AzureDataTransfer/connections/testConnection"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsListByResourceGroupSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..ab6b8ec4ac719 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for Connections ListByResourceGroup. + */ +public final class ConnectionsListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-02-06-preview/listConnectionsByResourceGroup.json + */ + /** + * Sample code: Gets connections in a resource group. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + getsConnectionsInAResourceGroup(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.connections().listByResourceGroup("testRG", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsListBySubscriptionSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsListBySubscriptionSamples.java new file mode 100644 index 0000000000000..a202db869bc72 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsListBySubscriptionSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for Connections ListBySubscription. + */ +public final class ConnectionsListBySubscriptionSamples { + /* + * x-ms-original-file: 2026-02-06-preview/listConnectionsBySubscription.json + */ + /** + * Sample code: Gets connections in a subscription. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + getsConnectionsInASubscription(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.connections().listBySubscription(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsListPendingFlowsListSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsListPendingFlowsListSamples.java new file mode 100644 index 0000000000000..ca9c5d90b08cc --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsListPendingFlowsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for Connections ListPendingFlowsList. + */ +public final class ConnectionsListPendingFlowsListSamples { + /* + * x-ms-original-file: 2026-02-06-preview/listPendingFlows.json + */ + /** + * Sample code: Lists a list of pending flows. + * + * @param manager Entry point to DataTransferManager. + */ + public static void listsAListOfPendingFlows(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.connections().listPendingFlowsList("testRG", "testConnection", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsListSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsListSamples.java new file mode 100644 index 0000000000000..a80fdbba578db --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for Connections List. + */ +public final class ConnectionsListSamples { + /* + * x-ms-original-file: 2026-02-06-preview/listPendingConnections.json + */ + /** + * Sample code: Lists a list of pending connections. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + listsAListOfPendingConnections(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.connections().list("testRG", "testConnection", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsUpdateSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsUpdateSamples.java new file mode 100644 index 0000000000000..9dbf6510fb073 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsUpdateSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.resourcemanager.datatransfer.models.ConnectionsPatch; + +/** + * Samples for Connections Update. + */ +public final class ConnectionsUpdateSamples { + /* + * x-ms-original-file: 2026-02-06-preview/patchConnection.json + */ + /** + * Sample code: Updates the connection resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + updatesTheConnectionResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.connections() + .update("testRG", "testConnection", new ConnectionsPatch(), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesCreateOrUpdateSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..dac53d66d9208 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesCreateOrUpdateSamples.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.resourcemanager.datatransfer.models.AntivirusRuleset; +import com.azure.resourcemanager.datatransfer.models.AntivirusSolutions; +import com.azure.resourcemanager.datatransfer.models.ArchiveRuleset; +import com.azure.resourcemanager.datatransfer.models.Casing; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.DataSizeRuleset; +import com.azure.resourcemanager.datatransfer.models.FilterType; +import com.azure.resourcemanager.datatransfer.models.FlowProfileProperties; +import com.azure.resourcemanager.datatransfer.models.FlowProfileRulesets; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.MatchType; +import com.azure.resourcemanager.datatransfer.models.MimeFilterRuleset; +import com.azure.resourcemanager.datatransfer.models.MimeTypeFilter; +import com.azure.resourcemanager.datatransfer.models.TextMatchingRuleset; +import com.azure.resourcemanager.datatransfer.models.TextMatchingRulesetDeny; +import com.azure.resourcemanager.datatransfer.models.XmlFilterRuleset; +import com.azure.resourcemanager.datatransfer.models.XmlReferenceType; +import java.util.Arrays; + +/** + * Samples for FlowProfiles CreateOrUpdate. + */ +public final class FlowProfilesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-02-06-preview/createOrUpdateFlowProfile.json + */ + /** + * Sample code: Creates or updates the FlowPRofile resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + createsOrUpdatesTheFlowPRofileResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flowProfiles() + .define("testFlowProfile") + .withRegion("East US") + .withExistingPipeline("testRG", "testPipeline") + .withProperties(new FlowProfileProperties().withReplicationScenario(DataClassType.FILES) + .withStatus(FlowProfileStatus.ENABLED) + .withDescription("Hello world description") + .withRulesets(new FlowProfileRulesets() + .withAntivirus(new AntivirusRuleset() + .withAvSolutions(Arrays.asList(AntivirusSolutions.DEFENDER, AntivirusSolutions.CLAM_AV))) + .withArchives(new ArchiveRuleset().withMinimumSizeForExpansion(1L) + .withMaximumExpansionSizeLimit(123456L) + .withMaximumDepthLimit(12L) + .withMaximumCompressionRatioLimit(123.0D)) + .withDataSize(new DataSizeRuleset().withMaximum(123456789L).withMinimum(1L)) + .withMimeFilters(new MimeFilterRuleset().withType(FilterType.ALLOW) + .withFilters(Arrays.asList(new MimeTypeFilter().withMedia("application/json") + .withExtensions(Arrays.asList(".json", ".app", ".js"))))) + .withXmlFilters(new XmlFilterRuleset().withDefaultNamespace("testnamespace") + .withReference(XmlReferenceType.INLINE) + .withSchema( + " ")) + .withTextMatching(new TextMatchingRuleset().withDeny(Arrays.asList( + new TextMatchingRulesetDeny().withText("hello world") + .withMatchType(MatchType.PARTIAL) + .withCaseSensitivity(Casing.INSENSITIVE), + new TextMatchingRulesetDeny().withText("hello") + .withMatchType(MatchType.COMPLETE) + .withCaseSensitivity(Casing.SENSITIVE)))))) + .create(); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesDeleteSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesDeleteSamples.java new file mode 100644 index 0000000000000..a382537cb988a --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for FlowProfiles Delete. + */ +public final class FlowProfilesDeleteSamples { + /* + * x-ms-original-file: 2026-02-06-preview/deleteFlowProfile.json + */ + /** + * Sample code: Deletes the flowprofile resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + deletesTheFlowprofileResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flowProfiles().delete("testRG", "testPipeline", "testFlowProfile", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesGetSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesGetSamples.java new file mode 100644 index 0000000000000..adf7abb00e28b --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for FlowProfiles Get. + */ +public final class FlowProfilesGetSamples { + /* + * x-ms-original-file: 2026-02-06-preview/getFlowProfile.json + */ + /** + * Sample code: Gets flowprofile resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void getsFlowprofileResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flowProfiles() + .getWithResponse("testRG", "testPipeline", "testFlowProfile", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesListByPipelineSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesListByPipelineSamples.java new file mode 100644 index 0000000000000..39304641301ff --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesListByPipelineSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for FlowProfiles ListByPipeline. + */ +public final class FlowProfilesListByPipelineSamples { + /* + * x-ms-original-file: 2026-02-06-preview/listFlowProfilesByPipeline.json + */ + /** + * Sample code: Gets flows in a connection. + * + * @param manager Entry point to DataTransferManager. + */ + public static void getsFlowsInAConnection(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flowProfiles().listByPipeline("testRG", "testPipeline", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesUpdateSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesUpdateSamples.java new file mode 100644 index 0000000000000..2ee12a8e93899 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.resourcemanager.datatransfer.models.FlowProfile; + +/** + * Samples for FlowProfiles Update. + */ +public final class FlowProfilesUpdateSamples { + /* + * x-ms-original-file: 2026-02-06-preview/patchFlowProfile.json + */ + /** + * Sample code: Updates the flowprofile resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + updatesTheFlowprofileResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + FlowProfile resource = manager.flowProfiles() + .getWithResponse("testRG", "testPipeline", "testFlowProfile", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsCreateOrUpdateSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..379a374b18956 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsCreateOrUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.resourcemanager.datatransfer.fluent.models.FlowPropertiesInner; +import com.azure.resourcemanager.datatransfer.models.DataClass; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.FlowProfileMetadata; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.SelectedResource; + +/** + * Samples for Flows CreateOrUpdate. + */ +public final class FlowsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-02-06-preview/createOrUpdateFlow.json + */ + /** + * Sample code: Creates or updates the flow resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + createsOrUpdatesTheFlowResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows() + .define("testFlow") + .withRegion("East US") + .withExistingConnection("testRG", "testConnection") + .withProperties(new FlowPropertiesInner().withConnection(new SelectedResource().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.AzureDataTransfer/connections/testConnection")) + .withStorageAccountName("testsa") + .withStorageContainerName("testcontainer") + .withFlowProfile(new FlowProfileMetadata().withPipeline("testPipeline") + .withName("flowProfileName") + .withReplicationScenario(DataClassType.FILES) + .withFlowProfileId("25f2c41a-6e29-4c40-a033-b4de81d4a681") + .withStatus(FlowProfileStatus.ENABLED) + .withDescription("Testing 123")) + .withFlowDataType(DataClass.BLOB)) + .create(); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsDeleteSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsDeleteSamples.java new file mode 100644 index 0000000000000..c7db2268d9aed --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for Flows Delete. + */ +public final class FlowsDeleteSamples { + /* + * x-ms-original-file: 2026-02-06-preview/deleteFlow.json + */ + /** + * Sample code: Deletes the flow resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void deletesTheFlowResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows().delete("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsDisableSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsDisableSamples.java new file mode 100644 index 0000000000000..b4827779f110c --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsDisableSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for Flows Disable. + */ +public final class FlowsDisableSamples { + /* + * x-ms-original-file: 2026-02-06-preview/disableFlow.json + */ + /** + * Sample code: Disables the specified flow. + * + * @param manager Entry point to DataTransferManager. + */ + public static void disablesTheSpecifiedFlow(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows().disable("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsEnableSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsEnableSamples.java new file mode 100644 index 0000000000000..e3e1c591cab3f --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsEnableSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for Flows Enable. + */ +public final class FlowsEnableSamples { + /* + * x-ms-original-file: 2026-02-06-preview/enableFlow.json + */ + /** + * Sample code: Enables the specified flow. + * + * @param manager Entry point to DataTransferManager. + */ + public static void enablesTheSpecifiedFlow(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows().enable("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsGeneratePassphraseSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsGeneratePassphraseSamples.java new file mode 100644 index 0000000000000..a1d50318696df --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsGeneratePassphraseSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for Flows GeneratePassphrase. + */ +public final class FlowsGeneratePassphraseSamples { + /* + * x-ms-original-file: 2026-02-06-preview/generateFlowPassphrase.json + */ + /** + * Sample code: Generate a new compliant streaming passphrase. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + generateANewCompliantStreamingPassphrase(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows().generatePassphrase("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetDestinationEndpointPortsSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetDestinationEndpointPortsSamples.java new file mode 100644 index 0000000000000..27fc2c0d30a97 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetDestinationEndpointPortsSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for Flows GetDestinationEndpointPorts. + */ +public final class FlowsGetDestinationEndpointPortsSamples { + /* + * x-ms-original-file: 2026-02-06-preview/getFlowDestinationEndpointPorts.json + */ + /** + * Sample code: Get the flow stream destination endpoint ports. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + getTheFlowStreamDestinationEndpointPorts(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows() + .getDestinationEndpointPortsWithResponse("testRG", "testConnection", "testFlow", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetDestinationEndpointsSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetDestinationEndpointsSamples.java new file mode 100644 index 0000000000000..21f0d2bf15cb9 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetDestinationEndpointsSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for Flows GetDestinationEndpoints. + */ +public final class FlowsGetDestinationEndpointsSamples { + /* + * x-ms-original-file: 2026-02-06-preview/getFlowDestinationEndpoints.json + */ + /** + * Sample code: Get the flow stream destination endpoints. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + getTheFlowStreamDestinationEndpoints(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows() + .getDestinationEndpointsWithResponse("testRG", "testConnection", "testFlow", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetSamples.java new file mode 100644 index 0000000000000..4bd0508654e75 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for Flows Get. + */ +public final class FlowsGetSamples { + /* + * x-ms-original-file: 2026-02-06-preview/getFlow.json + */ + /** + * Sample code: Gets flow resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void getsFlowResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows().getWithResponse("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetSourceAddressesSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetSourceAddressesSamples.java new file mode 100644 index 0000000000000..096c7e572578f --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetSourceAddressesSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for Flows GetSourceAddresses. + */ +public final class FlowsGetSourceAddressesSamples { + /* + * x-ms-original-file: 2026-02-06-preview/getFlowSourceAddresses.json + */ + /** + * Sample code: Get the flow stream source addresses. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + getTheFlowStreamSourceAddresses(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows() + .getSourceAddressesWithResponse("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetStreamConnectionStringSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetStreamConnectionStringSamples.java new file mode 100644 index 0000000000000..2646aaa64d552 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetStreamConnectionStringSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for Flows GetStreamConnectionString. + */ +public final class FlowsGetStreamConnectionStringSamples { + /* + * x-ms-original-file: 2026-02-06-preview/getStreamConnectionString.json + */ + /** + * Sample code: Get the flow stream connection string. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + getTheFlowStreamConnectionString(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows() + .getStreamConnectionStringWithResponse("testRG", "testConnection", "testFlow", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsLinkSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsLinkSamples.java new file mode 100644 index 0000000000000..1e6c1a696982a --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsLinkSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.resourcemanager.datatransfer.models.ResourceBody; + +/** + * Samples for Flows Link. + */ +public final class FlowsLinkSamples { + /* + * x-ms-original-file: 2026-02-06-preview/linkFlow.json + */ + /** + * Sample code: Links the specified flow. + * + * @param manager Entry point to DataTransferManager. + */ + public static void linksTheSpecifiedFlow(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows() + .link("testRG", "testConnection", "testFlow", new ResourceBody().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.AzureDataTransfer/connections/testConnection/flows/testFlow"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsListByConnectionSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsListByConnectionSamples.java new file mode 100644 index 0000000000000..51f5635b060c7 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsListByConnectionSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for Flows ListByConnection. + */ +public final class FlowsListByConnectionSamples { + /* + * x-ms-original-file: 2026-02-06-preview/listFlowsByConnection.json + */ + /** + * Sample code: Gets flows in a connection. + * + * @param manager Entry point to DataTransferManager. + */ + public static void getsFlowsInAConnection(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows().listByConnection("testRG", "testConnection", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsSetDestinationEndpointPortsSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsSetDestinationEndpointPortsSamples.java new file mode 100644 index 0000000000000..7ffa4a10f6b46 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsSetDestinationEndpointPortsSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.resourcemanager.datatransfer.models.SetDestinationEndpointPorts; +import java.util.Arrays; + +/** + * Samples for Flows SetDestinationEndpointPorts. + */ +public final class FlowsSetDestinationEndpointPortsSamples { + /* + * x-ms-original-file: 2026-02-06-preview/setFlowDestinationEndpointPorts.json + */ + /** + * Sample code: Set the flow stream destination endpoint ports. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + setTheFlowStreamDestinationEndpointPorts(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows() + .setDestinationEndpointPorts("testRG", "testConnection", "testFlow", + new SetDestinationEndpointPorts().withPorts(Arrays.asList(1234L)), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsSetDestinationEndpointsSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsSetDestinationEndpointsSamples.java new file mode 100644 index 0000000000000..9c19e8d1c4cf7 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsSetDestinationEndpointsSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.resourcemanager.datatransfer.models.SetDestinationEndpoints; +import java.util.Arrays; + +/** + * Samples for Flows SetDestinationEndpoints. + */ +public final class FlowsSetDestinationEndpointsSamples { + /* + * x-ms-original-file: 2026-02-06-preview/setFlowDestinationEndpoints.json + */ + /** + * Sample code: Set the flow stream destination endpoints. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + setTheFlowStreamDestinationEndpoints(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows() + .setDestinationEndpoints("testRG", "testConnection", "testFlow", + new SetDestinationEndpoints().withEndpoints(Arrays.asList("10.0.0.1")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsSetPassphraseSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsSetPassphraseSamples.java new file mode 100644 index 0000000000000..15ddb01c76fd8 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsSetPassphraseSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.resourcemanager.datatransfer.models.SetStreamPassphrase; + +/** + * Samples for Flows SetPassphrase. + */ +public final class FlowsSetPassphraseSamples { + /* + * x-ms-original-file: 2026-02-06-preview/setFlowPassphrase.json + */ + /** + * Sample code: Set the flow stream passphrase. + * + * @param manager Entry point to DataTransferManager. + */ + public static void setTheFlowStreamPassphrase(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows() + .setPassphrase("testRG", "testConnection", "testFlow", new SetStreamPassphrase().withValue("password123"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsSetSourceAddressesSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsSetSourceAddressesSamples.java new file mode 100644 index 0000000000000..f847127a810bd --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsSetSourceAddressesSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.resourcemanager.datatransfer.models.SetSourceAddresses; +import java.util.Arrays; + +/** + * Samples for Flows SetSourceAddresses. + */ +public final class FlowsSetSourceAddressesSamples { + /* + * x-ms-original-file: 2026-02-06-preview/setFlowSourceAddresses.json + */ + /** + * Sample code: Set the flow stream source addresses. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + setTheFlowStreamSourceAddresses(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows() + .setSourceAddresses("testRG", "testConnection", "testFlow", + new SetSourceAddresses().withValues(Arrays.asList("0.0.0.0", "1.0.0.0/24")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsUpdateSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsUpdateSamples.java new file mode 100644 index 0000000000000..c60798a402dad --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/FlowsUpdateSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.resourcemanager.datatransfer.models.FlowsPatch; + +/** + * Samples for Flows Update. + */ +public final class FlowsUpdateSamples { + /* + * x-ms-original-file: 2026-02-06-preview/patchFlow.json + */ + /** + * Sample code: Updates the flow resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void updatesTheFlowResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.flows() + .update("testRG", "testConnection", "testFlow", new FlowsPatch(), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/OperationsListSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..e7b580a36de10 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2026-02-06-preview/listOperations.json + */ + /** + * Sample code: List operations. + * + * @param manager Entry point to DataTransferManager. + */ + public static void listOperations(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesApproveConnectionSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesApproveConnectionSamples.java new file mode 100644 index 0000000000000..3a8df4e8d82ce --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesApproveConnectionSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.resourcemanager.datatransfer.models.ResourceBody; + +/** + * Samples for Pipelines ApproveConnection. + */ +public final class PipelinesApproveConnectionSamples { + /* + * x-ms-original-file: 2026-02-06-preview/approveConnection.json + */ + /** + * Sample code: Approves the specified connection in a pipeline. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + approvesTheSpecifiedConnectionInAPipeline(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.pipelines() + .approveConnection("testRG", "testPipeline", new ResourceBody().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.AzureDataTransfer/connections/testConnection") + .withStatusReason("Example reason"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesCreateOrUpdateSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..9704766520ee9 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesCreateOrUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.resourcemanager.datatransfer.models.PipelineProperties; + +/** + * Samples for Pipelines CreateOrUpdate. + */ +public final class PipelinesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-02-06-preview/createOrUpdatePipeline.json + */ + /** + * Sample code: Creates or updates the pipeline resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + createsOrUpdatesThePipelineResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.pipelines() + .define("testPipeline") + .withRegion("East US") + .withExistingResourceGroup("testRG") + .withProperties(new PipelineProperties().withRemoteCloud("testdc")) + .create(); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesDeleteSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesDeleteSamples.java new file mode 100644 index 0000000000000..8941fa0861b92 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for Pipelines Delete. + */ +public final class PipelinesDeleteSamples { + /* + * x-ms-original-file: 2026-02-06-preview/deletePipeline.json + */ + /** + * Sample code: Deletes the pipeline resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void deletesThePipelineResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.pipelines().delete("testRG", "testPipeline", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesExecuteActionSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesExecuteActionSamples.java new file mode 100644 index 0000000000000..f0b4404729ed0 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesExecuteActionSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.resourcemanager.datatransfer.models.Action; +import com.azure.resourcemanager.datatransfer.models.DateTransferActionType; +import com.azure.resourcemanager.datatransfer.models.TargetType; +import java.util.Arrays; + +/** + * Samples for Pipelines ExecuteAction. + */ +public final class PipelinesExecuteActionSamples { + /* + * x-ms-original-file: 2026-02-06-preview/executeAction.json + */ + /** + * Sample code: Executes action for a pipeline. + * + * @param manager Entry point to DataTransferManager. + */ + public static void executesActionForAPipeline(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.pipelines() + .executeAction("testRG", "testPipeline", new Action().withActionType(DateTransferActionType.FORCE_DISABLE) + .withTargetType(TargetType.CONNECTION) + .withTargets(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.AzureDataTransfer/connections/testConnection")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesGetByResourceGroupSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..50e7733417d54 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for Pipelines GetByResourceGroup. + */ +public final class PipelinesGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-02-06-preview/getPipeline.json + */ + /** + * Sample code: Gets pipeline resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void getsPipelineResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.pipelines().getByResourceGroupWithResponse("testRG", "testPipeline", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListByResourceGroupSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..ee7f668cb3beb --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for Pipelines ListByResourceGroup. + */ +public final class PipelinesListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-02-06-preview/listPipelinesByResourceGroup.json + */ + /** + * Sample code: Gets pipelines in a resource group. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + getsPipelinesInAResourceGroup(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.pipelines().listByResourceGroup("testRG", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListBySubscriptionSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListBySubscriptionSamples.java new file mode 100644 index 0000000000000..3bf40129c07a7 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListBySubscriptionSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +/** + * Samples for Pipelines ListBySubscription. + */ +public final class PipelinesListBySubscriptionSamples { + /* + * x-ms-original-file: 2026-02-06-preview/listPipelinesBySubscription.json + */ + /** + * Sample code: Gets pipelines in a subscription. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + getsPipelinesInASubscription(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.pipelines().listBySubscription(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListSamples.java new file mode 100644 index 0000000000000..787410541ce10 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.resourcemanager.datatransfer.models.ConnectionIdList; +import java.util.Arrays; + +/** + * Samples for Pipelines List. + */ +public final class PipelinesListSamples { + /* + * x-ms-original-file: 2026-02-06-preview/listFlowsByPipeline.json + */ + /** + * Sample code: Lists flows for a pipeline. + * + * @param manager Entry point to DataTransferManager. + */ + public static void listsFlowsForAPipeline(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.pipelines() + .listWithResponse("testRG", "testPipeline", new ConnectionIdList().withValue(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.AzureDataTransfer/connections/testConnection")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListSchemasListSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListSchemasListSamples.java new file mode 100644 index 0000000000000..c622ae7050e6b --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListSchemasListSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.resourcemanager.datatransfer.models.Schema; + +/** + * Samples for Pipelines ListSchemasList. + */ +public final class PipelinesListSchemasListSamples { + /* + * x-ms-original-file: 2026-02-06-preview/listSchemas.json + */ + /** + * Sample code: Lists schemas for a pipeline. + * + * @param manager Entry point to DataTransferManager. + */ + public static void listsSchemasForAPipeline(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.pipelines() + .listSchemasListWithResponse("testRG", "testPipeline", new Schema().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.AzureDataTransfer/connections/testConnection") + .withName("test.xsd"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesRejectConnectionSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesRejectConnectionSamples.java new file mode 100644 index 0000000000000..ac248fc5a77ab --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesRejectConnectionSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.resourcemanager.datatransfer.models.ResourceBody; + +/** + * Samples for Pipelines RejectConnection. + */ +public final class PipelinesRejectConnectionSamples { + /* + * x-ms-original-file: 2026-02-06-preview/rejectConnection.json + */ + /** + * Sample code: Rejects the specified connection in a pipeline. + * + * @param manager Entry point to DataTransferManager. + */ + public static void + rejectsTheSpecifiedConnectionInAPipeline(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.pipelines() + .rejectConnection("testRG", "testPipeline", new ResourceBody().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.AzureDataTransfer/connections/testConnection") + .withStatusReason("Example reason"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesUpdateSamples.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesUpdateSamples.java new file mode 100644 index 0000000000000..29a683c741a63 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/samples/java/com/azure/resourcemanager/datatransfer/generated/PipelinesUpdateSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.resourcemanager.datatransfer.models.PipelinesPatch; + +/** + * Samples for Pipelines Update. + */ +public final class PipelinesUpdateSamples { + /* + * x-ms-original-file: 2026-02-06-preview/patchPipeline.json + */ + /** + * Sample code: Updates the pipeline resource. + * + * @param manager Entry point to DataTransferManager. + */ + public static void updatesThePipelineResource(com.azure.resourcemanager.datatransfer.DataTransferManager manager) { + manager.pipelines().update("testRG", "testPipeline", new PipelinesPatch(), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ActionTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ActionTests.java new file mode 100644 index 0000000000000..0ef956feb28f7 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ActionTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.Action; +import com.azure.resourcemanager.datatransfer.models.DateTransferActionType; +import com.azure.resourcemanager.datatransfer.models.TargetType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ActionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Action model = BinaryData.fromString( + "{\"actionType\":\"ForceDisable\",\"targetType\":\"Connection\",\"targets\":[\"pgvmpipaslthaqfx\"],\"justification\":\"mwutwbdsre\"}") + .toObject(Action.class); + Assertions.assertEquals(DateTransferActionType.FORCE_DISABLE, model.actionType()); + Assertions.assertEquals(TargetType.CONNECTION, model.targetType()); + Assertions.assertEquals("pgvmpipaslthaqfx", model.targets().get(0)); + Assertions.assertEquals("mwutwbdsre", model.justification()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Action model = new Action().withActionType(DateTransferActionType.FORCE_DISABLE) + .withTargetType(TargetType.CONNECTION) + .withTargets(Arrays.asList("pgvmpipaslthaqfx")) + .withJustification("mwutwbdsre"); + model = BinaryData.fromObject(model).toObject(Action.class); + Assertions.assertEquals(DateTransferActionType.FORCE_DISABLE, model.actionType()); + Assertions.assertEquals(TargetType.CONNECTION, model.targetType()); + Assertions.assertEquals("pgvmpipaslthaqfx", model.targets().get(0)); + Assertions.assertEquals("mwutwbdsre", model.justification()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/AntivirusRulesetTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/AntivirusRulesetTests.java new file mode 100644 index 0000000000000..d70137e62e708 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/AntivirusRulesetTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.AntivirusRuleset; +import com.azure.resourcemanager.datatransfer.models.AntivirusSolutions; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class AntivirusRulesetTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AntivirusRuleset model = BinaryData.fromString("{\"avSolutions\":[\"Defender\",\"Defender\",\"ClamAv\"]}") + .toObject(AntivirusRuleset.class); + Assertions.assertEquals(AntivirusSolutions.DEFENDER, model.avSolutions().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AntivirusRuleset model = new AntivirusRuleset().withAvSolutions( + Arrays.asList(AntivirusSolutions.DEFENDER, AntivirusSolutions.DEFENDER, AntivirusSolutions.CLAM_AV)); + model = BinaryData.fromObject(model).toObject(AntivirusRuleset.class); + Assertions.assertEquals(AntivirusSolutions.DEFENDER, model.avSolutions().get(0)); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ApiFlowOptionsTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ApiFlowOptionsTests.java new file mode 100644 index 0000000000000..75581a1689b52 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ApiFlowOptionsTests.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.ApiFlowOptions; +import com.azure.resourcemanager.datatransfer.models.ApiMode; +import com.azure.resourcemanager.datatransfer.models.Authentication; +import com.azure.resourcemanager.datatransfer.models.AuthenticationType; +import com.azure.resourcemanager.datatransfer.models.IdentityTranslation; +import com.azure.resourcemanager.datatransfer.models.RemoteEndpointSettings; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ApiFlowOptionsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ApiFlowOptions model = BinaryData.fromString( + "{\"remoteEndpoint\":\"semdwzrmu\",\"cname\":\"pfcqdp\",\"apiMode\":\"SDK\",\"identityTranslation\":\"ServiceIdentity\",\"senderClientId\":\"svuo\",\"remoteCallingModeClientId\":\"gc\",\"audienceOverride\":\"lvez\",\"authentication\":[{\"type\":\"None\",\"instance\":\"feo\",\"tenantId\":\"rqwky\",\"authority\":\"ob\",\"applicationIds\":[\"xedk\",\"wep\"],\"audience\":\"pc\",\"clientIdOverride\":\"kbwcc\",\"identityTranslation\":\"ServiceIdentity\"},{\"type\":\"JWT\",\"instance\":\"wxlp\",\"tenantId\":\"kftnkhtjsyin\",\"authority\":\"fq\",\"applicationIds\":[\"tdhtmdvyp\"],\"audience\":\"kdgszywkbirr\",\"clientIdOverride\":\"zh\",\"identityTranslation\":\"UserIdentity\"}],\"remoteEndpointSettings\":{\"endpoint\":\"oqrvqqaatjin\",\"authentication\":[{\"type\":\"None\",\"instance\":\"mfiibfggj\",\"tenantId\":\"olvrw\",\"authority\":\"v\",\"applicationIds\":[\"gllqwjy\"],\"audience\":\"jayvblmhv\",\"clientIdOverride\":\"uhbxvvy\",\"identityTranslation\":\"UserIdentity\"},{\"type\":\"None\",\"instance\":\"yrqufegxuvwz\",\"tenantId\":\"nhlmctlpdng\",\"authority\":\"vgbmhr\",\"applicationIds\":[\"wmyijejveg\"],\"audience\":\"bpnaixexccbdre\",\"clientIdOverride\":\"hcexdrrvqa\",\"identityTranslation\":\"ServiceIdentity\"},{\"type\":\"JWT\",\"instance\":\"pwijnhy\",\"tenantId\":\"vfycxzb\",\"authority\":\"oowvrv\",\"applicationIds\":[\"jqppyostronzmy\",\"gfipnsxk\"],\"audience\":\"waekrrjreafxtsgu\",\"clientIdOverride\":\"jglikkxwslolb\",\"identityTranslation\":\"UserIdentity\"}]}}") + .toObject(ApiFlowOptions.class); + Assertions.assertEquals("semdwzrmu", model.remoteEndpoint()); + Assertions.assertEquals("pfcqdp", model.cname()); + Assertions.assertEquals(ApiMode.SDK, model.apiMode()); + Assertions.assertEquals(IdentityTranslation.SERVICE_IDENTITY, model.identityTranslation()); + Assertions.assertEquals("svuo", model.senderClientId()); + Assertions.assertEquals("gc", model.remoteCallingModeClientId()); + Assertions.assertEquals("lvez", model.audienceOverride()); + Assertions.assertEquals(AuthenticationType.NONE, model.authentication().get(0).type()); + Assertions.assertEquals("feo", model.authentication().get(0).instance()); + Assertions.assertEquals("rqwky", model.authentication().get(0).tenantId()); + Assertions.assertEquals("ob", model.authentication().get(0).authority()); + Assertions.assertEquals("xedk", model.authentication().get(0).applicationIds().get(0)); + Assertions.assertEquals("pc", model.authentication().get(0).audience()); + Assertions.assertEquals("kbwcc", model.authentication().get(0).clientIdOverride()); + Assertions.assertEquals(IdentityTranslation.SERVICE_IDENTITY, + model.authentication().get(0).identityTranslation()); + Assertions.assertEquals("oqrvqqaatjin", model.remoteEndpointSettings().endpoint()); + Assertions.assertEquals(AuthenticationType.NONE, model.remoteEndpointSettings().authentication().get(0).type()); + Assertions.assertEquals("mfiibfggj", model.remoteEndpointSettings().authentication().get(0).instance()); + Assertions.assertEquals("olvrw", model.remoteEndpointSettings().authentication().get(0).tenantId()); + Assertions.assertEquals("v", model.remoteEndpointSettings().authentication().get(0).authority()); + Assertions.assertEquals("gllqwjy", + model.remoteEndpointSettings().authentication().get(0).applicationIds().get(0)); + Assertions.assertEquals("jayvblmhv", model.remoteEndpointSettings().authentication().get(0).audience()); + Assertions.assertEquals("uhbxvvy", model.remoteEndpointSettings().authentication().get(0).clientIdOverride()); + Assertions.assertEquals(IdentityTranslation.USER_IDENTITY, + model.remoteEndpointSettings().authentication().get(0).identityTranslation()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ApiFlowOptions model = new ApiFlowOptions().withRemoteEndpoint("semdwzrmu") + .withCname("pfcqdp") + .withApiMode(ApiMode.SDK) + .withIdentityTranslation(IdentityTranslation.SERVICE_IDENTITY) + .withSenderClientId("svuo") + .withRemoteCallingModeClientId("gc") + .withAudienceOverride("lvez") + .withAuthentication(Arrays.asList( + new Authentication().withType(AuthenticationType.NONE) + .withInstance("feo") + .withTenantId("rqwky") + .withAuthority("ob") + .withApplicationIds(Arrays.asList("xedk", "wep")) + .withAudience("pc") + .withClientIdOverride("kbwcc") + .withIdentityTranslation(IdentityTranslation.SERVICE_IDENTITY), + new Authentication().withType(AuthenticationType.JWT) + .withInstance("wxlp") + .withTenantId("kftnkhtjsyin") + .withAuthority("fq") + .withApplicationIds(Arrays.asList("tdhtmdvyp")) + .withAudience("kdgszywkbirr") + .withClientIdOverride("zh") + .withIdentityTranslation(IdentityTranslation.USER_IDENTITY))) + .withRemoteEndpointSettings(new RemoteEndpointSettings().withEndpoint("oqrvqqaatjin") + .withAuthentication(Arrays.asList( + new Authentication().withType(AuthenticationType.NONE) + .withInstance("mfiibfggj") + .withTenantId("olvrw") + .withAuthority("v") + .withApplicationIds(Arrays.asList("gllqwjy")) + .withAudience("jayvblmhv") + .withClientIdOverride("uhbxvvy") + .withIdentityTranslation(IdentityTranslation.USER_IDENTITY), + new Authentication().withType(AuthenticationType.NONE) + .withInstance("yrqufegxuvwz") + .withTenantId("nhlmctlpdng") + .withAuthority("vgbmhr") + .withApplicationIds(Arrays.asList("wmyijejveg")) + .withAudience("bpnaixexccbdre") + .withClientIdOverride("hcexdrrvqa") + .withIdentityTranslation(IdentityTranslation.SERVICE_IDENTITY), + new Authentication().withType(AuthenticationType.JWT) + .withInstance("pwijnhy") + .withTenantId("vfycxzb") + .withAuthority("oowvrv") + .withApplicationIds(Arrays.asList("jqppyostronzmy", "gfipnsxk")) + .withAudience("waekrrjreafxtsgu") + .withClientIdOverride("jglikkxwslolb") + .withIdentityTranslation(IdentityTranslation.USER_IDENTITY)))); + model = BinaryData.fromObject(model).toObject(ApiFlowOptions.class); + Assertions.assertEquals("semdwzrmu", model.remoteEndpoint()); + Assertions.assertEquals("pfcqdp", model.cname()); + Assertions.assertEquals(ApiMode.SDK, model.apiMode()); + Assertions.assertEquals(IdentityTranslation.SERVICE_IDENTITY, model.identityTranslation()); + Assertions.assertEquals("svuo", model.senderClientId()); + Assertions.assertEquals("gc", model.remoteCallingModeClientId()); + Assertions.assertEquals("lvez", model.audienceOverride()); + Assertions.assertEquals(AuthenticationType.NONE, model.authentication().get(0).type()); + Assertions.assertEquals("feo", model.authentication().get(0).instance()); + Assertions.assertEquals("rqwky", model.authentication().get(0).tenantId()); + Assertions.assertEquals("ob", model.authentication().get(0).authority()); + Assertions.assertEquals("xedk", model.authentication().get(0).applicationIds().get(0)); + Assertions.assertEquals("pc", model.authentication().get(0).audience()); + Assertions.assertEquals("kbwcc", model.authentication().get(0).clientIdOverride()); + Assertions.assertEquals(IdentityTranslation.SERVICE_IDENTITY, + model.authentication().get(0).identityTranslation()); + Assertions.assertEquals("oqrvqqaatjin", model.remoteEndpointSettings().endpoint()); + Assertions.assertEquals(AuthenticationType.NONE, model.remoteEndpointSettings().authentication().get(0).type()); + Assertions.assertEquals("mfiibfggj", model.remoteEndpointSettings().authentication().get(0).instance()); + Assertions.assertEquals("olvrw", model.remoteEndpointSettings().authentication().get(0).tenantId()); + Assertions.assertEquals("v", model.remoteEndpointSettings().authentication().get(0).authority()); + Assertions.assertEquals("gllqwjy", + model.remoteEndpointSettings().authentication().get(0).applicationIds().get(0)); + Assertions.assertEquals("jayvblmhv", model.remoteEndpointSettings().authentication().get(0).audience()); + Assertions.assertEquals("uhbxvvy", model.remoteEndpointSettings().authentication().get(0).clientIdOverride()); + Assertions.assertEquals(IdentityTranslation.USER_IDENTITY, + model.remoteEndpointSettings().authentication().get(0).identityTranslation()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ArchiveRulesetTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ArchiveRulesetTests.java new file mode 100644 index 0000000000000..cda1468d6d608 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ArchiveRulesetTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.ArchiveRuleset; +import org.junit.jupiter.api.Assertions; + +public final class ArchiveRulesetTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ArchiveRuleset model = BinaryData.fromString( + "{\"minimumSizeForExpansion\":1140250228405168,\"maximumExpansionSizeLimit\":3834014588009600234,\"maximumDepthLimit\":7731827269478530135,\"maximumCompressionRatioLimit\":20.09751560915065}") + .toObject(ArchiveRuleset.class); + Assertions.assertEquals(1140250228405168L, model.minimumSizeForExpansion()); + Assertions.assertEquals(3834014588009600234L, model.maximumExpansionSizeLimit()); + Assertions.assertEquals(7731827269478530135L, model.maximumDepthLimit()); + Assertions.assertEquals(20.09751560915065D, model.maximumCompressionRatioLimit()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ArchiveRuleset model = new ArchiveRuleset().withMinimumSizeForExpansion(1140250228405168L) + .withMaximumExpansionSizeLimit(3834014588009600234L) + .withMaximumDepthLimit(7731827269478530135L) + .withMaximumCompressionRatioLimit(20.09751560915065D); + model = BinaryData.fromObject(model).toObject(ArchiveRuleset.class); + Assertions.assertEquals(1140250228405168L, model.minimumSizeForExpansion()); + Assertions.assertEquals(3834014588009600234L, model.maximumExpansionSizeLimit()); + Assertions.assertEquals(7731827269478530135L, model.maximumDepthLimit()); + Assertions.assertEquals(20.09751560915065D, model.maximumCompressionRatioLimit()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/AuthenticationTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/AuthenticationTests.java new file mode 100644 index 0000000000000..51f40b1246ab2 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/AuthenticationTests.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.Authentication; +import com.azure.resourcemanager.datatransfer.models.AuthenticationType; +import com.azure.resourcemanager.datatransfer.models.IdentityTranslation; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class AuthenticationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Authentication model = BinaryData.fromString( + "{\"type\":\"None\",\"instance\":\"m\",\"tenantId\":\"elfk\",\"authority\":\"plcrpwjxeznoig\",\"applicationIds\":[\"jwmwkpnbs\",\"zejjoqk\",\"gfhsxttaugzxn\",\"aa\"],\"audience\":\"xdtnkdmkqjjlw\",\"clientIdOverride\":\"nvrk\",\"identityTranslation\":\"UserIdentity\"}") + .toObject(Authentication.class); + Assertions.assertEquals(AuthenticationType.NONE, model.type()); + Assertions.assertEquals("m", model.instance()); + Assertions.assertEquals("elfk", model.tenantId()); + Assertions.assertEquals("plcrpwjxeznoig", model.authority()); + Assertions.assertEquals("jwmwkpnbs", model.applicationIds().get(0)); + Assertions.assertEquals("xdtnkdmkqjjlw", model.audience()); + Assertions.assertEquals("nvrk", model.clientIdOverride()); + Assertions.assertEquals(IdentityTranslation.USER_IDENTITY, model.identityTranslation()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Authentication model = new Authentication().withType(AuthenticationType.NONE) + .withInstance("m") + .withTenantId("elfk") + .withAuthority("plcrpwjxeznoig") + .withApplicationIds(Arrays.asList("jwmwkpnbs", "zejjoqk", "gfhsxttaugzxn", "aa")) + .withAudience("xdtnkdmkqjjlw") + .withClientIdOverride("nvrk") + .withIdentityTranslation(IdentityTranslation.USER_IDENTITY); + model = BinaryData.fromObject(model).toObject(Authentication.class); + Assertions.assertEquals(AuthenticationType.NONE, model.type()); + Assertions.assertEquals("m", model.instance()); + Assertions.assertEquals("elfk", model.tenantId()); + Assertions.assertEquals("plcrpwjxeznoig", model.authority()); + Assertions.assertEquals("jwmwkpnbs", model.applicationIds().get(0)); + Assertions.assertEquals("xdtnkdmkqjjlw", model.audience()); + Assertions.assertEquals("nvrk", model.clientIdOverride()); + Assertions.assertEquals(IdentityTranslation.USER_IDENTITY, model.identityTranslation()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransfersListApprovedSchemasWithResponseMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransfersListApprovedSchemasWithResponseMockTests.java new file mode 100644 index 0000000000000..4f46dd75c52e4 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransfersListApprovedSchemasWithResponseMockTests.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.Direction; +import com.azure.resourcemanager.datatransfer.models.ListApprovedSchemasRequest; +import com.azure.resourcemanager.datatransfer.models.SchemaStatus; +import com.azure.resourcemanager.datatransfer.models.SchemaType; +import com.azure.resourcemanager.datatransfer.models.SchemasListResult; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AzureDataTransfersListApprovedSchemasWithResponseMockTests { + @Test + public void testListApprovedSchemasWithResponse() throws Exception { + String responseStr + = "{\"value\":[{\"id\":\"aodkwwnbafoc\",\"connectionId\":\"hzhaquvwsxb\",\"status\":\"Approved\",\"name\":\"ervqchoadhrsxqvz\",\"content\":\"pabdsrg\",\"direction\":\"Receive\",\"schemaUri\":\"lzrsub\",\"schemaType\":\"Zip\"},{\"id\":\"hjnlt\",\"connectionId\":\"tjdvqydieqqkwa\",\"status\":\"Approved\",\"name\":\"xv\",\"content\":\"xoebwg\",\"direction\":\"Send\",\"schemaUri\":\"banbaupwtzv\",\"schemaType\":\"Xsd\"},{\"id\":\"ozkxbzrpejplss\",\"connectionId\":\"bttt\",\"status\":\"New\",\"name\":\"xunrswgkpjhboy\",\"content\":\"ebhuhkslgwlokhu\",\"direction\":\"Receive\",\"schemaUri\":\"yzcqypzqzufg\",\"schemaType\":\"Zip\"},{\"id\":\"jyvdwtfxptpqayam\",\"connectionId\":\"cf\",\"status\":\"New\",\"name\":\"xsnxocuullojk\",\"content\":\"yhgww\",\"direction\":\"Receive\",\"schemaUri\":\"dbdljz\",\"schemaType\":\"Zip\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + SchemasListResult response = manager.azureDataTransfers() + .listApprovedSchemasWithResponse( + new ListApprovedSchemasRequest().withPipeline("knpdgzigjsu").withDirection(Direction.RECEIVE), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("aodkwwnbafoc", response.value().get(0).id()); + Assertions.assertEquals("hzhaquvwsxb", response.value().get(0).connectionId()); + Assertions.assertEquals(SchemaStatus.APPROVED, response.value().get(0).status()); + Assertions.assertEquals("ervqchoadhrsxqvz", response.value().get(0).name()); + Assertions.assertEquals("pabdsrg", response.value().get(0).content()); + Assertions.assertEquals(Direction.RECEIVE, response.value().get(0).direction()); + Assertions.assertEquals("lzrsub", response.value().get(0).schemaUri()); + Assertions.assertEquals(SchemaType.ZIP, response.value().get(0).schemaType()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransfersListFlowProfilesWithResponseMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransfersListFlowProfilesWithResponseMockTests.java new file mode 100644 index 0000000000000..bfa468d16e771 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransfersListFlowProfilesWithResponseMockTests.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.FlowProfilesListResult; +import com.azure.resourcemanager.datatransfer.models.ListFlowProfilesRequest; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AzureDataTransfersListFlowProfilesWithResponseMockTests { + @Test + public void testListFlowProfilesWithResponse() throws Exception { + String responseStr + = "{\"value\":[{\"pipeline\":\"zlrqhbjnqogdx\",\"name\":\"bsfp\",\"replicationScenario\":\"Stream\",\"flowProfileId\":\"x\",\"status\":\"Enabled\",\"description\":\"lflec\"},{\"pipeline\":\"minxojjluxxdh\",\"name\":\"lzzdz\",\"replicationScenario\":\"Complex\",\"flowProfileId\":\"jmueza\",\"status\":\"Obsolete\",\"description\":\"vribqlotokht\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + FlowProfilesListResult response = manager.azureDataTransfers() + .listFlowProfilesWithResponse(new ListFlowProfilesRequest().withPipeline("cvuq"), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("zlrqhbjnqogdx", response.value().get(0).pipeline()); + Assertions.assertEquals("bsfp", response.value().get(0).name()); + Assertions.assertEquals(DataClassType.STREAM, response.value().get(0).replicationScenario()); + Assertions.assertEquals("x", response.value().get(0).flowProfileId()); + Assertions.assertEquals(FlowProfileStatus.ENABLED, response.value().get(0).status()); + Assertions.assertEquals("lflec", response.value().get(0).description()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransfersListPipelineMetadataWithResponseMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransfersListPipelineMetadataWithResponseMockTests.java new file mode 100644 index 0000000000000..8724c95c3a365 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransfersListPipelineMetadataWithResponseMockTests.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.EnablementStatus; +import com.azure.resourcemanager.datatransfer.models.FlowBillingTier; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ListPipelineMetadataRequest; +import com.azure.resourcemanager.datatransfer.models.ListPipelineMetadataResult; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AzureDataTransfersListPipelineMetadataWithResponseMockTests { + @Test + public void testListPipelineMetadataWithResponse() throws Exception { + String responseStr + = "{\"send\":{\"completeLinking\":\"Disabled\",\"connectionApprovals\":\"Disabled\",\"flowApprovals\":\"Enabled\",\"flowTypesAvailable\":[\"Standard\",\"Unknown\",\"BasicFiles\",\"MicrosoftInternal\"],\"messagingFlowTypeSchemaValidation\":\"Enabled\",\"flowProfileDataClassesAvailable\":[\"API\",\"Files\"],\"messagingFlowsPricingOptions\":[\"Standard\"]},\"receive\":{\"completeLinking\":\"Disabled\",\"connectionApprovals\":\"Disabled\",\"flowApprovals\":\"Enabled\",\"flowTypesAvailable\":[\"Opaque\",\"Messaging\",\"StreamingVideo\",\"API\"],\"messagingFlowTypeSchemaValidation\":\"Enabled\",\"flowProfileDataClassesAvailable\":[\"API\",\"Stream\",\"SoftwareArtifacts\"],\"messagingFlowsPricingOptions\":[\"BlobTransport\",\"BlobTransport\",\"Standard\"]}}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ListPipelineMetadataResult response = manager.azureDataTransfers() + .listPipelineMetadataWithResponse(new ListPipelineMetadataRequest().withPipeline("aiossscyvaifp"), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(EnablementStatus.DISABLED, response.send().completeLinking()); + Assertions.assertEquals(EnablementStatus.DISABLED, response.send().connectionApprovals()); + Assertions.assertEquals(EnablementStatus.ENABLED, response.send().flowApprovals()); + Assertions.assertEquals(FlowType.STANDARD, response.send().flowTypesAvailable().get(0)); + Assertions.assertEquals(EnablementStatus.ENABLED, response.send().messagingFlowTypeSchemaValidation()); + Assertions.assertEquals(DataClassType.API, response.send().flowProfileDataClassesAvailable().get(0)); + Assertions.assertEquals(FlowBillingTier.STANDARD, response.send().messagingFlowsPricingOptions().get(0)); + Assertions.assertEquals(EnablementStatus.DISABLED, response.receive().completeLinking()); + Assertions.assertEquals(EnablementStatus.DISABLED, response.receive().connectionApprovals()); + Assertions.assertEquals(EnablementStatus.ENABLED, response.receive().flowApprovals()); + Assertions.assertEquals(FlowType.OPAQUE, response.receive().flowTypesAvailable().get(0)); + Assertions.assertEquals(EnablementStatus.ENABLED, response.receive().messagingFlowTypeSchemaValidation()); + Assertions.assertEquals(DataClassType.API, response.receive().flowProfileDataClassesAvailable().get(0)); + Assertions.assertEquals(FlowBillingTier.BLOB_TRANSPORT, + response.receive().messagingFlowsPricingOptions().get(0)); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransfersValidateSchemaWithResponseMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransfersValidateSchemaWithResponseMockTests.java new file mode 100644 index 0000000000000..c53e483c15634 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/AzureDataTransfersValidateSchemaWithResponseMockTests.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.Direction; +import com.azure.resourcemanager.datatransfer.models.Schema; +import com.azure.resourcemanager.datatransfer.models.SchemaStatus; +import com.azure.resourcemanager.datatransfer.models.SchemaType; +import com.azure.resourcemanager.datatransfer.models.ValidateSchemaResult; +import com.azure.resourcemanager.datatransfer.models.ValidateSchemaStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AzureDataTransfersValidateSchemaWithResponseMockTests { + @Test + public void testValidateSchemaWithResponse() throws Exception { + String responseStr = "{\"status\":\"Succeeded\",\"message\":\"vzvluyq\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ValidateSchemaResult response = manager.azureDataTransfers() + .validateSchemaWithResponse(new Schema().withId("taznkcqwwxwjyof") + .withConnectionId("hnkbtlwljssmctsn") + .withStatus(SchemaStatus.NEW) + .withName("wolgisubxbt") + .withContent("gfgf") + .withDirection(Direction.RECEIVE) + .withSchemaUri("ykwlefksxqceazf") + .withSchemaType(SchemaType.XSD), com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(ValidateSchemaStatus.SUCCEEDED, response.status()); + Assertions.assertEquals("vzvluyq", response.message()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionIdListTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionIdListTests.java new file mode 100644 index 0000000000000..6630708aefcbe --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionIdListTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.ConnectionIdList; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ConnectionIdListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConnectionIdList model + = BinaryData.fromString("{\"value\":[\"rhneuyowq\",\"d\",\"ytisibir\"]}").toObject(ConnectionIdList.class); + Assertions.assertEquals("rhneuyowq", model.value().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ConnectionIdList model = new ConnectionIdList().withValue(Arrays.asList("rhneuyowq", "d", "ytisibir")); + model = BinaryData.fromObject(model).toObject(ConnectionIdList.class); + Assertions.assertEquals("rhneuyowq", model.value().get(0)); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionInnerTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionInnerTests.java new file mode 100644 index 0000000000000..79b5f0deeda65 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionInnerTests.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.fluent.models.ConnectionInner; +import com.azure.resourcemanager.datatransfer.models.ConnectionProperties; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.Direction; +import com.azure.resourcemanager.datatransfer.models.FlowProfileMetadata; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.Schema; +import com.azure.resourcemanager.datatransfer.models.SchemaStatus; +import com.azure.resourcemanager.datatransfer.models.SchemaType; +import com.azure.resourcemanager.datatransfer.models.UserAssignedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ConnectionInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConnectionInner model = BinaryData.fromString( + "{\"properties\":{\"pipeline\":\"varmywdmj\",\"direction\":\"Send\",\"justification\":\"jhhyxxrwlycoduhp\",\"status\":\"Accepted\",\"forceDisabledStatus\":[\"FlowProfileForceDisabled\",\"FlowTypeForceDisabled\",\"ConnectionForceDisabled\",\"FlowProfileForceDisabled\"],\"statusReason\":\"n\",\"linkStatus\":\"Unlinked\",\"linkedConnectionId\":\"ugjhky\",\"flowTypes\":[\"API\",\"Unknown\",\"Data\"],\"flowProfileList\":[{\"pipeline\":\"sofwqmzqalkrmnji\",\"name\":\"pxacqqudfn\",\"replicationScenario\":\"API\",\"flowProfileId\":\"xbaaabjyv\",\"status\":\"Disabled\",\"description\":\"ffimrzrtuzqogsex\"},{\"pipeline\":\"evfdnwnwm\",\"name\":\"wzsyyceuzs\",\"replicationScenario\":\"Stream\",\"flowProfileId\":\"bjudpfrxtrthzv\",\"status\":\"Disabled\",\"description\":\"tdwkqbrq\"},{\"pipeline\":\"bpaxhexiilivpdt\",\"name\":\"irqtdqoa\",\"replicationScenario\":\"API\",\"flowProfileId\":\"r\",\"status\":\"Enabled\",\"description\":\"fgsqu\"}],\"requirementId\":\"xrxxlep\",\"remoteSubscriptionId\":\"amxjezwlw\",\"approver\":\"xuqlcvydypat\",\"pin\":\"oa\",\"dateSubmitted\":\"2021-07-09T00:51:43Z\",\"primaryContact\":\"iodkooebwnujhem\",\"secondaryContacts\":[\"vdkcrodtj\",\"nfwjlfltkacjvefk\",\"lfoakg\"],\"provisioningState\":\"Canceled\",\"policies\":[\"gaowpulpqblylsyx\",\"qjnsjervtia\",\"xsdszuempsb\",\"kfzbeyvpnqicvi\"],\"schemas\":[{\"id\":\"jxdxrbuukz\",\"connectionId\":\"ewyhml\",\"status\":\"New\",\"name\":\"tzpofncckwyfzq\",\"content\":\"xxbuyq\",\"direction\":\"Receive\",\"schemaUri\":\"eqz\",\"schemaType\":\"Xsd\"}],\"schemaUris\":[\"o\",\"xorjaltolmncwsob\"],\"apiHostname\":\"csdbnwdcfhuc\"},\"identity\":{\"principalId\":\"fuvglsbjjca\",\"tenantId\":\"xbvtvudu\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"bgdknnqv\":{\"principalId\":\"mr\",\"clientId\":\"qtvcofudflvkgj\"},\"uetae\":{\"principalId\":\"znqntoru\",\"clientId\":\"gsahmkycgrauw\"},\"tpuqujmq\":{\"principalId\":\"ruvdmov\",\"clientId\":\"zlxwabmqoefkifr\"},\"ezkojvdcp\":{\"principalId\":\"kfbtndoaongbjc\",\"clientId\":\"ujitcjedftww\"}}},\"location\":\"oqouicybxarzgszu\",\"tags\":{\"ciodhkhaz\":\"ciqopidoa\"},\"id\":\"khnzbonlw\",\"name\":\"toego\",\"type\":\"dwbwhkszzcmrvexz\"}") + .toObject(ConnectionInner.class); + Assertions.assertEquals("oqouicybxarzgszu", model.location()); + Assertions.assertEquals("ciqopidoa", model.tags().get("ciodhkhaz")); + Assertions.assertEquals("varmywdmj", model.properties().pipeline()); + Assertions.assertEquals(Direction.SEND, model.properties().direction()); + Assertions.assertEquals("jhhyxxrwlycoduhp", model.properties().justification()); + Assertions.assertEquals(FlowType.API, model.properties().flowTypes().get(0)); + Assertions.assertEquals("sofwqmzqalkrmnji", model.properties().flowProfileList().get(0).pipeline()); + Assertions.assertEquals("pxacqqudfn", model.properties().flowProfileList().get(0).name()); + Assertions.assertEquals(DataClassType.API, model.properties().flowProfileList().get(0).replicationScenario()); + Assertions.assertEquals("xbaaabjyv", model.properties().flowProfileList().get(0).flowProfileId()); + Assertions.assertEquals(FlowProfileStatus.DISABLED, model.properties().flowProfileList().get(0).status()); + Assertions.assertEquals("ffimrzrtuzqogsex", model.properties().flowProfileList().get(0).description()); + Assertions.assertEquals("xrxxlep", model.properties().requirementId()); + Assertions.assertEquals("amxjezwlw", model.properties().remoteSubscriptionId()); + Assertions.assertEquals("oa", model.properties().pin()); + Assertions.assertEquals("iodkooebwnujhem", model.properties().primaryContact()); + Assertions.assertEquals("vdkcrodtj", model.properties().secondaryContacts().get(0)); + Assertions.assertEquals("gaowpulpqblylsyx", model.properties().policies().get(0)); + Assertions.assertEquals("jxdxrbuukz", model.properties().schemas().get(0).id()); + Assertions.assertEquals("ewyhml", model.properties().schemas().get(0).connectionId()); + Assertions.assertEquals(SchemaStatus.NEW, model.properties().schemas().get(0).status()); + Assertions.assertEquals("tzpofncckwyfzq", model.properties().schemas().get(0).name()); + Assertions.assertEquals("xxbuyq", model.properties().schemas().get(0).content()); + Assertions.assertEquals(Direction.RECEIVE, model.properties().schemas().get(0).direction()); + Assertions.assertEquals("eqz", model.properties().schemas().get(0).schemaUri()); + Assertions.assertEquals(SchemaType.XSD, model.properties().schemas().get(0).schemaType()); + Assertions.assertEquals("o", model.properties().schemaUris().get(0)); + Assertions.assertEquals("csdbnwdcfhuc", model.properties().apiHostname()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ConnectionInner model = new ConnectionInner().withLocation("oqouicybxarzgszu") + .withTags(mapOf("ciodhkhaz", "ciqopidoa")) + .withProperties(new ConnectionProperties().withPipeline("varmywdmj") + .withDirection(Direction.SEND) + .withJustification("jhhyxxrwlycoduhp") + .withFlowTypes(Arrays.asList(FlowType.API, FlowType.UNKNOWN, FlowType.DATA)) + .withFlowProfileList(Arrays.asList( + new FlowProfileMetadata().withPipeline("sofwqmzqalkrmnji") + .withName("pxacqqudfn") + .withReplicationScenario(DataClassType.API) + .withFlowProfileId("xbaaabjyv") + .withStatus(FlowProfileStatus.DISABLED) + .withDescription("ffimrzrtuzqogsex"), + new FlowProfileMetadata().withPipeline("evfdnwnwm") + .withName("wzsyyceuzs") + .withReplicationScenario(DataClassType.STREAM) + .withFlowProfileId("bjudpfrxtrthzv") + .withStatus(FlowProfileStatus.DISABLED) + .withDescription("tdwkqbrq"), + new FlowProfileMetadata().withPipeline("bpaxhexiilivpdt") + .withName("irqtdqoa") + .withReplicationScenario(DataClassType.API) + .withFlowProfileId("r") + .withStatus(FlowProfileStatus.ENABLED) + .withDescription("fgsqu"))) + .withRequirementId("xrxxlep") + .withRemoteSubscriptionId("amxjezwlw") + .withPin("oa") + .withPrimaryContact("iodkooebwnujhem") + .withSecondaryContacts(Arrays.asList("vdkcrodtj", "nfwjlfltkacjvefk", "lfoakg")) + .withPolicies(Arrays.asList("gaowpulpqblylsyx", "qjnsjervtia", "xsdszuempsb", "kfzbeyvpnqicvi")) + .withSchemas(Arrays.asList(new Schema().withId("jxdxrbuukz") + .withConnectionId("ewyhml") + .withStatus(SchemaStatus.NEW) + .withName("tzpofncckwyfzq") + .withContent("xxbuyq") + .withDirection(Direction.RECEIVE) + .withSchemaUri("eqz") + .withSchemaType(SchemaType.XSD))) + .withSchemaUris(Arrays.asList("o", "xorjaltolmncwsob")) + .withApiHostname("csdbnwdcfhuc")) + .withIdentity( + new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf("bgdknnqv", new UserAssignedIdentity(), "uetae", new UserAssignedIdentity(), "tpuqujmq", + new UserAssignedIdentity(), "ezkojvdcp", new UserAssignedIdentity()))); + model = BinaryData.fromObject(model).toObject(ConnectionInner.class); + Assertions.assertEquals("oqouicybxarzgszu", model.location()); + Assertions.assertEquals("ciqopidoa", model.tags().get("ciodhkhaz")); + Assertions.assertEquals("varmywdmj", model.properties().pipeline()); + Assertions.assertEquals(Direction.SEND, model.properties().direction()); + Assertions.assertEquals("jhhyxxrwlycoduhp", model.properties().justification()); + Assertions.assertEquals(FlowType.API, model.properties().flowTypes().get(0)); + Assertions.assertEquals("sofwqmzqalkrmnji", model.properties().flowProfileList().get(0).pipeline()); + Assertions.assertEquals("pxacqqudfn", model.properties().flowProfileList().get(0).name()); + Assertions.assertEquals(DataClassType.API, model.properties().flowProfileList().get(0).replicationScenario()); + Assertions.assertEquals("xbaaabjyv", model.properties().flowProfileList().get(0).flowProfileId()); + Assertions.assertEquals(FlowProfileStatus.DISABLED, model.properties().flowProfileList().get(0).status()); + Assertions.assertEquals("ffimrzrtuzqogsex", model.properties().flowProfileList().get(0).description()); + Assertions.assertEquals("xrxxlep", model.properties().requirementId()); + Assertions.assertEquals("amxjezwlw", model.properties().remoteSubscriptionId()); + Assertions.assertEquals("oa", model.properties().pin()); + Assertions.assertEquals("iodkooebwnujhem", model.properties().primaryContact()); + Assertions.assertEquals("vdkcrodtj", model.properties().secondaryContacts().get(0)); + Assertions.assertEquals("gaowpulpqblylsyx", model.properties().policies().get(0)); + Assertions.assertEquals("jxdxrbuukz", model.properties().schemas().get(0).id()); + Assertions.assertEquals("ewyhml", model.properties().schemas().get(0).connectionId()); + Assertions.assertEquals(SchemaStatus.NEW, model.properties().schemas().get(0).status()); + Assertions.assertEquals("tzpofncckwyfzq", model.properties().schemas().get(0).name()); + Assertions.assertEquals("xxbuyq", model.properties().schemas().get(0).content()); + Assertions.assertEquals(Direction.RECEIVE, model.properties().schemas().get(0).direction()); + Assertions.assertEquals("eqz", model.properties().schemas().get(0).schemaUri()); + Assertions.assertEquals(SchemaType.XSD, model.properties().schemas().get(0).schemaType()); + Assertions.assertEquals("o", model.properties().schemaUris().get(0)); + Assertions.assertEquals("csdbnwdcfhuc", model.properties().apiHostname()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionListResultTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionListResultTests.java new file mode 100644 index 0000000000000..c8d0aa9df0ccd --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionListResultTests.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.implementation.models.ConnectionListResult; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.Direction; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.SchemaStatus; +import com.azure.resourcemanager.datatransfer.models.SchemaType; +import org.junit.jupiter.api.Assertions; + +public final class ConnectionListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConnectionListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"pipeline\":\"omtbghhavgrvkff\",\"direction\":\"Receive\",\"justification\":\"hpjbib\",\"status\":\"Accepted\",\"forceDisabledStatus\":[\"FlowTypeForceDisabled\",\"ConnectionForceDisabled\",\"FlowProfileForceDisabled\"],\"statusReason\":\"cluyovwxnbkf\",\"linkStatus\":\"Unlinked\",\"linkedConnectionId\":\"scyhwz\",\"flowTypes\":[\"BasicFiles\",\"Data\"],\"flowProfileList\":[{\"pipeline\":\"zbomvzzbtdcqvpni\",\"name\":\"ujviylwdshfs\",\"replicationScenario\":\"SoftwareArtifacts\",\"flowProfileId\":\"rbgyefry\",\"status\":\"Obsolete\",\"description\":\"gaojf\"},{\"pipeline\":\"wncot\",\"name\":\"rfh\",\"replicationScenario\":\"SoftwareArtifacts\",\"flowProfileId\":\"ctymoxoftp\",\"status\":\"Enabled\",\"description\":\"iwyczuh\"},{\"pipeline\":\"a\",\"name\":\"pqjlihhyusps\",\"replicationScenario\":\"SoftwareArtifacts\",\"flowProfileId\":\"sdvlmfwdgzxulucv\",\"status\":\"Disabled\",\"description\":\"mrsreuzvxurisjnh\"},{\"pipeline\":\"ytxifqjzgxmrh\",\"name\":\"blwpcesutrgj\",\"replicationScenario\":\"Messaging\",\"flowProfileId\":\"auutpwoqhihe\",\"status\":\"Obsolete\",\"description\":\"g\"}],\"requirementId\":\"pnfqntcyp\",\"remoteSubscriptionId\":\"jv\",\"approver\":\"imwkslircizj\",\"pin\":\"ydfce\",\"dateSubmitted\":\"2021-04-08T10:04:22Z\",\"primaryContact\":\"hvygdyftumr\",\"secondaryContacts\":[\"awjs\",\"biwkojgcyzt\",\"fmznba\",\"qphchqnrnrpxehuw\"],\"provisioningState\":\"Succeeded\",\"policies\":[\"aifmvikl\",\"ydv\"],\"schemas\":[{\"id\":\"jdz\",\"connectionId\":\"cvdsrhnj\",\"status\":\"Approved\",\"name\":\"v\",\"content\":\"ovqfzge\",\"direction\":\"Receive\",\"schemaUri\":\"tul\",\"schemaType\":\"Xsd\"},{\"id\":\"ucea\",\"connectionId\":\"mczuo\",\"status\":\"New\",\"name\":\"cwwqiokn\",\"content\":\"xmojmsvpkjp\",\"direction\":\"Send\",\"schemaUri\":\"cfzq\",\"schemaType\":\"Xsd\"},{\"id\":\"gtczheydb\",\"connectionId\":\"shmkxmaehvbbxur\",\"status\":\"Approved\",\"name\":\"fnhtbaxkgxyw\",\"content\":\"kpyklyhp\",\"direction\":\"Receive\",\"schemaUri\":\"pvruudlg\",\"schemaType\":\"Xsd\"}],\"schemaUris\":[\"ostgkts\",\"vdxec\",\"zedqbcvhzlhplo\",\"qkdlw\"],\"apiHostname\":\"fbumlkx\"},\"identity\":{\"principalId\":\"jfsmlmbtxhwgfwsr\",\"tenantId\":\"wcoezbrhub\",\"type\":\"None\",\"userAssignedIdentities\":{\"rfmluiqtq\":{\"principalId\":\"ygo\",\"clientId\":\"kkqfqjbvle\"},\"cbhernntiewdj\":{\"principalId\":\"avyvnqqyba\",\"clientId\":\"euayjkqabqgzsles\"}}},\"location\":\"bquwrbehw\",\"tags\":{\"mvvhmxtdrjfuta\":\"hbuffkmrq\"},\"id\":\"oe\",\"name\":\"jvewzcjznmwcp\",\"type\":\"guaadraufactkahz\"},{\"properties\":{\"pipeline\":\"ajjziuxxpshne\",\"direction\":\"Send\",\"justification\":\"fgslqubkwdl\",\"status\":\"InReview\",\"forceDisabledStatus\":[\"FlowTypeForceDisabled\",\"PipelineForceDisabled\"],\"statusReason\":\"jbazpjuohminy\",\"linkStatus\":\"Unlinked\",\"linkedConnectionId\":\"rwm\",\"flowTypes\":[\"Complex\",\"Opaque\",\"Messaging\",\"Opaque\"],\"flowProfileList\":[{\"pipeline\":\"w\",\"name\":\"ygdxpgpqchis\",\"replicationScenario\":\"Files\",\"flowProfileId\":\"pnnbjc\",\"status\":\"Enabled\",\"description\":\"gibbdaxc\"},{\"pipeline\":\"nfo\",\"name\":\"auorsukokw\",\"replicationScenario\":\"Files\",\"flowProfileId\":\"plhlvnuuepzlrp\",\"status\":\"Enabled\",\"description\":\"zsoldwey\"},{\"pipeline\":\"qdunvmnnrwrbior\",\"name\":\"talywjhhgdnhxms\",\"replicationScenario\":\"SoftwareArtifacts\",\"flowProfileId\":\"fomiloxgg\",\"status\":\"Disabled\",\"description\":\"fi\"}],\"requirementId\":\"dieuzaofj\",\"remoteSubscriptionId\":\"vcyy\",\"approver\":\"fgdo\",\"pin\":\"ubiipuipwoqonma\",\"dateSubmitted\":\"2021-10-21T10:35:29Z\",\"primaryContact\":\"nizshqvcim\",\"secondaryContacts\":[\"fgmblrrilbywdxsm\",\"ccwr\",\"fscjfnynszquji\"],\"provisioningState\":\"Failed\",\"policies\":[\"ytibyow\",\"blgyavutpthj\",\"xoi\",\"msksbp\"],\"schemas\":[{\"id\":\"oljxkcgx\",\"connectionId\":\"xsffgcviz\",\"status\":\"New\",\"name\":\"l\",\"content\":\"lyoupfgfbkju\",\"direction\":\"Send\",\"schemaUri\":\"gkfmins\",\"schemaType\":\"Xsd\"}],\"schemaUris\":[\"ttsttktlahbqact\",\"tgzukxitmmqt\"],\"apiHostname\":\"qqxhrnxrxcpj\"},\"identity\":{\"principalId\":\"av\",\"tenantId\":\"qdzfvazivjlfrqtt\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"cxkdmligovi\":{\"principalId\":\"atnwxyiopi\",\"clientId\":\"qqfkuv\"},\"bteoybf\":{\"principalId\":\"xk\",\"clientId\":\"loazuruocbgoo\"},\"b\":{\"principalId\":\"xakvvjgslor\",\"clientId\":\"lmywwtkgkxnyed\"},\"bvpa\":{\"principalId\":\"vudtjuewbcihx\",\"clientId\":\"whcjyxcc\"}}},\"location\":\"kkudzp\",\"tags\":{\"hpfkyrkdbdgi\":\"jplmagstcy\",\"mnwqj\":\"gsj\"},\"id\":\"obaiyhddviaceg\",\"name\":\"n\",\"type\":\"ntfpmvmemfnc\"}],\"nextLink\":\"wvvb\"}") + .toObject(ConnectionListResult.class); + Assertions.assertEquals("bquwrbehw", model.value().get(0).location()); + Assertions.assertEquals("hbuffkmrq", model.value().get(0).tags().get("mvvhmxtdrjfuta")); + Assertions.assertEquals("omtbghhavgrvkff", model.value().get(0).properties().pipeline()); + Assertions.assertEquals(Direction.RECEIVE, model.value().get(0).properties().direction()); + Assertions.assertEquals("hpjbib", model.value().get(0).properties().justification()); + Assertions.assertEquals(FlowType.BASIC_FILES, model.value().get(0).properties().flowTypes().get(0)); + Assertions.assertEquals("zbomvzzbtdcqvpni", + model.value().get(0).properties().flowProfileList().get(0).pipeline()); + Assertions.assertEquals("ujviylwdshfs", model.value().get(0).properties().flowProfileList().get(0).name()); + Assertions.assertEquals(DataClassType.SOFTWARE_ARTIFACTS, + model.value().get(0).properties().flowProfileList().get(0).replicationScenario()); + Assertions.assertEquals("rbgyefry", model.value().get(0).properties().flowProfileList().get(0).flowProfileId()); + Assertions.assertEquals(FlowProfileStatus.OBSOLETE, + model.value().get(0).properties().flowProfileList().get(0).status()); + Assertions.assertEquals("gaojf", model.value().get(0).properties().flowProfileList().get(0).description()); + Assertions.assertEquals("pnfqntcyp", model.value().get(0).properties().requirementId()); + Assertions.assertEquals("jv", model.value().get(0).properties().remoteSubscriptionId()); + Assertions.assertEquals("ydfce", model.value().get(0).properties().pin()); + Assertions.assertEquals("hvygdyftumr", model.value().get(0).properties().primaryContact()); + Assertions.assertEquals("awjs", model.value().get(0).properties().secondaryContacts().get(0)); + Assertions.assertEquals("aifmvikl", model.value().get(0).properties().policies().get(0)); + Assertions.assertEquals("jdz", model.value().get(0).properties().schemas().get(0).id()); + Assertions.assertEquals("cvdsrhnj", model.value().get(0).properties().schemas().get(0).connectionId()); + Assertions.assertEquals(SchemaStatus.APPROVED, model.value().get(0).properties().schemas().get(0).status()); + Assertions.assertEquals("v", model.value().get(0).properties().schemas().get(0).name()); + Assertions.assertEquals("ovqfzge", model.value().get(0).properties().schemas().get(0).content()); + Assertions.assertEquals(Direction.RECEIVE, model.value().get(0).properties().schemas().get(0).direction()); + Assertions.assertEquals("tul", model.value().get(0).properties().schemas().get(0).schemaUri()); + Assertions.assertEquals(SchemaType.XSD, model.value().get(0).properties().schemas().get(0).schemaType()); + Assertions.assertEquals("ostgkts", model.value().get(0).properties().schemaUris().get(0)); + Assertions.assertEquals("fbumlkx", model.value().get(0).properties().apiHostname()); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.value().get(0).identity().type()); + Assertions.assertEquals("wvvb", model.nextLink()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionPropertiesTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionPropertiesTests.java new file mode 100644 index 0000000000000..40e67ec6ad715 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionPropertiesTests.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.ConnectionProperties; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.Direction; +import com.azure.resourcemanager.datatransfer.models.FlowProfileMetadata; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.Schema; +import com.azure.resourcemanager.datatransfer.models.SchemaStatus; +import com.azure.resourcemanager.datatransfer.models.SchemaType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ConnectionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConnectionProperties model = BinaryData.fromString( + "{\"pipeline\":\"vbtqgsfraoyzk\",\"direction\":\"Send\",\"justification\":\"lmnguxaw\",\"status\":\"Accepted\",\"forceDisabledStatus\":[\"FlowProfileForceDisabled\",\"FlowTypeForceDisabled\",\"PipelineForceDisabled\"],\"statusReason\":\"imerqfobwyznk\",\"linkStatus\":\"Linked\",\"linkedConnectionId\":\"t\",\"flowTypes\":[\"Messaging\",\"Messaging\",\"Complex\",\"DevSecOps\"],\"flowProfileList\":[{\"pipeline\":\"r\",\"name\":\"kdsnfdsdoakgtdl\",\"replicationScenario\":\"Messaging\",\"flowProfileId\":\"kzevdlhewpusds\",\"status\":\"Enabled\",\"description\":\"wvogvbbejdc\"},{\"pipeline\":\"gqqmoakufgm\",\"name\":\"zr\",\"replicationScenario\":\"Stream\",\"flowProfileId\":\"dgrtwaenuuzkopbm\",\"status\":\"Disabled\",\"description\":\"rfdwoyu\"},{\"pipeline\":\"hziuiefozbhdms\",\"name\":\"l\",\"replicationScenario\":\"Messaging\",\"flowProfileId\":\"qhoftrmaequiah\",\"status\":\"Obsolete\",\"description\":\"cslfaoqzpiyylha\"}],\"requirementId\":\"swhccsphk\",\"remoteSubscriptionId\":\"vwitqscyw\",\"approver\":\"gwol\",\"pin\":\"czbwemhairsbr\",\"dateSubmitted\":\"2021-01-28T00:27:19Z\",\"primaryContact\":\"msweypqwdxggicc\",\"secondaryContacts\":[\"qhuexm\",\"ttlstvlzywemhz\"],\"provisioningState\":\"Accepted\",\"policies\":[\"tclusiypbsfgy\",\"gusl\",\"eadcygqukyhejhz\"],\"schemas\":[{\"id\":\"fpel\",\"connectionId\":\"p\",\"status\":\"New\",\"name\":\"r\",\"content\":\"vu\",\"direction\":\"Receive\",\"schemaUri\":\"ehtwdwrft\",\"schemaType\":\"Xsd\"},{\"id\":\"yrcdlbhshfwprac\",\"connectionId\":\"wity\",\"status\":\"Approved\",\"name\":\"xccedcpnmdyodn\",\"content\":\"xltjcvnhltiu\",\"direction\":\"Send\",\"schemaUri\":\"avvwxqi\",\"schemaType\":\"Zip\"},{\"id\":\"nyowxwlmdjrkvfg\",\"connectionId\":\"fvpdbo\",\"status\":\"Approved\",\"name\":\"zsjqlh\",\"content\":\"r\",\"direction\":\"Send\",\"schemaUri\":\"ibqipqkg\",\"schemaType\":\"Xsd\"}],\"schemaUris\":[\"zwmk\",\"efajpj\",\"rwkq\"],\"apiHostname\":\"hgbijt\"}") + .toObject(ConnectionProperties.class); + Assertions.assertEquals("vbtqgsfraoyzk", model.pipeline()); + Assertions.assertEquals(Direction.SEND, model.direction()); + Assertions.assertEquals("lmnguxaw", model.justification()); + Assertions.assertEquals(FlowType.MESSAGING, model.flowTypes().get(0)); + Assertions.assertEquals("r", model.flowProfileList().get(0).pipeline()); + Assertions.assertEquals("kdsnfdsdoakgtdl", model.flowProfileList().get(0).name()); + Assertions.assertEquals(DataClassType.MESSAGING, model.flowProfileList().get(0).replicationScenario()); + Assertions.assertEquals("kzevdlhewpusds", model.flowProfileList().get(0).flowProfileId()); + Assertions.assertEquals(FlowProfileStatus.ENABLED, model.flowProfileList().get(0).status()); + Assertions.assertEquals("wvogvbbejdc", model.flowProfileList().get(0).description()); + Assertions.assertEquals("swhccsphk", model.requirementId()); + Assertions.assertEquals("vwitqscyw", model.remoteSubscriptionId()); + Assertions.assertEquals("czbwemhairsbr", model.pin()); + Assertions.assertEquals("msweypqwdxggicc", model.primaryContact()); + Assertions.assertEquals("qhuexm", model.secondaryContacts().get(0)); + Assertions.assertEquals("tclusiypbsfgy", model.policies().get(0)); + Assertions.assertEquals("fpel", model.schemas().get(0).id()); + Assertions.assertEquals("p", model.schemas().get(0).connectionId()); + Assertions.assertEquals(SchemaStatus.NEW, model.schemas().get(0).status()); + Assertions.assertEquals("r", model.schemas().get(0).name()); + Assertions.assertEquals("vu", model.schemas().get(0).content()); + Assertions.assertEquals(Direction.RECEIVE, model.schemas().get(0).direction()); + Assertions.assertEquals("ehtwdwrft", model.schemas().get(0).schemaUri()); + Assertions.assertEquals(SchemaType.XSD, model.schemas().get(0).schemaType()); + Assertions.assertEquals("zwmk", model.schemaUris().get(0)); + Assertions.assertEquals("hgbijt", model.apiHostname()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ConnectionProperties model = new ConnectionProperties().withPipeline("vbtqgsfraoyzk") + .withDirection(Direction.SEND) + .withJustification("lmnguxaw") + .withFlowTypes( + Arrays.asList(FlowType.MESSAGING, FlowType.MESSAGING, FlowType.COMPLEX, FlowType.DEV_SEC_OPS)) + .withFlowProfileList(Arrays.asList( + new FlowProfileMetadata().withPipeline("r") + .withName("kdsnfdsdoakgtdl") + .withReplicationScenario(DataClassType.MESSAGING) + .withFlowProfileId("kzevdlhewpusds") + .withStatus(FlowProfileStatus.ENABLED) + .withDescription("wvogvbbejdc"), + new FlowProfileMetadata().withPipeline("gqqmoakufgm") + .withName("zr") + .withReplicationScenario(DataClassType.STREAM) + .withFlowProfileId("dgrtwaenuuzkopbm") + .withStatus(FlowProfileStatus.DISABLED) + .withDescription("rfdwoyu"), + new FlowProfileMetadata().withPipeline("hziuiefozbhdms") + .withName("l") + .withReplicationScenario(DataClassType.MESSAGING) + .withFlowProfileId("qhoftrmaequiah") + .withStatus(FlowProfileStatus.OBSOLETE) + .withDescription("cslfaoqzpiyylha"))) + .withRequirementId("swhccsphk") + .withRemoteSubscriptionId("vwitqscyw") + .withPin("czbwemhairsbr") + .withPrimaryContact("msweypqwdxggicc") + .withSecondaryContacts(Arrays.asList("qhuexm", "ttlstvlzywemhz")) + .withPolicies(Arrays.asList("tclusiypbsfgy", "gusl", "eadcygqukyhejhz")) + .withSchemas(Arrays.asList( + new Schema().withId("fpel") + .withConnectionId("p") + .withStatus(SchemaStatus.NEW) + .withName("r") + .withContent("vu") + .withDirection(Direction.RECEIVE) + .withSchemaUri("ehtwdwrft") + .withSchemaType(SchemaType.XSD), + new Schema().withId("yrcdlbhshfwprac") + .withConnectionId("wity") + .withStatus(SchemaStatus.APPROVED) + .withName("xccedcpnmdyodn") + .withContent("xltjcvnhltiu") + .withDirection(Direction.SEND) + .withSchemaUri("avvwxqi") + .withSchemaType(SchemaType.ZIP), + new Schema().withId("nyowxwlmdjrkvfg") + .withConnectionId("fvpdbo") + .withStatus(SchemaStatus.APPROVED) + .withName("zsjqlh") + .withContent("r") + .withDirection(Direction.SEND) + .withSchemaUri("ibqipqkg") + .withSchemaType(SchemaType.XSD))) + .withSchemaUris(Arrays.asList("zwmk", "efajpj", "rwkq")) + .withApiHostname("hgbijt"); + model = BinaryData.fromObject(model).toObject(ConnectionProperties.class); + Assertions.assertEquals("vbtqgsfraoyzk", model.pipeline()); + Assertions.assertEquals(Direction.SEND, model.direction()); + Assertions.assertEquals("lmnguxaw", model.justification()); + Assertions.assertEquals(FlowType.MESSAGING, model.flowTypes().get(0)); + Assertions.assertEquals("r", model.flowProfileList().get(0).pipeline()); + Assertions.assertEquals("kdsnfdsdoakgtdl", model.flowProfileList().get(0).name()); + Assertions.assertEquals(DataClassType.MESSAGING, model.flowProfileList().get(0).replicationScenario()); + Assertions.assertEquals("kzevdlhewpusds", model.flowProfileList().get(0).flowProfileId()); + Assertions.assertEquals(FlowProfileStatus.ENABLED, model.flowProfileList().get(0).status()); + Assertions.assertEquals("wvogvbbejdc", model.flowProfileList().get(0).description()); + Assertions.assertEquals("swhccsphk", model.requirementId()); + Assertions.assertEquals("vwitqscyw", model.remoteSubscriptionId()); + Assertions.assertEquals("czbwemhairsbr", model.pin()); + Assertions.assertEquals("msweypqwdxggicc", model.primaryContact()); + Assertions.assertEquals("qhuexm", model.secondaryContacts().get(0)); + Assertions.assertEquals("tclusiypbsfgy", model.policies().get(0)); + Assertions.assertEquals("fpel", model.schemas().get(0).id()); + Assertions.assertEquals("p", model.schemas().get(0).connectionId()); + Assertions.assertEquals(SchemaStatus.NEW, model.schemas().get(0).status()); + Assertions.assertEquals("r", model.schemas().get(0).name()); + Assertions.assertEquals("vu", model.schemas().get(0).content()); + Assertions.assertEquals(Direction.RECEIVE, model.schemas().get(0).direction()); + Assertions.assertEquals("ehtwdwrft", model.schemas().get(0).schemaUri()); + Assertions.assertEquals(SchemaType.XSD, model.schemas().get(0).schemaType()); + Assertions.assertEquals("zwmk", model.schemaUris().get(0)); + Assertions.assertEquals("hgbijt", model.apiHostname()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsCreateOrUpdateMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsCreateOrUpdateMockTests.java new file mode 100644 index 0000000000000..079ad14612997 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsCreateOrUpdateMockTests.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.Connection; +import com.azure.resourcemanager.datatransfer.models.ConnectionProperties; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.Direction; +import com.azure.resourcemanager.datatransfer.models.FlowProfileMetadata; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.Schema; +import com.azure.resourcemanager.datatransfer.models.SchemaStatus; +import com.azure.resourcemanager.datatransfer.models.SchemaType; +import com.azure.resourcemanager.datatransfer.models.UserAssignedIdentity; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ConnectionsCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"pipeline\":\"ogd\",\"direction\":\"Receive\",\"justification\":\"cmkrftsjcwjj\",\"status\":\"Rejected\",\"forceDisabledStatus\":[\"PipelineForceDisabled\",\"ConnectionForceDisabled\"],\"statusReason\":\"ifdxkecifhocjxw\",\"linkStatus\":\"Linked\",\"linkedConnectionId\":\"zrvtx\",\"flowTypes\":[\"DiskImages\",\"Mission\"],\"flowProfileList\":[{\"pipeline\":\"lcpx\",\"name\":\"vir\",\"replicationScenario\":\"Messaging\",\"flowProfileId\":\"yngjgvrquvpygglp\",\"status\":\"Enabled\",\"description\":\"rdcueljtiahx\"},{\"pipeline\":\"fqryarvsx\",\"name\":\"qbglcjkaysp\",\"replicationScenario\":\"Complex\",\"flowProfileId\":\"zodubtlm\",\"status\":\"Enabled\",\"description\":\"gblioskkfmkm\"},{\"pipeline\":\"djxyxgbkkqvjcteo\",\"name\":\"dlrslskk\",\"replicationScenario\":\"Files\",\"flowProfileId\":\"xv\",\"status\":\"Disabled\",\"description\":\"zdpv\"}],\"requirementId\":\"ojhpcnabxzfsn\",\"remoteSubscriptionId\":\"ytexvzilmhivzk\",\"approver\":\"wncknr\",\"pin\":\"ajlskzptj\",\"dateSubmitted\":\"2021-09-18T03:15:46Z\",\"primaryContact\":\"eucyrth\",\"secondaryContacts\":[\"ehmcgcje\",\"n\",\"ehokamvfej\",\"qnttmbq\"],\"provisioningState\":\"Succeeded\",\"policies\":[\"ivfokpysthhzagj\"],\"schemas\":[{\"id\":\"rlhgenuze\",\"connectionId\":\"vkvebaqsz\",\"status\":\"New\",\"name\":\"lsmmdqgmi\",\"content\":\"pimcqrhn\",\"direction\":\"Send\",\"schemaUri\":\"nklogxsvtzarhzv\",\"schemaType\":\"Zip\"},{\"id\":\"kt\",\"connectionId\":\"bjwzzos\",\"status\":\"Approved\",\"name\":\"btglwkzpgajsqj\",\"content\":\"mqbmfuvqarwz\",\"direction\":\"Send\",\"schemaUri\":\"ebluimmbwx\",\"schemaType\":\"Xsd\"},{\"id\":\"dmbvxekraok\",\"connectionId\":\"budbt\",\"status\":\"Approved\",\"name\":\"bavly\",\"content\":\"aaknwfr\",\"direction\":\"Receive\",\"schemaUri\":\"mhpdu\",\"schemaType\":\"Zip\"}],\"schemaUris\":[\"toleksc\",\"ctnanqimwbzxp\",\"cldpkawn\"],\"apiHostname\":\"laimouxwk\"},\"identity\":{\"principalId\":\"udmfcoibiczius\",\"tenantId\":\"wjrkb\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"uyzwvbhlimbyqecr\":{\"principalId\":\"tqqvy\",\"clientId\":\"cyrfwbivqvog\"},\"wiyjvzuko\":{\"principalId\":\"dlikcdrdaasa\",\"clientId\":\"obsmf\"},\"oywsxvjabjqqaxu\":{\"principalId\":\"nawnvz\",\"clientId\":\"n\"},\"oabhjxwxqweuip\":{\"principalId\":\"y\",\"clientId\":\"nudn\"}}},\"location\":\"vk\",\"tags\":{\"lkrdpqgfhy\":\"tnsqxtlt\",\"fcmfcn\":\"frakkldgrc\",\"elnzqgxxgfbbmt\":\"jajqmatxjt\"},\"id\":\"pqagynoiprn\",\"name\":\"calincryqxz\",\"type\":\"aqzi\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Connection response = manager.connections() + .define("whsbrcary") + .withRegion("aokgkskjivbsshaj") + .withExistingResourceGroup("zygleexahvm") + .withTags(mapOf("uitrdexyiono", "kpeexpgeumilh")) + .withProperties(new ConnectionProperties().withPipeline("jjzyvoaqajuve") + .withDirection(Direction.RECEIVE) + .withJustification("dmkrrb") + .withFlowTypes(Arrays.asList(FlowType.MISSION_OPAQUE_XML, FlowType.API, FlowType.MESSAGING)) + .withFlowProfileList(Arrays.asList( + new FlowProfileMetadata().withPipeline("ctnkjjwgcwnph") + .withName("kgf") + .withReplicationScenario(DataClassType.SOFTWARE_ARTIFACTS) + .withFlowProfileId("togmhmjpjscdfpd") + .withStatus(FlowProfileStatus.OBSOLETE) + .withDescription("tygevgwmseharx"), + new FlowProfileMetadata().withPipeline("fv") + .withName("n") + .withReplicationScenario(DataClassType.FILES) + .withFlowProfileId("tmbpjp") + .withStatus(FlowProfileStatus.DISABLED) + .withDescription("vwjhrsidqpxlbt"), + new FlowProfileMetadata().withPipeline("akftng") + .withName("twmykyut") + .withReplicationScenario(DataClassType.FILES) + .withFlowProfileId("mdwmf") + .withStatus(FlowProfileStatus.ENABLED) + .withDescription("pycvjqdvdwkqpldr"))) + .withRequirementId("fgnaavuagnteta") + .withRemoteSubscriptionId("tnpdctuhspfefy") + .withPin("hmtybkcgsuthhll") + .withPrimaryContact("nefxexlfciatx") + .withSecondaryContacts(Arrays.asList("rl", "mdskjhhxdlajfoxc", "scv")) + .withPolicies(Arrays.asList("uavkrmukm")) + .withSchemas(Arrays.asList( + new Schema().withId("xett") + .withConnectionId("lojfkqidnqto") + .withStatus(SchemaStatus.NEW) + .withName("qxcsqhtkbtnqlrn") + .withContent("dmbi") + .withDirection(Direction.RECEIVE) + .withSchemaUri("awwl") + .withSchemaType(SchemaType.ZIP), + new Schema().withId("xhhllxricct") + .withConnectionId("muqqoajxei") + .withStatus(SchemaStatus.NEW) + .withName("srwvaexhdctrce") + .withContent("kbrup") + .withDirection(Direction.RECEIVE) + .withSchemaUri("dmljzacvumepjp") + .withSchemaType(SchemaType.XSD), + new Schema().withId("zpphepif") + .withConnectionId("leqirccjclykcgxv") + .withStatus(SchemaStatus.NEW) + .withName("vczuodacpune") + .withContent("epdjxqeskoyn") + .withDirection(Direction.RECEIVE) + .withSchemaUri("pckaewse") + .withSchemaType(SchemaType.XSD))) + .withSchemaUris(Arrays.asList("w")) + .withApiHostname("gqphrgfnzhctmjts")) + .withIdentity( + new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf("zx", new UserAssignedIdentity(), "iukvzwydwt", new UserAssignedIdentity()))) + .create(); + + Assertions.assertEquals("vk", response.location()); + Assertions.assertEquals("tnsqxtlt", response.tags().get("lkrdpqgfhy")); + Assertions.assertEquals("ogd", response.properties().pipeline()); + Assertions.assertEquals(Direction.RECEIVE, response.properties().direction()); + Assertions.assertEquals("cmkrftsjcwjj", response.properties().justification()); + Assertions.assertEquals(FlowType.DISK_IMAGES, response.properties().flowTypes().get(0)); + Assertions.assertEquals("lcpx", response.properties().flowProfileList().get(0).pipeline()); + Assertions.assertEquals("vir", response.properties().flowProfileList().get(0).name()); + Assertions.assertEquals(DataClassType.MESSAGING, + response.properties().flowProfileList().get(0).replicationScenario()); + Assertions.assertEquals("yngjgvrquvpygglp", response.properties().flowProfileList().get(0).flowProfileId()); + Assertions.assertEquals(FlowProfileStatus.ENABLED, response.properties().flowProfileList().get(0).status()); + Assertions.assertEquals("rdcueljtiahx", response.properties().flowProfileList().get(0).description()); + Assertions.assertEquals("ojhpcnabxzfsn", response.properties().requirementId()); + Assertions.assertEquals("ytexvzilmhivzk", response.properties().remoteSubscriptionId()); + Assertions.assertEquals("ajlskzptj", response.properties().pin()); + Assertions.assertEquals("eucyrth", response.properties().primaryContact()); + Assertions.assertEquals("ehmcgcje", response.properties().secondaryContacts().get(0)); + Assertions.assertEquals("ivfokpysthhzagj", response.properties().policies().get(0)); + Assertions.assertEquals("rlhgenuze", response.properties().schemas().get(0).id()); + Assertions.assertEquals("vkvebaqsz", response.properties().schemas().get(0).connectionId()); + Assertions.assertEquals(SchemaStatus.NEW, response.properties().schemas().get(0).status()); + Assertions.assertEquals("lsmmdqgmi", response.properties().schemas().get(0).name()); + Assertions.assertEquals("pimcqrhn", response.properties().schemas().get(0).content()); + Assertions.assertEquals(Direction.SEND, response.properties().schemas().get(0).direction()); + Assertions.assertEquals("nklogxsvtzarhzv", response.properties().schemas().get(0).schemaUri()); + Assertions.assertEquals(SchemaType.ZIP, response.properties().schemas().get(0).schemaType()); + Assertions.assertEquals("toleksc", response.properties().schemaUris().get(0)); + Assertions.assertEquals("laimouxwk", response.properties().apiHostname()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsGetByResourceGroupWithResponseMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsGetByResourceGroupWithResponseMockTests.java new file mode 100644 index 0000000000000..8a9fdd9fb65ed --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsGetByResourceGroupWithResponseMockTests.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.Connection; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.Direction; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.SchemaStatus; +import com.azure.resourcemanager.datatransfer.models.SchemaType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ConnectionsGetByResourceGroupWithResponseMockTests { + @Test + public void testGetByResourceGroupWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"pipeline\":\"xv\",\"direction\":\"Receive\",\"justification\":\"bczsulmdgglmepjp\",\"status\":\"Accepted\",\"forceDisabledStatus\":[\"ConnectionForceDisabled\",\"ConnectionForceDisabled\",\"FlowProfileForceDisabled\"],\"statusReason\":\"gpszngafpg\",\"linkStatus\":\"Linked\",\"linkedConnectionId\":\"ecjujcng\",\"flowTypes\":[\"Complex\",\"Unknown\",\"Standard\"],\"flowProfileList\":[{\"pipeline\":\"rgjfoknubnoi\",\"name\":\"pkpztrg\",\"replicationScenario\":\"Files\",\"flowProfileId\":\"x\",\"status\":\"Enabled\",\"description\":\"oqraswugyxpqi\"},{\"pipeline\":\"we\",\"name\":\"alwvskbu\",\"replicationScenario\":\"Complex\",\"flowProfileId\":\"acaqtyltcoqcu\",\"status\":\"Disabled\",\"description\":\"dsxzakuejkmvb\"}],\"requirementId\":\"tjo\",\"remoteSubscriptionId\":\"cvovjufyc\",\"approver\":\"mlbemy\",\"pin\":\"iriuxegthortu\",\"dateSubmitted\":\"2021-02-02T10:39:58Z\",\"primaryContact\":\"pjfe\",\"secondaryContacts\":[\"rpptcbgqnzmnhiil\",\"alwcjgckbb\"],\"provisioningState\":\"Canceled\",\"policies\":[\"praoxn\",\"uffatsgftipwc\"],\"schemas\":[{\"id\":\"bh\",\"connectionId\":\"dxyurnpnuhza\",\"status\":\"Approved\",\"name\":\"uhiigbyl\",\"content\":\"igvxvatvcrk\",\"direction\":\"Send\",\"schemaUri\":\"bqxvhcsyhzlwxae\",\"schemaType\":\"Xsd\"},{\"id\":\"rexdndsbd\",\"connectionId\":\"aderzmw\",\"status\":\"Approved\",\"name\":\"agttm\",\"content\":\"magoaqylkjz\",\"direction\":\"Send\",\"schemaUri\":\"azjcgmxitpfin\",\"schemaType\":\"Xsd\"}],\"schemaUris\":[\"tkrlgjmtbd\",\"vcqguefzh\"],\"apiHostname\":\"p\"},\"identity\":{\"principalId\":\"durelyujl\",\"tenantId\":\"oumpcky\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"jc\":{\"principalId\":\"igptajbrzmqxucyc\",\"clientId\":\"oclxiut\"},\"wvua\":{\"principalId\":\"yzjdnrqjbt\",\"clientId\":\"eaoqaqbzgyhf\"}}},\"location\":\"wbqamteuliy\",\"tags\":{\"bormcqmiciijqpkz\":\"kcvmwfauxxepmy\",\"wixvcpwnkwywzw\":\"bojxjmcsmy\"},\"id\":\"falickduoiqtamty\",\"name\":\"sknxrwzawnvsbcf\",\"type\":\"zagxnvhycvdi\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Connection response = manager.connections() + .getByResourceGroupWithResponse("uquowtljvfwhr", "agk", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("wbqamteuliy", response.location()); + Assertions.assertEquals("kcvmwfauxxepmy", response.tags().get("bormcqmiciijqpkz")); + Assertions.assertEquals("xv", response.properties().pipeline()); + Assertions.assertEquals(Direction.RECEIVE, response.properties().direction()); + Assertions.assertEquals("bczsulmdgglmepjp", response.properties().justification()); + Assertions.assertEquals(FlowType.COMPLEX, response.properties().flowTypes().get(0)); + Assertions.assertEquals("rgjfoknubnoi", response.properties().flowProfileList().get(0).pipeline()); + Assertions.assertEquals("pkpztrg", response.properties().flowProfileList().get(0).name()); + Assertions.assertEquals(DataClassType.FILES, + response.properties().flowProfileList().get(0).replicationScenario()); + Assertions.assertEquals("x", response.properties().flowProfileList().get(0).flowProfileId()); + Assertions.assertEquals(FlowProfileStatus.ENABLED, response.properties().flowProfileList().get(0).status()); + Assertions.assertEquals("oqraswugyxpqi", response.properties().flowProfileList().get(0).description()); + Assertions.assertEquals("tjo", response.properties().requirementId()); + Assertions.assertEquals("cvovjufyc", response.properties().remoteSubscriptionId()); + Assertions.assertEquals("iriuxegthortu", response.properties().pin()); + Assertions.assertEquals("pjfe", response.properties().primaryContact()); + Assertions.assertEquals("rpptcbgqnzmnhiil", response.properties().secondaryContacts().get(0)); + Assertions.assertEquals("praoxn", response.properties().policies().get(0)); + Assertions.assertEquals("bh", response.properties().schemas().get(0).id()); + Assertions.assertEquals("dxyurnpnuhza", response.properties().schemas().get(0).connectionId()); + Assertions.assertEquals(SchemaStatus.APPROVED, response.properties().schemas().get(0).status()); + Assertions.assertEquals("uhiigbyl", response.properties().schemas().get(0).name()); + Assertions.assertEquals("igvxvatvcrk", response.properties().schemas().get(0).content()); + Assertions.assertEquals(Direction.SEND, response.properties().schemas().get(0).direction()); + Assertions.assertEquals("bqxvhcsyhzlwxae", response.properties().schemas().get(0).schemaUri()); + Assertions.assertEquals(SchemaType.XSD, response.properties().schemas().get(0).schemaType()); + Assertions.assertEquals("tkrlgjmtbd", response.properties().schemaUris().get(0)); + Assertions.assertEquals("p", response.properties().apiHostname()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, response.identity().type()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsLinkMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsLinkMockTests.java new file mode 100644 index 0000000000000..2fbc27380cf13 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsLinkMockTests.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.Connection; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.Direction; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.ResourceBody; +import com.azure.resourcemanager.datatransfer.models.SchemaStatus; +import com.azure.resourcemanager.datatransfer.models.SchemaType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ConnectionsLinkMockTests { + @Test + public void testLink() throws Exception { + String responseStr + = "{\"properties\":{\"pipeline\":\"b\",\"direction\":\"Send\",\"justification\":\"cpahprzrvxhm\",\"status\":\"InReview\",\"forceDisabledStatus\":[\"FlowTypeForceDisabled\",\"PipelineForceDisabled\"],\"statusReason\":\"cmj\",\"linkStatus\":\"Unlinked\",\"linkedConnectionId\":\"noq\",\"flowTypes\":[\"MicrosoftInternal\",\"Data\",\"DevSecOps\",\"DiskImages\"],\"flowProfileList\":[{\"pipeline\":\"vhdl\",\"name\":\"ydidwhepfwwtjf\",\"replicationScenario\":\"Complex\",\"flowProfileId\":\"esxxhmwcdbckyoi\",\"status\":\"Obsolete\",\"description\":\"kxhnegknj\"},{\"pipeline\":\"rbhtmeplvukaobr\",\"name\":\"bpgsnbagnc\",\"replicationScenario\":\"Files\",\"flowProfileId\":\"hg\",\"status\":\"Disabled\",\"description\":\"uowakyw\"},{\"pipeline\":\"lhjym\",\"name\":\"cgqtag\",\"replicationScenario\":\"Complex\",\"flowProfileId\":\"clssoljomevtfyc\",\"status\":\"Enabled\",\"description\":\"bvgjcodkkgj\"}],\"requirementId\":\"ytssikiz\",\"remoteSubscriptionId\":\"ufqbvntnr\",\"approver\":\"qsorh\",\"pin\":\"kxgnlykmxcpwzvmd\",\"dateSubmitted\":\"2021-02-15T15:11:30Z\",\"primaryContact\":\"dt\",\"secondaryContacts\":[\"wxlboncqbazqicq\",\"hygtv\",\"byjanep\",\"bdpkxyqvgx\"],\"provisioningState\":\"Succeeded\",\"policies\":[\"tvo\",\"kxdxuwsaifmcwn\",\"s\",\"zlehgcvkbcknjolg\"],\"schemas\":[{\"id\":\"pvelszerqze\",\"connectionId\":\"o\",\"status\":\"New\",\"name\":\"txwaljglzo\",\"content\":\"qwaafrqulhm\",\"direction\":\"Send\",\"schemaUri\":\"hdvafjrqpjiyrqjc\",\"schemaType\":\"Xsd\"},{\"id\":\"wmzwdfkbnrzorpdl\",\"connectionId\":\"qctqjfg\",\"status\":\"Approved\",\"name\":\"etgzdgvpy\",\"content\":\"daqqilzdc\",\"direction\":\"Send\",\"schemaUri\":\"oedxngucaifpaurw\",\"schemaType\":\"Zip\"},{\"id\":\"fjqq\",\"connectionId\":\"dmkxwxdcvjwcy\",\"status\":\"Approved\",\"name\":\"eciqchxr\",\"content\":\"icdsiwd\",\"direction\":\"Receive\",\"schemaUri\":\"zhzzwvywrg\",\"schemaType\":\"Zip\"},{\"id\":\"dgrpx\",\"connectionId\":\"akiqa\",\"status\":\"Approved\",\"name\":\"rkclamg\",\"content\":\"vlmfej\",\"direction\":\"Send\",\"schemaUri\":\"ykglt\",\"schemaType\":\"Xsd\"}],\"schemaUris\":[\"fgqka\",\"ejsxt\",\"gflwfgziiucijj\",\"eatlijjjrtvamcas\"],\"apiHostname\":\"nxkvccxetyvku\"},\"identity\":{\"principalId\":\"gno\",\"tenantId\":\"k\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"bjywfcfxzi\":{\"principalId\":\"jwpindedvabbxbh\",\"clientId\":\"dei\"},\"zwci\":{\"principalId\":\"zi\",\"clientId\":\"wypusuvjsl\"},\"dqacfrgnawbabgf\":{\"principalId\":\"jsllfryvd\",\"clientId\":\"x\"},\"syqkfrbzgowox\":{\"principalId\":\"t\",\"clientId\":\"mfczl\"}}},\"location\":\"je\",\"tags\":{\"xisimjceagbj\":\"xnyqgxhlusr\"},\"id\":\"vl\",\"name\":\"umyw\",\"type\":\"ashxgonoyjfqi\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Connection response = manager.connections() + .link("hez", "quwusq", new ResourceBody().withId("utrpbr").withStatusReason("yuuatvlmbjwcolbm"), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("je", response.location()); + Assertions.assertEquals("xnyqgxhlusr", response.tags().get("xisimjceagbj")); + Assertions.assertEquals("b", response.properties().pipeline()); + Assertions.assertEquals(Direction.SEND, response.properties().direction()); + Assertions.assertEquals("cpahprzrvxhm", response.properties().justification()); + Assertions.assertEquals(FlowType.MICROSOFT_INTERNAL, response.properties().flowTypes().get(0)); + Assertions.assertEquals("vhdl", response.properties().flowProfileList().get(0).pipeline()); + Assertions.assertEquals("ydidwhepfwwtjf", response.properties().flowProfileList().get(0).name()); + Assertions.assertEquals(DataClassType.COMPLEX, + response.properties().flowProfileList().get(0).replicationScenario()); + Assertions.assertEquals("esxxhmwcdbckyoi", response.properties().flowProfileList().get(0).flowProfileId()); + Assertions.assertEquals(FlowProfileStatus.OBSOLETE, response.properties().flowProfileList().get(0).status()); + Assertions.assertEquals("kxhnegknj", response.properties().flowProfileList().get(0).description()); + Assertions.assertEquals("ytssikiz", response.properties().requirementId()); + Assertions.assertEquals("ufqbvntnr", response.properties().remoteSubscriptionId()); + Assertions.assertEquals("kxgnlykmxcpwzvmd", response.properties().pin()); + Assertions.assertEquals("dt", response.properties().primaryContact()); + Assertions.assertEquals("wxlboncqbazqicq", response.properties().secondaryContacts().get(0)); + Assertions.assertEquals("tvo", response.properties().policies().get(0)); + Assertions.assertEquals("pvelszerqze", response.properties().schemas().get(0).id()); + Assertions.assertEquals("o", response.properties().schemas().get(0).connectionId()); + Assertions.assertEquals(SchemaStatus.NEW, response.properties().schemas().get(0).status()); + Assertions.assertEquals("txwaljglzo", response.properties().schemas().get(0).name()); + Assertions.assertEquals("qwaafrqulhm", response.properties().schemas().get(0).content()); + Assertions.assertEquals(Direction.SEND, response.properties().schemas().get(0).direction()); + Assertions.assertEquals("hdvafjrqpjiyrqjc", response.properties().schemas().get(0).schemaUri()); + Assertions.assertEquals(SchemaType.XSD, response.properties().schemas().get(0).schemaType()); + Assertions.assertEquals("fgqka", response.properties().schemaUris().get(0)); + Assertions.assertEquals("nxkvccxetyvku", response.properties().apiHostname()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, response.identity().type()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsListByResourceGroupMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsListByResourceGroupMockTests.java new file mode 100644 index 0000000000000..9500da29b711b --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsListByResourceGroupMockTests.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.Connection; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.Direction; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.SchemaStatus; +import com.azure.resourcemanager.datatransfer.models.SchemaType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ConnectionsListByResourceGroupMockTests { + @Test + public void testListByResourceGroup() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"pipeline\":\"yshtuwgmev\",\"direction\":\"Receive\",\"justification\":\"wzyif\",\"status\":\"Rejected\",\"forceDisabledStatus\":[\"FlowTypeForceDisabled\",\"FlowTypeForceDisabled\"],\"statusReason\":\"qipxgzdyimsf\",\"linkStatus\":\"Unlinked\",\"linkedConnectionId\":\"pra\",\"flowTypes\":[\"MicrosoftInternal\",\"Standard\",\"DevSecOps\",\"DevSecOps\"],\"flowProfileList\":[{\"pipeline\":\"bnsmjkwynqxaek\",\"name\":\"sykvwjtqpke\",\"replicationScenario\":\"API\",\"flowProfileId\":\"yltjcrspxklu\",\"status\":\"Disabled\",\"description\":\"clf\"},{\"pipeline\":\"xa\",\"name\":\"n\",\"replicationScenario\":\"Complex\",\"flowProfileId\":\"ytzpo\",\"status\":\"Disabled\",\"description\":\"wxigpxv\"}],\"requirementId\":\"maupxvpi\",\"remoteSubscriptionId\":\"f\",\"approver\":\"fyzyzeyuub\",\"pin\":\"ds\",\"dateSubmitted\":\"2021-12-08T13:19:29Z\",\"primaryContact\":\"toi\",\"secondaryContacts\":[\"ygvfltgvdihoyn\",\"rxwe\",\"wkd\",\"cy\"],\"provisioningState\":\"Canceled\",\"policies\":[\"unnuzdqumoenodn\",\"ienhqhskndnelq\",\"aadl\",\"nwf\"],\"schemas\":[{\"id\":\"iyop\",\"connectionId\":\"xivcnrlyxnu\",\"status\":\"Approved\",\"name\":\"hblkwqpatvbq\",\"content\":\"tcjb\",\"direction\":\"Receive\",\"schemaUri\":\"vuzqymt\",\"schemaType\":\"Zip\"},{\"id\":\"gtgitsqhzvbrzcdb\",\"connectionId\":\"fzndscxmxeatkd\",\"status\":\"Approved\",\"name\":\"rdjyibqb\",\"content\":\"omhjrmkuhm\",\"direction\":\"Receive\",\"schemaUri\":\"alfihcjmobcancd\",\"schemaType\":\"Xsd\"},{\"id\":\"cwg\",\"connectionId\":\"fgvaknokzwj\",\"status\":\"New\",\"name\":\"tixldzyyfytpqs\",\"content\":\"ymmpujivy\",\"direction\":\"Send\",\"schemaUri\":\"uvsmbms\",\"schemaType\":\"Xsd\"}],\"schemaUris\":[\"vwzdbpqvyb\",\"fgvmx\",\"okcvtlubses\",\"vcuartrhun\"],\"apiHostname\":\"iryky\"},\"identity\":{\"principalId\":\"zf\",\"tenantId\":\"vjreuykbbmnw\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"pb\":{\"principalId\":\"xoe\",\"clientId\":\"nqlnfwmyymvqd\"},\"bnqfblhk\":{\"principalId\":\"ckdvez\",\"clientId\":\"cssbzhddu\"}}},\"location\":\"ehpavawugiqjtiog\",\"tags\":{\"eajohiyg\":\"minict\",\"kmktpvwxqcseh\":\"pnbonhpcz\"},\"id\":\"hkhufm\",\"name\":\"qumq\",\"type\":\"jgydzul\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.connections().listByResourceGroup("ihmxrfdsajredn", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("ehpavawugiqjtiog", response.iterator().next().location()); + Assertions.assertEquals("minict", response.iterator().next().tags().get("eajohiyg")); + Assertions.assertEquals("yshtuwgmev", response.iterator().next().properties().pipeline()); + Assertions.assertEquals(Direction.RECEIVE, response.iterator().next().properties().direction()); + Assertions.assertEquals("wzyif", response.iterator().next().properties().justification()); + Assertions.assertEquals(FlowType.MICROSOFT_INTERNAL, + response.iterator().next().properties().flowTypes().get(0)); + Assertions.assertEquals("bnsmjkwynqxaek", + response.iterator().next().properties().flowProfileList().get(0).pipeline()); + Assertions.assertEquals("sykvwjtqpke", response.iterator().next().properties().flowProfileList().get(0).name()); + Assertions.assertEquals(DataClassType.API, + response.iterator().next().properties().flowProfileList().get(0).replicationScenario()); + Assertions.assertEquals("yltjcrspxklu", + response.iterator().next().properties().flowProfileList().get(0).flowProfileId()); + Assertions.assertEquals(FlowProfileStatus.DISABLED, + response.iterator().next().properties().flowProfileList().get(0).status()); + Assertions.assertEquals("clf", response.iterator().next().properties().flowProfileList().get(0).description()); + Assertions.assertEquals("maupxvpi", response.iterator().next().properties().requirementId()); + Assertions.assertEquals("f", response.iterator().next().properties().remoteSubscriptionId()); + Assertions.assertEquals("ds", response.iterator().next().properties().pin()); + Assertions.assertEquals("toi", response.iterator().next().properties().primaryContact()); + Assertions.assertEquals("ygvfltgvdihoyn", response.iterator().next().properties().secondaryContacts().get(0)); + Assertions.assertEquals("unnuzdqumoenodn", response.iterator().next().properties().policies().get(0)); + Assertions.assertEquals("iyop", response.iterator().next().properties().schemas().get(0).id()); + Assertions.assertEquals("xivcnrlyxnu", response.iterator().next().properties().schemas().get(0).connectionId()); + Assertions.assertEquals(SchemaStatus.APPROVED, + response.iterator().next().properties().schemas().get(0).status()); + Assertions.assertEquals("hblkwqpatvbq", response.iterator().next().properties().schemas().get(0).name()); + Assertions.assertEquals("tcjb", response.iterator().next().properties().schemas().get(0).content()); + Assertions.assertEquals(Direction.RECEIVE, + response.iterator().next().properties().schemas().get(0).direction()); + Assertions.assertEquals("vuzqymt", response.iterator().next().properties().schemas().get(0).schemaUri()); + Assertions.assertEquals(SchemaType.ZIP, response.iterator().next().properties().schemas().get(0).schemaType()); + Assertions.assertEquals("vwzdbpqvyb", response.iterator().next().properties().schemaUris().get(0)); + Assertions.assertEquals("iryky", response.iterator().next().properties().apiHostname()); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsListBySubscriptionMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsListBySubscriptionMockTests.java new file mode 100644 index 0000000000000..9120e1196d64f --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsListBySubscriptionMockTests.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.Connection; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.Direction; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.SchemaStatus; +import com.azure.resourcemanager.datatransfer.models.SchemaType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ConnectionsListBySubscriptionMockTests { + @Test + public void testListBySubscription() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"pipeline\":\"saeuzanhsfnhsenw\",\"direction\":\"Receive\",\"justification\":\"fngq\",\"status\":\"Rejected\",\"forceDisabledStatus\":[\"PipelineForceDisabled\",\"FlowTypeForceDisabled\",\"ConnectionForceDisabled\",\"ConnectionForceDisabled\"],\"statusReason\":\"jj\",\"linkStatus\":\"Unlinked\",\"linkedConnectionId\":\"eqrkuorhtss\",\"flowTypes\":[\"Standard\",\"Data\",\"Unknown\"],\"flowProfileList\":[{\"pipeline\":\"azcvjyt\",\"name\":\"qswbqerzwx\",\"replicationScenario\":\"SoftwareArtifacts\",\"flowProfileId\":\"txtd\",\"status\":\"Disabled\",\"description\":\"kvlbpktgdstyoua\"},{\"pipeline\":\"bewreswmowegmmut\",\"name\":\"yxey\",\"replicationScenario\":\"Messaging\",\"flowProfileId\":\"qigijiitnspxlzde\",\"status\":\"Obsolete\",\"description\":\"grijwaiufanrayb\"},{\"pipeline\":\"ueqfrojsyd\",\"name\":\"rhydkygywez\",\"replicationScenario\":\"Messaging\",\"flowProfileId\":\"iecafygzmxi\",\"status\":\"Obsolete\",\"description\":\"vdsmaklixq\"},{\"pipeline\":\"ah\",\"name\":\"hxalybxawo\",\"replicationScenario\":\"SoftwareArtifacts\",\"flowProfileId\":\"podtblx\",\"status\":\"Enabled\",\"description\":\"kwjdjodqhy\"}],\"requirementId\":\"ncn\",\"remoteSubscriptionId\":\"mehllizhceu\",\"approver\":\"qodkadppyibngql\",\"pin\":\"ywrxw\",\"dateSubmitted\":\"2021-10-19T14:36:18Z\",\"primaryContact\":\"luvvad\",\"secondaryContacts\":[\"snuyemlowuowhl\"],\"provisioningState\":\"Failed\",\"policies\":[\"rmouvb\"],\"schemas\":[{\"id\":\"kzkltrfowt\",\"connectionId\":\"rfmvlihcvjdrqcrj\",\"status\":\"New\",\"name\":\"tuk\",\"content\":\"dxlwyojbfqz\",\"direction\":\"Send\",\"schemaUri\":\"jyixhaf\",\"schemaType\":\"Xsd\"}],\"schemaUris\":[\"mbjrou\",\"zznval\"],\"apiHostname\":\"rhuzgfxonjtpu\"},\"identity\":{\"principalId\":\"ywpvt\",\"tenantId\":\"tzbpdbollgry\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"mwiuawvcm\":{\"principalId\":\"sigrowsocnequygd\",\"clientId\":\"oqgrmtqjkqevadr\"},\"am\":{\"principalId\":\"kxiidisczskoswo\",\"clientId\":\"qazu\"}}},\"location\":\"krrcoiisbamnpp\",\"tags\":{\"zxuizhyhnepkpe\":\"kuztdsbezaxyfu\",\"xdazv\":\"iarxqiubxdukec\",\"dblnsntrp\":\"hctmmkosz\"},\"id\":\"aqkiofkb\",\"name\":\"fmhklbnld\",\"type\":\"vcb\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.connections().listBySubscription(com.azure.core.util.Context.NONE); + + Assertions.assertEquals("krrcoiisbamnpp", response.iterator().next().location()); + Assertions.assertEquals("kuztdsbezaxyfu", response.iterator().next().tags().get("zxuizhyhnepkpe")); + Assertions.assertEquals("saeuzanhsfnhsenw", response.iterator().next().properties().pipeline()); + Assertions.assertEquals(Direction.RECEIVE, response.iterator().next().properties().direction()); + Assertions.assertEquals("fngq", response.iterator().next().properties().justification()); + Assertions.assertEquals(FlowType.STANDARD, response.iterator().next().properties().flowTypes().get(0)); + Assertions.assertEquals("azcvjyt", response.iterator().next().properties().flowProfileList().get(0).pipeline()); + Assertions.assertEquals("qswbqerzwx", response.iterator().next().properties().flowProfileList().get(0).name()); + Assertions.assertEquals(DataClassType.SOFTWARE_ARTIFACTS, + response.iterator().next().properties().flowProfileList().get(0).replicationScenario()); + Assertions.assertEquals("txtd", + response.iterator().next().properties().flowProfileList().get(0).flowProfileId()); + Assertions.assertEquals(FlowProfileStatus.DISABLED, + response.iterator().next().properties().flowProfileList().get(0).status()); + Assertions.assertEquals("kvlbpktgdstyoua", + response.iterator().next().properties().flowProfileList().get(0).description()); + Assertions.assertEquals("ncn", response.iterator().next().properties().requirementId()); + Assertions.assertEquals("mehllizhceu", response.iterator().next().properties().remoteSubscriptionId()); + Assertions.assertEquals("ywrxw", response.iterator().next().properties().pin()); + Assertions.assertEquals("luvvad", response.iterator().next().properties().primaryContact()); + Assertions.assertEquals("snuyemlowuowhl", response.iterator().next().properties().secondaryContacts().get(0)); + Assertions.assertEquals("rmouvb", response.iterator().next().properties().policies().get(0)); + Assertions.assertEquals("kzkltrfowt", response.iterator().next().properties().schemas().get(0).id()); + Assertions.assertEquals("rfmvlihcvjdrqcrj", + response.iterator().next().properties().schemas().get(0).connectionId()); + Assertions.assertEquals(SchemaStatus.NEW, response.iterator().next().properties().schemas().get(0).status()); + Assertions.assertEquals("tuk", response.iterator().next().properties().schemas().get(0).name()); + Assertions.assertEquals("dxlwyojbfqz", response.iterator().next().properties().schemas().get(0).content()); + Assertions.assertEquals(Direction.SEND, response.iterator().next().properties().schemas().get(0).direction()); + Assertions.assertEquals("jyixhaf", response.iterator().next().properties().schemas().get(0).schemaUri()); + Assertions.assertEquals(SchemaType.XSD, response.iterator().next().properties().schemas().get(0).schemaType()); + Assertions.assertEquals("mbjrou", response.iterator().next().properties().schemaUris().get(0)); + Assertions.assertEquals("rhuzgfxonjtpu", response.iterator().next().properties().apiHostname()); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsListMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsListMockTests.java new file mode 100644 index 0000000000000..79e3b5f0c75db --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsListMockTests.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.Direction; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.PendingConnection; +import com.azure.resourcemanager.datatransfer.models.SchemaStatus; +import com.azure.resourcemanager.datatransfer.models.SchemaType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ConnectionsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"subscriptionId\":\"bgvopemt\",\"pipeline\":\"oqujlyegqavn\",\"direction\":\"Receive\",\"justification\":\"qqbtny\",\"status\":\"InReview\",\"forceDisabledStatus\":[\"FlowTypeForceDisabled\"],\"statusReason\":\"fvabmvmsxba\",\"linkStatus\":\"Unlinked\",\"linkedConnectionId\":\"cnkottlwuhva\",\"flowTypes\":[\"BasicFiles\",\"Opaque\",\"MicrosoftInternal\"],\"flowProfileList\":[{\"pipeline\":\"jjzakzwjiqullqx\",\"name\":\"dmvr\",\"replicationScenario\":\"SoftwareArtifacts\",\"flowProfileId\":\"mqerndb\",\"status\":\"Disabled\",\"description\":\"yeofltfnnxrkad\"}],\"requirementId\":\"ynnfmuiii\",\"remoteSubscriptionId\":\"pfoh\",\"approver\":\"fkx\",\"pin\":\"cbrwjiutgnjizbe\",\"dateSubmitted\":\"2021-09-10T20:40:06Z\",\"primaryContact\":\"ymrvzbju\",\"secondaryContacts\":[\"rziuctixgbdsuif\",\"evkaa\"],\"provisioningState\":\"Accepted\",\"policies\":[\"swqjm\",\"g\",\"syparybjufp\"],\"schemas\":[{\"id\":\"z\",\"connectionId\":\"ciuiyqvldaswv\",\"status\":\"New\",\"name\":\"qqzlgcndhz\",\"content\":\"rfc\",\"direction\":\"Send\",\"schemaUri\":\"khgsnxuwwkpphefs\",\"schemaType\":\"Xsd\"},{\"id\":\"bzxomeik\",\"connectionId\":\"lwzacn\",\"status\":\"Approved\",\"name\":\"suqtaazyqbx\",\"content\":\"oyfpuq\",\"direction\":\"Send\",\"schemaUri\":\"zxlhdjzqdcadwv\",\"schemaType\":\"Xsd\"},{\"id\":\"j\",\"connectionId\":\"hjriyb\",\"status\":\"New\",\"name\":\"epnxwd\",\"content\":\"njkgvfnmx\",\"direction\":\"Send\",\"schemaUri\":\"q\",\"schemaType\":\"Zip\"}],\"schemaUris\":[\"yibuyvpirfqjpnqn\",\"owsbedenrexkxbh\",\"vucnulgmnh\",\"evdyz\"],\"apiHostname\":\"ajsvk\",\"tags\":{\"xlqfh\":\"qozzkivyhjrliizj\",\"solronqqlm\":\"fkwa\",\"hvuqbo\":\"nlqxsjxtele\"},\"location\":\"oolzqocarkuzl\",\"id\":\"nndtsnxa\",\"name\":\"ytllhdyzmy\",\"type\":\"zexnxakcky\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.connections().list("ubyzn", "lkfk", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("oqujlyegqavn", response.iterator().next().pipeline()); + Assertions.assertEquals(Direction.RECEIVE, response.iterator().next().direction()); + Assertions.assertEquals("qqbtny", response.iterator().next().justification()); + Assertions.assertEquals(FlowType.BASIC_FILES, response.iterator().next().flowTypes().get(0)); + Assertions.assertEquals("jjzakzwjiqullqx", response.iterator().next().flowProfileList().get(0).pipeline()); + Assertions.assertEquals("dmvr", response.iterator().next().flowProfileList().get(0).name()); + Assertions.assertEquals(DataClassType.SOFTWARE_ARTIFACTS, + response.iterator().next().flowProfileList().get(0).replicationScenario()); + Assertions.assertEquals("mqerndb", response.iterator().next().flowProfileList().get(0).flowProfileId()); + Assertions.assertEquals(FlowProfileStatus.DISABLED, + response.iterator().next().flowProfileList().get(0).status()); + Assertions.assertEquals("yeofltfnnxrkad", response.iterator().next().flowProfileList().get(0).description()); + Assertions.assertEquals("ynnfmuiii", response.iterator().next().requirementId()); + Assertions.assertEquals("pfoh", response.iterator().next().remoteSubscriptionId()); + Assertions.assertEquals("cbrwjiutgnjizbe", response.iterator().next().pin()); + Assertions.assertEquals("ymrvzbju", response.iterator().next().primaryContact()); + Assertions.assertEquals("rziuctixgbdsuif", response.iterator().next().secondaryContacts().get(0)); + Assertions.assertEquals("swqjm", response.iterator().next().policies().get(0)); + Assertions.assertEquals("z", response.iterator().next().schemas().get(0).id()); + Assertions.assertEquals("ciuiyqvldaswv", response.iterator().next().schemas().get(0).connectionId()); + Assertions.assertEquals(SchemaStatus.NEW, response.iterator().next().schemas().get(0).status()); + Assertions.assertEquals("qqzlgcndhz", response.iterator().next().schemas().get(0).name()); + Assertions.assertEquals("rfc", response.iterator().next().schemas().get(0).content()); + Assertions.assertEquals(Direction.SEND, response.iterator().next().schemas().get(0).direction()); + Assertions.assertEquals("khgsnxuwwkpphefs", response.iterator().next().schemas().get(0).schemaUri()); + Assertions.assertEquals(SchemaType.XSD, response.iterator().next().schemas().get(0).schemaType()); + Assertions.assertEquals("yibuyvpirfqjpnqn", response.iterator().next().schemaUris().get(0)); + Assertions.assertEquals("ajsvk", response.iterator().next().apiHostname()); + Assertions.assertEquals("qozzkivyhjrliizj", response.iterator().next().tags().get("xlqfh")); + Assertions.assertEquals("oolzqocarkuzl", response.iterator().next().location()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsPatchTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsPatchTests.java new file mode 100644 index 0000000000000..11b93e4f28d64 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsPatchTests.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.ConnectionsPatch; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ConnectionsPatchTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConnectionsPatch model = BinaryData.fromString( + "{\"identity\":{\"principalId\":\"sxiftozq\",\"tenantId\":\"hftwesgog\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"rghxjb\":{\"principalId\":\"nxkrlgnyhmossxkk\",\"clientId\":\"h\"},\"z\":{\"principalId\":\"qxvcxgfrpdsofb\",\"clientId\":\"rnsvbuswd\"},\"yuxzejntpsewgi\":{\"principalId\":\"bycnunvjsrtkf\",\"clientId\":\"nopqgikyzirtx\"}}},\"tags\":{\"mieoxorgguf\":\"qukrydxt\"}}") + .toObject(ConnectionsPatch.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals("qukrydxt", model.tags().get("mieoxorgguf")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ConnectionsPatch model = new ConnectionsPatch() + .withIdentity( + new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("rghxjb", new UserAssignedIdentity(), "z", + new UserAssignedIdentity(), "yuxzejntpsewgi", new UserAssignedIdentity()))) + .withTags(mapOf("mieoxorgguf", "qukrydxt")); + model = BinaryData.fromObject(model).toObject(ConnectionsPatch.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals("qukrydxt", model.tags().get("mieoxorgguf")); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsUpdateMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsUpdateMockTests.java new file mode 100644 index 0000000000000..d8a4a53ff94ba --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ConnectionsUpdateMockTests.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.ConnectionsPatch; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.UserAssignedIdentity; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ConnectionsUpdateMockTests { + @Test + public void testUpdate() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.connections() + .update("wrzregzgyufu", "rw", + new ConnectionsPatch() + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("n", new UserAssignedIdentity()))) + .withTags(mapOf("jpnwynudql", "i", "lxeehuxiq", "zsauzp", "xls", "zlrayme")), + com.azure.core.util.Context.NONE); + + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/DataSizeRulesetTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/DataSizeRulesetTests.java new file mode 100644 index 0000000000000..0d21a2ba11af4 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/DataSizeRulesetTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.DataSizeRuleset; +import org.junit.jupiter.api.Assertions; + +public final class DataSizeRulesetTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DataSizeRuleset model + = BinaryData.fromString("{\"maximum\":6291019914364012844,\"minimum\":801620479699597544}") + .toObject(DataSizeRuleset.class); + Assertions.assertEquals(6291019914364012844L, model.maximum()); + Assertions.assertEquals(801620479699597544L, model.minimum()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DataSizeRuleset model + = new DataSizeRuleset().withMaximum(6291019914364012844L).withMinimum(801620479699597544L); + model = BinaryData.fromObject(model).toObject(DataSizeRuleset.class); + Assertions.assertEquals(6291019914364012844L, model.maximum()); + Assertions.assertEquals(801620479699597544L, model.minimum()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/DirectionSettingsTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/DirectionSettingsTests.java new file mode 100644 index 0000000000000..84368da547476 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/DirectionSettingsTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.DirectionSettings; +import com.azure.resourcemanager.datatransfer.models.EnablementStatus; +import com.azure.resourcemanager.datatransfer.models.FlowBillingTier; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import org.junit.jupiter.api.Assertions; + +public final class DirectionSettingsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DirectionSettings model = BinaryData.fromString( + "{\"completeLinking\":\"Disabled\",\"connectionApprovals\":\"Enabled\",\"flowApprovals\":\"Disabled\",\"flowTypesAvailable\":[\"Unknown\",\"Complex\"],\"messagingFlowTypeSchemaValidation\":\"Enabled\",\"flowProfileDataClassesAvailable\":[\"Files\",\"Stream\",\"Messaging\"],\"messagingFlowsPricingOptions\":[\"BlobTransport\",\"Standard\",\"Premium\"]}") + .toObject(DirectionSettings.class); + Assertions.assertEquals(EnablementStatus.DISABLED, model.completeLinking()); + Assertions.assertEquals(EnablementStatus.ENABLED, model.connectionApprovals()); + Assertions.assertEquals(EnablementStatus.DISABLED, model.flowApprovals()); + Assertions.assertEquals(FlowType.UNKNOWN, model.flowTypesAvailable().get(0)); + Assertions.assertEquals(EnablementStatus.ENABLED, model.messagingFlowTypeSchemaValidation()); + Assertions.assertEquals(DataClassType.FILES, model.flowProfileDataClassesAvailable().get(0)); + Assertions.assertEquals(FlowBillingTier.BLOB_TRANSPORT, model.messagingFlowsPricingOptions().get(0)); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfileInnerTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfileInnerTests.java new file mode 100644 index 0000000000000..abee84d21b7b9 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfileInnerTests.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.fluent.models.FlowProfileInner; +import com.azure.resourcemanager.datatransfer.models.AntivirusRuleset; +import com.azure.resourcemanager.datatransfer.models.AntivirusSolutions; +import com.azure.resourcemanager.datatransfer.models.ArchiveRuleset; +import com.azure.resourcemanager.datatransfer.models.Casing; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.DataSizeRuleset; +import com.azure.resourcemanager.datatransfer.models.FilterType; +import com.azure.resourcemanager.datatransfer.models.FlowProfileProperties; +import com.azure.resourcemanager.datatransfer.models.FlowProfileRulesets; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.MatchType; +import com.azure.resourcemanager.datatransfer.models.MimeFilterRuleset; +import com.azure.resourcemanager.datatransfer.models.MimeTypeFilter; +import com.azure.resourcemanager.datatransfer.models.TextMatchingRuleset; +import com.azure.resourcemanager.datatransfer.models.TextMatchingRulesetDeny; +import com.azure.resourcemanager.datatransfer.models.UserAssignedIdentity; +import com.azure.resourcemanager.datatransfer.models.XmlFilterRuleset; +import com.azure.resourcemanager.datatransfer.models.XmlReferenceType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class FlowProfileInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FlowProfileInner model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Accepted\",\"flowProfileId\":\"pzvgnwzsymglzufc\",\"replicationScenario\":\"Stream\",\"status\":\"Obsolete\",\"description\":\"ohdbihanufh\",\"rulesets\":{\"antivirus\":{\"avSolutions\":[\"Defender\"]},\"archives\":{\"minimumSizeForExpansion\":4240171364940315752,\"maximumExpansionSizeLimit\":6176938431331227811,\"maximumDepthLimit\":6767202022599244968,\"maximumCompressionRatioLimit\":53.154276291671984},\"dataSize\":{\"maximum\":1515673069471944511,\"minimum\":2075889314875474362},\"mimeFilters\":{\"type\":\"Deny\",\"filters\":[{\"media\":\"x\",\"extensions\":[\"vyq\",\"iwbybrkxvdumjg\",\"tfwvukxgaudc\",\"snhsjcnyejhkryh\"]}]},\"xmlFilters\":{\"defaultNamespace\":\"pczwlo\",\"reference\":\"Inline\",\"schema\":\"mkkvnip\"},\"textMatching\":{\"deny\":[{\"text\":\"jnchgej\",\"matchType\":\"Complete\",\"caseSensitivity\":\"Sensitive\"}]}}},\"identity\":{\"principalId\":\"ailzydehojwyahu\",\"tenantId\":\"npmqnjaqwixjspro\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"cmdv\":{\"principalId\":\"tegjvwmf\",\"clientId\":\"t\"},\"lwejdpv\":{\"principalId\":\"hulsuuvmkjozkrwf\",\"clientId\":\"iodjp\"},\"bcryffdfd\":{\"principalId\":\"yoqpsoaccta\",\"clientId\":\"kljla\"}}},\"location\":\"ygexpaojakhmsb\",\"tags\":{\"olthqtrgqjbp\":\"crzevdphlx\",\"jrwzox\":\"zfsinzgvf\"},\"id\":\"j\",\"name\":\"felluwfzitonpe\",\"type\":\"fpjkjlxofp\"}") + .toObject(FlowProfileInner.class); + Assertions.assertEquals("ygexpaojakhmsb", model.location()); + Assertions.assertEquals("crzevdphlx", model.tags().get("olthqtrgqjbp")); + Assertions.assertEquals(DataClassType.STREAM, model.properties().replicationScenario()); + Assertions.assertEquals(FlowProfileStatus.OBSOLETE, model.properties().status()); + Assertions.assertEquals("ohdbihanufh", model.properties().description()); + Assertions.assertEquals(AntivirusSolutions.DEFENDER, + model.properties().rulesets().antivirus().avSolutions().get(0)); + Assertions.assertEquals(4240171364940315752L, + model.properties().rulesets().archives().minimumSizeForExpansion()); + Assertions.assertEquals(6176938431331227811L, + model.properties().rulesets().archives().maximumExpansionSizeLimit()); + Assertions.assertEquals(6767202022599244968L, model.properties().rulesets().archives().maximumDepthLimit()); + Assertions.assertEquals(53.154276291671984D, + model.properties().rulesets().archives().maximumCompressionRatioLimit()); + Assertions.assertEquals(1515673069471944511L, model.properties().rulesets().dataSize().maximum()); + Assertions.assertEquals(2075889314875474362L, model.properties().rulesets().dataSize().minimum()); + Assertions.assertEquals(FilterType.DENY, model.properties().rulesets().mimeFilters().type()); + Assertions.assertEquals("x", model.properties().rulesets().mimeFilters().filters().get(0).media()); + Assertions.assertEquals("vyq", + model.properties().rulesets().mimeFilters().filters().get(0).extensions().get(0)); + Assertions.assertEquals("pczwlo", model.properties().rulesets().xmlFilters().defaultNamespace()); + Assertions.assertEquals(XmlReferenceType.INLINE, model.properties().rulesets().xmlFilters().reference()); + Assertions.assertEquals("mkkvnip", model.properties().rulesets().xmlFilters().schema()); + Assertions.assertEquals("jnchgej", model.properties().rulesets().textMatching().deny().get(0).text()); + Assertions.assertEquals(MatchType.COMPLETE, + model.properties().rulesets().textMatching().deny().get(0).matchType()); + Assertions.assertEquals(Casing.SENSITIVE, + model.properties().rulesets().textMatching().deny().get(0).caseSensitivity()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FlowProfileInner model = new FlowProfileInner().withLocation("ygexpaojakhmsb") + .withTags(mapOf("olthqtrgqjbp", "crzevdphlx", "jrwzox", "zfsinzgvf")) + .withProperties(new FlowProfileProperties().withReplicationScenario(DataClassType.STREAM) + .withStatus(FlowProfileStatus.OBSOLETE) + .withDescription("ohdbihanufh") + .withRulesets(new FlowProfileRulesets() + .withAntivirus(new AntivirusRuleset().withAvSolutions(Arrays.asList(AntivirusSolutions.DEFENDER))) + .withArchives(new ArchiveRuleset().withMinimumSizeForExpansion(4240171364940315752L) + .withMaximumExpansionSizeLimit(6176938431331227811L) + .withMaximumDepthLimit(6767202022599244968L) + .withMaximumCompressionRatioLimit(53.154276291671984D)) + .withDataSize( + new DataSizeRuleset().withMaximum(1515673069471944511L).withMinimum(2075889314875474362L)) + .withMimeFilters(new MimeFilterRuleset().withType(FilterType.DENY) + .withFilters(Arrays.asList(new MimeTypeFilter().withMedia("x") + .withExtensions( + Arrays.asList("vyq", "iwbybrkxvdumjg", "tfwvukxgaudc", "snhsjcnyejhkryh"))))) + .withXmlFilters(new XmlFilterRuleset().withDefaultNamespace("pczwlo") + .withReference(XmlReferenceType.INLINE) + .withSchema("mkkvnip")) + .withTextMatching(new TextMatchingRuleset() + .withDeny(Arrays.asList(new TextMatchingRulesetDeny().withText("jnchgej") + .withMatchType(MatchType.COMPLETE) + .withCaseSensitivity(Casing.SENSITIVE)))))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("cmdv", new UserAssignedIdentity(), "lwejdpv", + new UserAssignedIdentity(), "bcryffdfd", new UserAssignedIdentity()))); + model = BinaryData.fromObject(model).toObject(FlowProfileInner.class); + Assertions.assertEquals("ygexpaojakhmsb", model.location()); + Assertions.assertEquals("crzevdphlx", model.tags().get("olthqtrgqjbp")); + Assertions.assertEquals(DataClassType.STREAM, model.properties().replicationScenario()); + Assertions.assertEquals(FlowProfileStatus.OBSOLETE, model.properties().status()); + Assertions.assertEquals("ohdbihanufh", model.properties().description()); + Assertions.assertEquals(AntivirusSolutions.DEFENDER, + model.properties().rulesets().antivirus().avSolutions().get(0)); + Assertions.assertEquals(4240171364940315752L, + model.properties().rulesets().archives().minimumSizeForExpansion()); + Assertions.assertEquals(6176938431331227811L, + model.properties().rulesets().archives().maximumExpansionSizeLimit()); + Assertions.assertEquals(6767202022599244968L, model.properties().rulesets().archives().maximumDepthLimit()); + Assertions.assertEquals(53.154276291671984D, + model.properties().rulesets().archives().maximumCompressionRatioLimit()); + Assertions.assertEquals(1515673069471944511L, model.properties().rulesets().dataSize().maximum()); + Assertions.assertEquals(2075889314875474362L, model.properties().rulesets().dataSize().minimum()); + Assertions.assertEquals(FilterType.DENY, model.properties().rulesets().mimeFilters().type()); + Assertions.assertEquals("x", model.properties().rulesets().mimeFilters().filters().get(0).media()); + Assertions.assertEquals("vyq", + model.properties().rulesets().mimeFilters().filters().get(0).extensions().get(0)); + Assertions.assertEquals("pczwlo", model.properties().rulesets().xmlFilters().defaultNamespace()); + Assertions.assertEquals(XmlReferenceType.INLINE, model.properties().rulesets().xmlFilters().reference()); + Assertions.assertEquals("mkkvnip", model.properties().rulesets().xmlFilters().schema()); + Assertions.assertEquals("jnchgej", model.properties().rulesets().textMatching().deny().get(0).text()); + Assertions.assertEquals(MatchType.COMPLETE, + model.properties().rulesets().textMatching().deny().get(0).matchType()); + Assertions.assertEquals(Casing.SENSITIVE, + model.properties().rulesets().textMatching().deny().get(0).caseSensitivity()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfileListResultTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfileListResultTests.java new file mode 100644 index 0000000000000..95e17edbd8a0e --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfileListResultTests.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.implementation.models.FlowProfileListResult; +import com.azure.resourcemanager.datatransfer.models.AntivirusSolutions; +import com.azure.resourcemanager.datatransfer.models.Casing; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.FilterType; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.MatchType; +import com.azure.resourcemanager.datatransfer.models.XmlReferenceType; +import org.junit.jupiter.api.Assertions; + +public final class FlowProfileListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FlowProfileListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"flowProfileId\":\"abhjybi\",\"replicationScenario\":\"Messaging\",\"status\":\"Obsolete\",\"description\":\"oqfbowskanyk\",\"rulesets\":{\"antivirus\":{\"avSolutions\":[\"ClamAv\"]},\"archives\":{\"minimumSizeForExpansion\":379150127140719568,\"maximumExpansionSizeLimit\":5706010684839887033,\"maximumDepthLimit\":5201815773094628590,\"maximumCompressionRatioLimit\":24.300202353170587},\"dataSize\":{\"maximum\":81927079143380080,\"minimum\":2317235269329659686},\"mimeFilters\":{\"type\":\"Deny\",\"filters\":[{},{},{},{}]},\"xmlFilters\":{\"defaultNamespace\":\"pec\",\"reference\":\"Inline\",\"schema\":\"coofsxlzev\"},\"textMatching\":{\"deny\":[{\"text\":\"jqabcypmivkwlzuv\",\"matchType\":\"Partial\",\"caseSensitivity\":\"Insensitive\"},{\"text\":\"wnfnbacf\",\"matchType\":\"Complete\",\"caseSensitivity\":\"Sensitive\"},{\"text\":\"l\",\"matchType\":\"Complete\",\"caseSensitivity\":\"Insensitive\"},{\"text\":\"etqgtzxdpnq\",\"matchType\":\"Partial\",\"caseSensitivity\":\"Sensitive\"}]}}},\"identity\":{\"principalId\":\"rjfeallnwsubisnj\",\"tenantId\":\"pmng\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"ase\":{\"principalId\":\"aqw\",\"clientId\":\"chcbonqvpkvlrxnj\"}}},\"location\":\"heoflokeyyienjbd\",\"tags\":{\"asxazjpqyegualhb\":\"grhpdjpju\",\"wdslfhotwmcy\":\"xhejjzzvdud\",\"cftadeh\":\"pwlbjnpg\",\"dejbavo\":\"nltyfsoppusuesnz\"},\"id\":\"xzdmohctb\",\"name\":\"vudwx\",\"type\":\"ndnvo\"},{\"properties\":{\"provisioningState\":\"Accepted\",\"flowProfileId\":\"ugw\",\"replicationScenario\":\"API\",\"status\":\"Obsolete\",\"description\":\"glhslazj\",\"rulesets\":{\"antivirus\":{\"avSolutions\":[\"ClamAv\",\"Defender\"]},\"archives\":{\"minimumSizeForExpansion\":1766958028300154431,\"maximumExpansionSizeLimit\":6331775327606779557,\"maximumDepthLimit\":2668664813201737985,\"maximumCompressionRatioLimit\":8.357618875252227},\"dataSize\":{\"maximum\":7762769610748668832,\"minimum\":7006208031114197055},\"mimeFilters\":{\"type\":\"Allow\",\"filters\":[{},{}]},\"xmlFilters\":{\"defaultNamespace\":\"bcibvyvdcsitynn\",\"reference\":\"Inline\",\"schema\":\"ectehf\"},\"textMatching\":{\"deny\":[{\"text\":\"jeyp\",\"matchType\":\"Partial\",\"caseSensitivity\":\"Sensitive\"}]}}},\"identity\":{\"principalId\":\"kgqhcjrefovg\",\"tenantId\":\"qsl\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"ajvnysounqe\":{\"principalId\":\"yqjpkcatt\",\"clientId\":\"gjcrcczsqpjhvm\"},\"u\":{\"principalId\":\"noae\",\"clientId\":\"fhyhltrpmopjmcma\"},\"uaxbezyiuokkt\":{\"principalId\":\"thfuiuaodsfcpkvx\",\"clientId\":\"puozmyzydag\"},\"ksymd\":{\"principalId\":\"rdxwzywqsm\",\"clientId\":\"ureximoryocfs\"}}},\"location\":\"stkiiuxhqyud\",\"tags\":{\"b\":\"rq\",\"fqrvkdvjsllrmvvd\":\"oczvy\",\"zwtruwiqzbqjvsov\":\"watkpnpulexxb\",\"hzdobpxjmflbvvnc\":\"yokacspkw\"},\"id\":\"rkcciwwzjuqk\",\"name\":\"rsa\",\"type\":\"iwkuofos\"}],\"nextLink\":\"hsauuimjmvxied\"}") + .toObject(FlowProfileListResult.class); + Assertions.assertEquals("heoflokeyyienjbd", model.value().get(0).location()); + Assertions.assertEquals("grhpdjpju", model.value().get(0).tags().get("asxazjpqyegualhb")); + Assertions.assertEquals(DataClassType.MESSAGING, model.value().get(0).properties().replicationScenario()); + Assertions.assertEquals(FlowProfileStatus.OBSOLETE, model.value().get(0).properties().status()); + Assertions.assertEquals("oqfbowskanyk", model.value().get(0).properties().description()); + Assertions.assertEquals(AntivirusSolutions.CLAM_AV, + model.value().get(0).properties().rulesets().antivirus().avSolutions().get(0)); + Assertions.assertEquals(379150127140719568L, + model.value().get(0).properties().rulesets().archives().minimumSizeForExpansion()); + Assertions.assertEquals(5706010684839887033L, + model.value().get(0).properties().rulesets().archives().maximumExpansionSizeLimit()); + Assertions.assertEquals(5201815773094628590L, + model.value().get(0).properties().rulesets().archives().maximumDepthLimit()); + Assertions.assertEquals(24.300202353170587D, + model.value().get(0).properties().rulesets().archives().maximumCompressionRatioLimit()); + Assertions.assertEquals(81927079143380080L, model.value().get(0).properties().rulesets().dataSize().maximum()); + Assertions.assertEquals(2317235269329659686L, + model.value().get(0).properties().rulesets().dataSize().minimum()); + Assertions.assertEquals(FilterType.DENY, model.value().get(0).properties().rulesets().mimeFilters().type()); + Assertions.assertEquals("pec", model.value().get(0).properties().rulesets().xmlFilters().defaultNamespace()); + Assertions.assertEquals(XmlReferenceType.INLINE, + model.value().get(0).properties().rulesets().xmlFilters().reference()); + Assertions.assertEquals("coofsxlzev", model.value().get(0).properties().rulesets().xmlFilters().schema()); + Assertions.assertEquals("jqabcypmivkwlzuv", + model.value().get(0).properties().rulesets().textMatching().deny().get(0).text()); + Assertions.assertEquals(MatchType.PARTIAL, + model.value().get(0).properties().rulesets().textMatching().deny().get(0).matchType()); + Assertions.assertEquals(Casing.INSENSITIVE, + model.value().get(0).properties().rulesets().textMatching().deny().get(0).caseSensitivity()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); + Assertions.assertEquals("hsauuimjmvxied", model.nextLink()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfileMetadataTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfileMetadataTests.java new file mode 100644 index 0000000000000..0aaa0f77adde6 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfileMetadataTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.FlowProfileMetadata; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import org.junit.jupiter.api.Assertions; + +public final class FlowProfileMetadataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FlowProfileMetadata model = BinaryData.fromString( + "{\"pipeline\":\"ivfxzsjabibsyst\",\"name\":\"wfsdjpvkvpbj\",\"replicationScenario\":\"API\",\"flowProfileId\":\"kzbzkdvncjabudu\",\"status\":\"Obsolete\",\"description\":\"kakmokzh\"}") + .toObject(FlowProfileMetadata.class); + Assertions.assertEquals("ivfxzsjabibsyst", model.pipeline()); + Assertions.assertEquals("wfsdjpvkvpbj", model.name()); + Assertions.assertEquals(DataClassType.API, model.replicationScenario()); + Assertions.assertEquals("kzbzkdvncjabudu", model.flowProfileId()); + Assertions.assertEquals(FlowProfileStatus.OBSOLETE, model.status()); + Assertions.assertEquals("kakmokzh", model.description()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FlowProfileMetadata model = new FlowProfileMetadata().withPipeline("ivfxzsjabibsyst") + .withName("wfsdjpvkvpbj") + .withReplicationScenario(DataClassType.API) + .withFlowProfileId("kzbzkdvncjabudu") + .withStatus(FlowProfileStatus.OBSOLETE) + .withDescription("kakmokzh"); + model = BinaryData.fromObject(model).toObject(FlowProfileMetadata.class); + Assertions.assertEquals("ivfxzsjabibsyst", model.pipeline()); + Assertions.assertEquals("wfsdjpvkvpbj", model.name()); + Assertions.assertEquals(DataClassType.API, model.replicationScenario()); + Assertions.assertEquals("kzbzkdvncjabudu", model.flowProfileId()); + Assertions.assertEquals(FlowProfileStatus.OBSOLETE, model.status()); + Assertions.assertEquals("kakmokzh", model.description()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilePatchPropertiesTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilePatchPropertiesTests.java new file mode 100644 index 0000000000000..766615ad617cb --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilePatchPropertiesTests.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.AntivirusRuleset; +import com.azure.resourcemanager.datatransfer.models.AntivirusSolutions; +import com.azure.resourcemanager.datatransfer.models.ArchiveRuleset; +import com.azure.resourcemanager.datatransfer.models.Casing; +import com.azure.resourcemanager.datatransfer.models.DataSizeRuleset; +import com.azure.resourcemanager.datatransfer.models.FilterType; +import com.azure.resourcemanager.datatransfer.models.FlowProfilePatchProperties; +import com.azure.resourcemanager.datatransfer.models.FlowProfileRulesets; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.MatchType; +import com.azure.resourcemanager.datatransfer.models.MimeFilterRuleset; +import com.azure.resourcemanager.datatransfer.models.MimeTypeFilter; +import com.azure.resourcemanager.datatransfer.models.TextMatchingRuleset; +import com.azure.resourcemanager.datatransfer.models.TextMatchingRulesetDeny; +import com.azure.resourcemanager.datatransfer.models.XmlFilterRuleset; +import com.azure.resourcemanager.datatransfer.models.XmlReferenceType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class FlowProfilePatchPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FlowProfilePatchProperties model = BinaryData.fromString( + "{\"provisioningState\":\"Succeeded\",\"description\":\"oqvuhr\",\"rulesets\":{\"antivirus\":{\"avSolutions\":[\"Defender\",\"Defender\",\"ClamAv\",\"Defender\"]},\"archives\":{\"minimumSizeForExpansion\":2842723799650662842,\"maximumExpansionSizeLimit\":1888294014236368551,\"maximumDepthLimit\":7095411752725955469,\"maximumCompressionRatioLimit\":90.1694494700696},\"dataSize\":{\"maximum\":3332363742022999160,\"minimum\":7242144596366132757},\"mimeFilters\":{\"type\":\"Allow\",\"filters\":[{\"media\":\"xuigdtopbobj\",\"extensions\":[\"m\"]}]},\"xmlFilters\":{\"defaultNamespace\":\"a\",\"reference\":\"Inline\",\"schema\":\"rzayv\"},\"textMatching\":{\"deny\":[{\"text\":\"vdfgiotk\",\"matchType\":\"Complete\",\"caseSensitivity\":\"Insensitive\"},{\"text\":\"tqxln\",\"matchType\":\"Complete\",\"caseSensitivity\":\"Sensitive\"},{\"text\":\"efgugnxk\",\"matchType\":\"Complete\",\"caseSensitivity\":\"Insensitive\"},{\"text\":\"qmi\",\"matchType\":\"Partial\",\"caseSensitivity\":\"Insensitive\"}]}},\"status\":\"Obsolete\"}") + .toObject(FlowProfilePatchProperties.class); + Assertions.assertEquals("oqvuhr", model.description()); + Assertions.assertEquals(AntivirusSolutions.DEFENDER, model.rulesets().antivirus().avSolutions().get(0)); + Assertions.assertEquals(2842723799650662842L, model.rulesets().archives().minimumSizeForExpansion()); + Assertions.assertEquals(1888294014236368551L, model.rulesets().archives().maximumExpansionSizeLimit()); + Assertions.assertEquals(7095411752725955469L, model.rulesets().archives().maximumDepthLimit()); + Assertions.assertEquals(90.1694494700696D, model.rulesets().archives().maximumCompressionRatioLimit()); + Assertions.assertEquals(3332363742022999160L, model.rulesets().dataSize().maximum()); + Assertions.assertEquals(7242144596366132757L, model.rulesets().dataSize().minimum()); + Assertions.assertEquals(FilterType.ALLOW, model.rulesets().mimeFilters().type()); + Assertions.assertEquals("xuigdtopbobj", model.rulesets().mimeFilters().filters().get(0).media()); + Assertions.assertEquals("m", model.rulesets().mimeFilters().filters().get(0).extensions().get(0)); + Assertions.assertEquals("a", model.rulesets().xmlFilters().defaultNamespace()); + Assertions.assertEquals(XmlReferenceType.INLINE, model.rulesets().xmlFilters().reference()); + Assertions.assertEquals("rzayv", model.rulesets().xmlFilters().schema()); + Assertions.assertEquals("vdfgiotk", model.rulesets().textMatching().deny().get(0).text()); + Assertions.assertEquals(MatchType.COMPLETE, model.rulesets().textMatching().deny().get(0).matchType()); + Assertions.assertEquals(Casing.INSENSITIVE, model.rulesets().textMatching().deny().get(0).caseSensitivity()); + Assertions.assertEquals(FlowProfileStatus.OBSOLETE, model.status()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FlowProfilePatchProperties model = new FlowProfilePatchProperties().withDescription("oqvuhr") + .withRulesets(new FlowProfileRulesets() + .withAntivirus(new AntivirusRuleset().withAvSolutions(Arrays.asList(AntivirusSolutions.DEFENDER, + AntivirusSolutions.DEFENDER, AntivirusSolutions.CLAM_AV, AntivirusSolutions.DEFENDER))) + .withArchives(new ArchiveRuleset().withMinimumSizeForExpansion(2842723799650662842L) + .withMaximumExpansionSizeLimit(1888294014236368551L) + .withMaximumDepthLimit(7095411752725955469L) + .withMaximumCompressionRatioLimit(90.1694494700696D)) + .withDataSize(new DataSizeRuleset().withMaximum(3332363742022999160L).withMinimum(7242144596366132757L)) + .withMimeFilters(new MimeFilterRuleset().withType(FilterType.ALLOW) + .withFilters(Arrays + .asList(new MimeTypeFilter().withMedia("xuigdtopbobj").withExtensions(Arrays.asList("m"))))) + .withXmlFilters(new XmlFilterRuleset().withDefaultNamespace("a") + .withReference(XmlReferenceType.INLINE) + .withSchema("rzayv")) + .withTextMatching(new TextMatchingRuleset().withDeny(Arrays.asList( + new TextMatchingRulesetDeny().withText("vdfgiotk") + .withMatchType(MatchType.COMPLETE) + .withCaseSensitivity(Casing.INSENSITIVE), + new TextMatchingRulesetDeny().withText("tqxln") + .withMatchType(MatchType.COMPLETE) + .withCaseSensitivity(Casing.SENSITIVE), + new TextMatchingRulesetDeny().withText("efgugnxk") + .withMatchType(MatchType.COMPLETE) + .withCaseSensitivity(Casing.INSENSITIVE), + new TextMatchingRulesetDeny().withText("qmi") + .withMatchType(MatchType.PARTIAL) + .withCaseSensitivity(Casing.INSENSITIVE))))) + .withStatus(FlowProfileStatus.OBSOLETE); + model = BinaryData.fromObject(model).toObject(FlowProfilePatchProperties.class); + Assertions.assertEquals("oqvuhr", model.description()); + Assertions.assertEquals(AntivirusSolutions.DEFENDER, model.rulesets().antivirus().avSolutions().get(0)); + Assertions.assertEquals(2842723799650662842L, model.rulesets().archives().minimumSizeForExpansion()); + Assertions.assertEquals(1888294014236368551L, model.rulesets().archives().maximumExpansionSizeLimit()); + Assertions.assertEquals(7095411752725955469L, model.rulesets().archives().maximumDepthLimit()); + Assertions.assertEquals(90.1694494700696D, model.rulesets().archives().maximumCompressionRatioLimit()); + Assertions.assertEquals(3332363742022999160L, model.rulesets().dataSize().maximum()); + Assertions.assertEquals(7242144596366132757L, model.rulesets().dataSize().minimum()); + Assertions.assertEquals(FilterType.ALLOW, model.rulesets().mimeFilters().type()); + Assertions.assertEquals("xuigdtopbobj", model.rulesets().mimeFilters().filters().get(0).media()); + Assertions.assertEquals("m", model.rulesets().mimeFilters().filters().get(0).extensions().get(0)); + Assertions.assertEquals("a", model.rulesets().xmlFilters().defaultNamespace()); + Assertions.assertEquals(XmlReferenceType.INLINE, model.rulesets().xmlFilters().reference()); + Assertions.assertEquals("rzayv", model.rulesets().xmlFilters().schema()); + Assertions.assertEquals("vdfgiotk", model.rulesets().textMatching().deny().get(0).text()); + Assertions.assertEquals(MatchType.COMPLETE, model.rulesets().textMatching().deny().get(0).matchType()); + Assertions.assertEquals(Casing.INSENSITIVE, model.rulesets().textMatching().deny().get(0).caseSensitivity()); + Assertions.assertEquals(FlowProfileStatus.OBSOLETE, model.status()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilePatchTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilePatchTests.java new file mode 100644 index 0000000000000..dc6ae14e4b8ee --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilePatchTests.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.AntivirusRuleset; +import com.azure.resourcemanager.datatransfer.models.AntivirusSolutions; +import com.azure.resourcemanager.datatransfer.models.ArchiveRuleset; +import com.azure.resourcemanager.datatransfer.models.Casing; +import com.azure.resourcemanager.datatransfer.models.DataSizeRuleset; +import com.azure.resourcemanager.datatransfer.models.FilterType; +import com.azure.resourcemanager.datatransfer.models.FlowProfilePatch; +import com.azure.resourcemanager.datatransfer.models.FlowProfilePatchProperties; +import com.azure.resourcemanager.datatransfer.models.FlowProfileRulesets; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.MatchType; +import com.azure.resourcemanager.datatransfer.models.MimeFilterRuleset; +import com.azure.resourcemanager.datatransfer.models.MimeTypeFilter; +import com.azure.resourcemanager.datatransfer.models.TextMatchingRuleset; +import com.azure.resourcemanager.datatransfer.models.TextMatchingRulesetDeny; +import com.azure.resourcemanager.datatransfer.models.UserAssignedIdentity; +import com.azure.resourcemanager.datatransfer.models.XmlFilterRuleset; +import com.azure.resourcemanager.datatransfer.models.XmlReferenceType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class FlowProfilePatchTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FlowProfilePatch model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Failed\",\"description\":\"pteehzzv\",\"rulesets\":{\"antivirus\":{\"avSolutions\":[\"Defender\"]},\"archives\":{\"minimumSizeForExpansion\":8536075675262416756,\"maximumExpansionSizeLimit\":6094363401804117367,\"maximumDepthLimit\":2981381234458568547,\"maximumCompressionRatioLimit\":96.52387629031274},\"dataSize\":{\"maximum\":1443546994803200949,\"minimum\":3837104884781014103},\"mimeFilters\":{\"type\":\"Allow\",\"filters\":[{\"media\":\"jtckwhdso\",\"extensions\":[\"yip\"]},{\"media\":\"sqwpgrjb\",\"extensions\":[\"rcjxvsnbyxqabn\",\"ocpcy\",\"hurzafblj\"]}]},\"xmlFilters\":{\"defaultNamespace\":\"btoqcjmkljavbqid\",\"reference\":\"Inline\",\"schema\":\"zyulp\"},\"textMatching\":{\"deny\":[{\"text\":\"krlkhbzhfepg\",\"matchType\":\"Complete\",\"caseSensitivity\":\"Insensitive\"},{\"text\":\"e\",\"matchType\":\"Partial\",\"caseSensitivity\":\"Insensitive\"},{\"text\":\"ocxscpaierhhbcs\",\"matchType\":\"Partial\",\"caseSensitivity\":\"Sensitive\"},{\"text\":\"mmajtjaodx\",\"matchType\":\"Complete\",\"caseSensitivity\":\"Insensitive\"}]}},\"status\":\"Obsolete\"},\"identity\":{\"principalId\":\"qp\",\"tenantId\":\"kajionpim\",\"type\":\"None\",\"userAssignedIdentities\":{\"djwzrlov\":{\"principalId\":\"xgcp\",\"clientId\":\"gmaajrm\"},\"ukdkexxppofmxa\":{\"principalId\":\"lwhijcoejctbzaq\",\"clientId\":\"sycbkbfk\"}}},\"tags\":{\"toc\":\"jpgd\",\"hvpmoue\":\"j\",\"xibqeojnx\":\"hd\",\"dntwndeicbtw\":\"bzv\"}}") + .toObject(FlowProfilePatch.class); + Assertions.assertEquals("pteehzzv", model.properties().description()); + Assertions.assertEquals(AntivirusSolutions.DEFENDER, + model.properties().rulesets().antivirus().avSolutions().get(0)); + Assertions.assertEquals(8536075675262416756L, + model.properties().rulesets().archives().minimumSizeForExpansion()); + Assertions.assertEquals(6094363401804117367L, + model.properties().rulesets().archives().maximumExpansionSizeLimit()); + Assertions.assertEquals(2981381234458568547L, model.properties().rulesets().archives().maximumDepthLimit()); + Assertions.assertEquals(96.52387629031274D, + model.properties().rulesets().archives().maximumCompressionRatioLimit()); + Assertions.assertEquals(1443546994803200949L, model.properties().rulesets().dataSize().maximum()); + Assertions.assertEquals(3837104884781014103L, model.properties().rulesets().dataSize().minimum()); + Assertions.assertEquals(FilterType.ALLOW, model.properties().rulesets().mimeFilters().type()); + Assertions.assertEquals("jtckwhdso", model.properties().rulesets().mimeFilters().filters().get(0).media()); + Assertions.assertEquals("yip", + model.properties().rulesets().mimeFilters().filters().get(0).extensions().get(0)); + Assertions.assertEquals("btoqcjmkljavbqid", model.properties().rulesets().xmlFilters().defaultNamespace()); + Assertions.assertEquals(XmlReferenceType.INLINE, model.properties().rulesets().xmlFilters().reference()); + Assertions.assertEquals("zyulp", model.properties().rulesets().xmlFilters().schema()); + Assertions.assertEquals("krlkhbzhfepg", model.properties().rulesets().textMatching().deny().get(0).text()); + Assertions.assertEquals(MatchType.COMPLETE, + model.properties().rulesets().textMatching().deny().get(0).matchType()); + Assertions.assertEquals(Casing.INSENSITIVE, + model.properties().rulesets().textMatching().deny().get(0).caseSensitivity()); + Assertions.assertEquals(FlowProfileStatus.OBSOLETE, model.properties().status()); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); + Assertions.assertEquals("jpgd", model.tags().get("toc")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FlowProfilePatch model = new FlowProfilePatch() + .withProperties(new FlowProfilePatchProperties().withDescription("pteehzzv") + .withRulesets(new FlowProfileRulesets() + .withAntivirus(new AntivirusRuleset().withAvSolutions(Arrays.asList(AntivirusSolutions.DEFENDER))) + .withArchives(new ArchiveRuleset().withMinimumSizeForExpansion(8536075675262416756L) + .withMaximumExpansionSizeLimit(6094363401804117367L) + .withMaximumDepthLimit(2981381234458568547L) + .withMaximumCompressionRatioLimit(96.52387629031274D)) + .withDataSize( + new DataSizeRuleset().withMaximum(1443546994803200949L).withMinimum(3837104884781014103L)) + .withMimeFilters(new MimeFilterRuleset().withType(FilterType.ALLOW) + .withFilters(Arrays.asList( + new MimeTypeFilter().withMedia("jtckwhdso").withExtensions(Arrays.asList("yip")), + new MimeTypeFilter().withMedia("sqwpgrjb") + .withExtensions(Arrays.asList("rcjxvsnbyxqabn", "ocpcy", "hurzafblj"))))) + .withXmlFilters(new XmlFilterRuleset().withDefaultNamespace("btoqcjmkljavbqid") + .withReference(XmlReferenceType.INLINE) + .withSchema("zyulp")) + .withTextMatching(new TextMatchingRuleset().withDeny(Arrays.asList( + new TextMatchingRulesetDeny().withText("krlkhbzhfepg") + .withMatchType(MatchType.COMPLETE) + .withCaseSensitivity(Casing.INSENSITIVE), + new TextMatchingRulesetDeny().withText("e") + .withMatchType(MatchType.PARTIAL) + .withCaseSensitivity(Casing.INSENSITIVE), + new TextMatchingRulesetDeny().withText("ocxscpaierhhbcs") + .withMatchType(MatchType.PARTIAL) + .withCaseSensitivity(Casing.SENSITIVE), + new TextMatchingRulesetDeny().withText("mmajtjaodx") + .withMatchType(MatchType.COMPLETE) + .withCaseSensitivity(Casing.INSENSITIVE))))) + .withStatus(FlowProfileStatus.OBSOLETE)) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities( + mapOf("djwzrlov", new UserAssignedIdentity(), "ukdkexxppofmxa", new UserAssignedIdentity()))) + .withTags(mapOf("toc", "jpgd", "hvpmoue", "j", "xibqeojnx", "hd", "dntwndeicbtw", "bzv")); + model = BinaryData.fromObject(model).toObject(FlowProfilePatch.class); + Assertions.assertEquals("pteehzzv", model.properties().description()); + Assertions.assertEquals(AntivirusSolutions.DEFENDER, + model.properties().rulesets().antivirus().avSolutions().get(0)); + Assertions.assertEquals(8536075675262416756L, + model.properties().rulesets().archives().minimumSizeForExpansion()); + Assertions.assertEquals(6094363401804117367L, + model.properties().rulesets().archives().maximumExpansionSizeLimit()); + Assertions.assertEquals(2981381234458568547L, model.properties().rulesets().archives().maximumDepthLimit()); + Assertions.assertEquals(96.52387629031274D, + model.properties().rulesets().archives().maximumCompressionRatioLimit()); + Assertions.assertEquals(1443546994803200949L, model.properties().rulesets().dataSize().maximum()); + Assertions.assertEquals(3837104884781014103L, model.properties().rulesets().dataSize().minimum()); + Assertions.assertEquals(FilterType.ALLOW, model.properties().rulesets().mimeFilters().type()); + Assertions.assertEquals("jtckwhdso", model.properties().rulesets().mimeFilters().filters().get(0).media()); + Assertions.assertEquals("yip", + model.properties().rulesets().mimeFilters().filters().get(0).extensions().get(0)); + Assertions.assertEquals("btoqcjmkljavbqid", model.properties().rulesets().xmlFilters().defaultNamespace()); + Assertions.assertEquals(XmlReferenceType.INLINE, model.properties().rulesets().xmlFilters().reference()); + Assertions.assertEquals("zyulp", model.properties().rulesets().xmlFilters().schema()); + Assertions.assertEquals("krlkhbzhfepg", model.properties().rulesets().textMatching().deny().get(0).text()); + Assertions.assertEquals(MatchType.COMPLETE, + model.properties().rulesets().textMatching().deny().get(0).matchType()); + Assertions.assertEquals(Casing.INSENSITIVE, + model.properties().rulesets().textMatching().deny().get(0).caseSensitivity()); + Assertions.assertEquals(FlowProfileStatus.OBSOLETE, model.properties().status()); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); + Assertions.assertEquals("jpgd", model.tags().get("toc")); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilePropertiesTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilePropertiesTests.java new file mode 100644 index 0000000000000..73dbdc6f8a5cd --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilePropertiesTests.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.AntivirusRuleset; +import com.azure.resourcemanager.datatransfer.models.AntivirusSolutions; +import com.azure.resourcemanager.datatransfer.models.ArchiveRuleset; +import com.azure.resourcemanager.datatransfer.models.Casing; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.DataSizeRuleset; +import com.azure.resourcemanager.datatransfer.models.FilterType; +import com.azure.resourcemanager.datatransfer.models.FlowProfileProperties; +import com.azure.resourcemanager.datatransfer.models.FlowProfileRulesets; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.MatchType; +import com.azure.resourcemanager.datatransfer.models.MimeFilterRuleset; +import com.azure.resourcemanager.datatransfer.models.MimeTypeFilter; +import com.azure.resourcemanager.datatransfer.models.TextMatchingRuleset; +import com.azure.resourcemanager.datatransfer.models.TextMatchingRulesetDeny; +import com.azure.resourcemanager.datatransfer.models.XmlFilterRuleset; +import com.azure.resourcemanager.datatransfer.models.XmlReferenceType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class FlowProfilePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FlowProfileProperties model = BinaryData.fromString( + "{\"provisioningState\":\"Succeeded\",\"flowProfileId\":\"fxxypininmayhuy\",\"replicationScenario\":\"API\",\"status\":\"Enabled\",\"description\":\"podepoo\",\"rulesets\":{\"antivirus\":{\"avSolutions\":[\"ClamAv\",\"Defender\"]},\"archives\":{\"minimumSizeForExpansion\":7179578326508672133,\"maximumExpansionSizeLimit\":4872001665156210547,\"maximumDepthLimit\":7650711998155459286,\"maximumCompressionRatioLimit\":54.27655195831088},\"dataSize\":{\"maximum\":7039315678722023239,\"minimum\":7956589332292140825},\"mimeFilters\":{\"type\":\"Allow\",\"filters\":[{\"media\":\"qi\",\"extensions\":[\"un\",\"bwjzr\",\"fygxgispemvtzfk\"]},{\"media\":\"ubljofxqe\",\"extensions\":[\"aeqjhqjbasvms\"]},{\"media\":\"qulngsntnbybkzgc\",\"extensions\":[\"clxxwrljdo\",\"skcqvkocrcjd\"]}]},\"xmlFilters\":{\"defaultNamespace\":\"nh\",\"reference\":\"Inline\",\"schema\":\"biksq\"},\"textMatching\":{\"deny\":[{\"text\":\"sainqpjwnzl\",\"matchType\":\"Partial\",\"caseSensitivity\":\"Insensitive\"},{\"text\":\"mppeebvmgxs\",\"matchType\":\"Partial\",\"caseSensitivity\":\"Sensitive\"},{\"text\":\"yqduujit\",\"matchType\":\"Complete\",\"caseSensitivity\":\"Insensitive\"},{\"text\":\"zdzevndh\",\"matchType\":\"Complete\",\"caseSensitivity\":\"Sensitive\"}]}}}") + .toObject(FlowProfileProperties.class); + Assertions.assertEquals(DataClassType.API, model.replicationScenario()); + Assertions.assertEquals(FlowProfileStatus.ENABLED, model.status()); + Assertions.assertEquals("podepoo", model.description()); + Assertions.assertEquals(AntivirusSolutions.CLAM_AV, model.rulesets().antivirus().avSolutions().get(0)); + Assertions.assertEquals(7179578326508672133L, model.rulesets().archives().minimumSizeForExpansion()); + Assertions.assertEquals(4872001665156210547L, model.rulesets().archives().maximumExpansionSizeLimit()); + Assertions.assertEquals(7650711998155459286L, model.rulesets().archives().maximumDepthLimit()); + Assertions.assertEquals(54.27655195831088D, model.rulesets().archives().maximumCompressionRatioLimit()); + Assertions.assertEquals(7039315678722023239L, model.rulesets().dataSize().maximum()); + Assertions.assertEquals(7956589332292140825L, model.rulesets().dataSize().minimum()); + Assertions.assertEquals(FilterType.ALLOW, model.rulesets().mimeFilters().type()); + Assertions.assertEquals("qi", model.rulesets().mimeFilters().filters().get(0).media()); + Assertions.assertEquals("un", model.rulesets().mimeFilters().filters().get(0).extensions().get(0)); + Assertions.assertEquals("nh", model.rulesets().xmlFilters().defaultNamespace()); + Assertions.assertEquals(XmlReferenceType.INLINE, model.rulesets().xmlFilters().reference()); + Assertions.assertEquals("biksq", model.rulesets().xmlFilters().schema()); + Assertions.assertEquals("sainqpjwnzl", model.rulesets().textMatching().deny().get(0).text()); + Assertions.assertEquals(MatchType.PARTIAL, model.rulesets().textMatching().deny().get(0).matchType()); + Assertions.assertEquals(Casing.INSENSITIVE, model.rulesets().textMatching().deny().get(0).caseSensitivity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FlowProfileProperties model = new FlowProfileProperties().withReplicationScenario(DataClassType.API) + .withStatus(FlowProfileStatus.ENABLED) + .withDescription("podepoo") + .withRulesets(new FlowProfileRulesets() + .withAntivirus(new AntivirusRuleset() + .withAvSolutions(Arrays.asList(AntivirusSolutions.CLAM_AV, AntivirusSolutions.DEFENDER))) + .withArchives(new ArchiveRuleset().withMinimumSizeForExpansion(7179578326508672133L) + .withMaximumExpansionSizeLimit(4872001665156210547L) + .withMaximumDepthLimit(7650711998155459286L) + .withMaximumCompressionRatioLimit(54.27655195831088D)) + .withDataSize(new DataSizeRuleset().withMaximum(7039315678722023239L).withMinimum(7956589332292140825L)) + .withMimeFilters(new MimeFilterRuleset().withType(FilterType.ALLOW) + .withFilters(Arrays.asList( + new MimeTypeFilter().withMedia("qi") + .withExtensions(Arrays.asList("un", "bwjzr", "fygxgispemvtzfk")), + new MimeTypeFilter().withMedia("ubljofxqe").withExtensions(Arrays.asList("aeqjhqjbasvms")), + new MimeTypeFilter().withMedia("qulngsntnbybkzgc") + .withExtensions(Arrays.asList("clxxwrljdo", "skcqvkocrcjd"))))) + .withXmlFilters(new XmlFilterRuleset().withDefaultNamespace("nh") + .withReference(XmlReferenceType.INLINE) + .withSchema("biksq")) + .withTextMatching(new TextMatchingRuleset().withDeny(Arrays.asList( + new TextMatchingRulesetDeny().withText("sainqpjwnzl") + .withMatchType(MatchType.PARTIAL) + .withCaseSensitivity(Casing.INSENSITIVE), + new TextMatchingRulesetDeny().withText("mppeebvmgxs") + .withMatchType(MatchType.PARTIAL) + .withCaseSensitivity(Casing.SENSITIVE), + new TextMatchingRulesetDeny().withText("yqduujit") + .withMatchType(MatchType.COMPLETE) + .withCaseSensitivity(Casing.INSENSITIVE), + new TextMatchingRulesetDeny().withText("zdzevndh") + .withMatchType(MatchType.COMPLETE) + .withCaseSensitivity(Casing.SENSITIVE))))); + model = BinaryData.fromObject(model).toObject(FlowProfileProperties.class); + Assertions.assertEquals(DataClassType.API, model.replicationScenario()); + Assertions.assertEquals(FlowProfileStatus.ENABLED, model.status()); + Assertions.assertEquals("podepoo", model.description()); + Assertions.assertEquals(AntivirusSolutions.CLAM_AV, model.rulesets().antivirus().avSolutions().get(0)); + Assertions.assertEquals(7179578326508672133L, model.rulesets().archives().minimumSizeForExpansion()); + Assertions.assertEquals(4872001665156210547L, model.rulesets().archives().maximumExpansionSizeLimit()); + Assertions.assertEquals(7650711998155459286L, model.rulesets().archives().maximumDepthLimit()); + Assertions.assertEquals(54.27655195831088D, model.rulesets().archives().maximumCompressionRatioLimit()); + Assertions.assertEquals(7039315678722023239L, model.rulesets().dataSize().maximum()); + Assertions.assertEquals(7956589332292140825L, model.rulesets().dataSize().minimum()); + Assertions.assertEquals(FilterType.ALLOW, model.rulesets().mimeFilters().type()); + Assertions.assertEquals("qi", model.rulesets().mimeFilters().filters().get(0).media()); + Assertions.assertEquals("un", model.rulesets().mimeFilters().filters().get(0).extensions().get(0)); + Assertions.assertEquals("nh", model.rulesets().xmlFilters().defaultNamespace()); + Assertions.assertEquals(XmlReferenceType.INLINE, model.rulesets().xmlFilters().reference()); + Assertions.assertEquals("biksq", model.rulesets().xmlFilters().schema()); + Assertions.assertEquals("sainqpjwnzl", model.rulesets().textMatching().deny().get(0).text()); + Assertions.assertEquals(MatchType.PARTIAL, model.rulesets().textMatching().deny().get(0).matchType()); + Assertions.assertEquals(Casing.INSENSITIVE, model.rulesets().textMatching().deny().get(0).caseSensitivity()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfileRulesetsTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfileRulesetsTests.java new file mode 100644 index 0000000000000..e02ec75890323 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfileRulesetsTests.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.AntivirusRuleset; +import com.azure.resourcemanager.datatransfer.models.AntivirusSolutions; +import com.azure.resourcemanager.datatransfer.models.ArchiveRuleset; +import com.azure.resourcemanager.datatransfer.models.Casing; +import com.azure.resourcemanager.datatransfer.models.DataSizeRuleset; +import com.azure.resourcemanager.datatransfer.models.FilterType; +import com.azure.resourcemanager.datatransfer.models.FlowProfileRulesets; +import com.azure.resourcemanager.datatransfer.models.MatchType; +import com.azure.resourcemanager.datatransfer.models.MimeFilterRuleset; +import com.azure.resourcemanager.datatransfer.models.MimeTypeFilter; +import com.azure.resourcemanager.datatransfer.models.TextMatchingRuleset; +import com.azure.resourcemanager.datatransfer.models.TextMatchingRulesetDeny; +import com.azure.resourcemanager.datatransfer.models.XmlFilterRuleset; +import com.azure.resourcemanager.datatransfer.models.XmlReferenceType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class FlowProfileRulesetsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FlowProfileRulesets model = BinaryData.fromString( + "{\"antivirus\":{\"avSolutions\":[\"ClamAv\"]},\"archives\":{\"minimumSizeForExpansion\":8041345972245934829,\"maximumExpansionSizeLimit\":1086863474205991756,\"maximumDepthLimit\":5492310413680784267,\"maximumCompressionRatioLimit\":44.56756335924435},\"dataSize\":{\"maximum\":8087000369487039234,\"minimum\":5558562364469410639},\"mimeFilters\":{\"type\":\"Deny\",\"filters\":[{\"media\":\"dhugjzzdatqxhocd\",\"extensions\":[\"blgphuticn\",\"vkaozwyiftyhxhur\",\"k\",\"tyxolniwpwc\"]}]},\"xmlFilters\":{\"defaultNamespace\":\"fkgiawxk\",\"reference\":\"Inline\",\"schema\":\"lwckbasyypnddhs\"},\"textMatching\":{\"deny\":[{\"text\":\"cph\",\"matchType\":\"Partial\",\"caseSensitivity\":\"Insensitive\"},{\"text\":\"ot\",\"matchType\":\"Complete\",\"caseSensitivity\":\"Insensitive\"},{\"text\":\"gou\",\"matchType\":\"Partial\",\"caseSensitivity\":\"Insensitive\"}]}}") + .toObject(FlowProfileRulesets.class); + Assertions.assertEquals(AntivirusSolutions.CLAM_AV, model.antivirus().avSolutions().get(0)); + Assertions.assertEquals(8041345972245934829L, model.archives().minimumSizeForExpansion()); + Assertions.assertEquals(1086863474205991756L, model.archives().maximumExpansionSizeLimit()); + Assertions.assertEquals(5492310413680784267L, model.archives().maximumDepthLimit()); + Assertions.assertEquals(44.56756335924435D, model.archives().maximumCompressionRatioLimit()); + Assertions.assertEquals(8087000369487039234L, model.dataSize().maximum()); + Assertions.assertEquals(5558562364469410639L, model.dataSize().minimum()); + Assertions.assertEquals(FilterType.DENY, model.mimeFilters().type()); + Assertions.assertEquals("dhugjzzdatqxhocd", model.mimeFilters().filters().get(0).media()); + Assertions.assertEquals("blgphuticn", model.mimeFilters().filters().get(0).extensions().get(0)); + Assertions.assertEquals("fkgiawxk", model.xmlFilters().defaultNamespace()); + Assertions.assertEquals(XmlReferenceType.INLINE, model.xmlFilters().reference()); + Assertions.assertEquals("lwckbasyypnddhs", model.xmlFilters().schema()); + Assertions.assertEquals("cph", model.textMatching().deny().get(0).text()); + Assertions.assertEquals(MatchType.PARTIAL, model.textMatching().deny().get(0).matchType()); + Assertions.assertEquals(Casing.INSENSITIVE, model.textMatching().deny().get(0).caseSensitivity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FlowProfileRulesets model = new FlowProfileRulesets() + .withAntivirus(new AntivirusRuleset().withAvSolutions(Arrays.asList(AntivirusSolutions.CLAM_AV))) + .withArchives(new ArchiveRuleset().withMinimumSizeForExpansion(8041345972245934829L) + .withMaximumExpansionSizeLimit(1086863474205991756L) + .withMaximumDepthLimit(5492310413680784267L) + .withMaximumCompressionRatioLimit(44.56756335924435D)) + .withDataSize(new DataSizeRuleset().withMaximum(8087000369487039234L).withMinimum(5558562364469410639L)) + .withMimeFilters(new MimeFilterRuleset().withType(FilterType.DENY) + .withFilters(Arrays.asList(new MimeTypeFilter().withMedia("dhugjzzdatqxhocd") + .withExtensions(Arrays.asList("blgphuticn", "vkaozwyiftyhxhur", "k", "tyxolniwpwc"))))) + .withXmlFilters(new XmlFilterRuleset().withDefaultNamespace("fkgiawxk") + .withReference(XmlReferenceType.INLINE) + .withSchema("lwckbasyypnddhs")) + .withTextMatching(new TextMatchingRuleset().withDeny(Arrays.asList( + new TextMatchingRulesetDeny().withText("cph") + .withMatchType(MatchType.PARTIAL) + .withCaseSensitivity(Casing.INSENSITIVE), + new TextMatchingRulesetDeny().withText("ot") + .withMatchType(MatchType.COMPLETE) + .withCaseSensitivity(Casing.INSENSITIVE), + new TextMatchingRulesetDeny().withText("gou") + .withMatchType(MatchType.PARTIAL) + .withCaseSensitivity(Casing.INSENSITIVE)))); + model = BinaryData.fromObject(model).toObject(FlowProfileRulesets.class); + Assertions.assertEquals(AntivirusSolutions.CLAM_AV, model.antivirus().avSolutions().get(0)); + Assertions.assertEquals(8041345972245934829L, model.archives().minimumSizeForExpansion()); + Assertions.assertEquals(1086863474205991756L, model.archives().maximumExpansionSizeLimit()); + Assertions.assertEquals(5492310413680784267L, model.archives().maximumDepthLimit()); + Assertions.assertEquals(44.56756335924435D, model.archives().maximumCompressionRatioLimit()); + Assertions.assertEquals(8087000369487039234L, model.dataSize().maximum()); + Assertions.assertEquals(5558562364469410639L, model.dataSize().minimum()); + Assertions.assertEquals(FilterType.DENY, model.mimeFilters().type()); + Assertions.assertEquals("dhugjzzdatqxhocd", model.mimeFilters().filters().get(0).media()); + Assertions.assertEquals("blgphuticn", model.mimeFilters().filters().get(0).extensions().get(0)); + Assertions.assertEquals("fkgiawxk", model.xmlFilters().defaultNamespace()); + Assertions.assertEquals(XmlReferenceType.INLINE, model.xmlFilters().reference()); + Assertions.assertEquals("lwckbasyypnddhs", model.xmlFilters().schema()); + Assertions.assertEquals("cph", model.textMatching().deny().get(0).text()); + Assertions.assertEquals(MatchType.PARTIAL, model.textMatching().deny().get(0).matchType()); + Assertions.assertEquals(Casing.INSENSITIVE, model.textMatching().deny().get(0).caseSensitivity()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesCreateOrUpdateMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesCreateOrUpdateMockTests.java new file mode 100644 index 0000000000000..38cc68f968c82 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesCreateOrUpdateMockTests.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.AntivirusRuleset; +import com.azure.resourcemanager.datatransfer.models.AntivirusSolutions; +import com.azure.resourcemanager.datatransfer.models.ArchiveRuleset; +import com.azure.resourcemanager.datatransfer.models.Casing; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.DataSizeRuleset; +import com.azure.resourcemanager.datatransfer.models.FilterType; +import com.azure.resourcemanager.datatransfer.models.FlowProfile; +import com.azure.resourcemanager.datatransfer.models.FlowProfileProperties; +import com.azure.resourcemanager.datatransfer.models.FlowProfileRulesets; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.MatchType; +import com.azure.resourcemanager.datatransfer.models.MimeFilterRuleset; +import com.azure.resourcemanager.datatransfer.models.MimeTypeFilter; +import com.azure.resourcemanager.datatransfer.models.TextMatchingRuleset; +import com.azure.resourcemanager.datatransfer.models.TextMatchingRulesetDeny; +import com.azure.resourcemanager.datatransfer.models.UserAssignedIdentity; +import com.azure.resourcemanager.datatransfer.models.XmlFilterRuleset; +import com.azure.resourcemanager.datatransfer.models.XmlReferenceType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class FlowProfilesCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"flowProfileId\":\"mxelnwcltyjed\",\"replicationScenario\":\"Stream\",\"status\":\"Disabled\",\"description\":\"mlfmkqs\",\"rulesets\":{\"antivirus\":{\"avSolutions\":[\"ClamAv\"]},\"archives\":{\"minimumSizeForExpansion\":165417238037681242,\"maximumExpansionSizeLimit\":3480922619213281392,\"maximumDepthLimit\":6563700004505435420,\"maximumCompressionRatioLimit\":45.141991686801305},\"dataSize\":{\"maximum\":6127617863372488579,\"minimum\":166767772147299373},\"mimeFilters\":{\"type\":\"Allow\",\"filters\":[{},{},{}]},\"xmlFilters\":{\"defaultNamespace\":\"xyasflvgsgzw\",\"reference\":\"Inline\",\"schema\":\"oi\"},\"textMatching\":{\"deny\":[{\"text\":\"mjblmljhlny\",\"matchType\":\"Complete\",\"caseSensitivity\":\"Insensitive\"},{\"text\":\"tqyryuzcbmqqv\",\"matchType\":\"Partial\",\"caseSensitivity\":\"Insensitive\"},{\"text\":\"wfgtayxonsup\",\"matchType\":\"Complete\",\"caseSensitivity\":\"Insensitive\"},{\"text\":\"lzqnhcvs\",\"matchType\":\"Complete\",\"caseSensitivity\":\"Sensitive\"}]}}},\"identity\":{\"principalId\":\"oibgsxg\",\"tenantId\":\"fyq\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"dbxiqx\":{\"principalId\":\"ox\",\"clientId\":\"o\"}}},\"location\":\"iqbi\",\"tags\":{\"bcblemb\":\"mwwinhehfqpofv\",\"ihebwtsw\":\"kbwvqvxkdiv\"},\"id\":\"zuwfmdur\",\"name\":\"gegizvcjfel\",\"type\":\"sdjubggbqigkxkbs\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + FlowProfile response = manager.flowProfiles() + .define("hrbbpneqvcwwyy") + .withRegion("wjutifdwfmv") + .withExistingPipeline("dlat", "tmzlbiojlv") + .withTags(mapOf("tzh", "rqjb")) + .withProperties(new FlowProfileProperties().withReplicationScenario(DataClassType.API) + .withStatus(FlowProfileStatus.OBSOLETE) + .withDescription("nmokayzejnhlbk") + .withRulesets(new FlowProfileRulesets() + .withAntivirus(new AntivirusRuleset() + .withAvSolutions(Arrays.asList(AntivirusSolutions.CLAM_AV, AntivirusSolutions.DEFENDER))) + .withArchives(new ArchiveRuleset().withMinimumSizeForExpansion(5927101181188461178L) + .withMaximumExpansionSizeLimit(1718820549593481354L) + .withMaximumDepthLimit(353173494369186573L) + .withMaximumCompressionRatioLimit(16.14008041402967D)) + .withDataSize( + new DataSizeRuleset().withMaximum(1374556425311315309L).withMinimum(7376500269691950777L)) + .withMimeFilters(new MimeFilterRuleset().withType(FilterType.DENY) + .withFilters(Arrays.asList(new MimeTypeFilter(), new MimeTypeFilter(), new MimeTypeFilter()))) + .withXmlFilters(new XmlFilterRuleset().withDefaultNamespace("bwefqsfapaqtfer") + .withReference(XmlReferenceType.INLINE) + .withSchema("x")) + .withTextMatching(new TextMatchingRuleset().withDeny(Arrays.asList( + new TextMatchingRulesetDeny().withText("xap") + .withMatchType(MatchType.COMPLETE) + .withCaseSensitivity(Casing.INSENSITIVE), + new TextMatchingRulesetDeny().withText("gqqnobpudcda") + .withMatchType(MatchType.PARTIAL) + .withCaseSensitivity(Casing.SENSITIVE), + new TextMatchingRulesetDeny().withText("wpwyawbz") + .withMatchType(MatchType.PARTIAL) + .withCaseSensitivity(Casing.SENSITIVE), + new TextMatchingRulesetDeny().withText("bucljgkyexaogu") + .withMatchType(MatchType.COMPLETE) + .withCaseSensitivity(Casing.INSENSITIVE)))))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf("zrdpsovwxznptgoe", new UserAssignedIdentity(), "lkvn", new UserAssignedIdentity(), + "mifrygznmma", new UserAssignedIdentity(), "lxecwcrojphslh", new UserAssignedIdentity()))) + .create(); + + Assertions.assertEquals("iqbi", response.location()); + Assertions.assertEquals("mwwinhehfqpofv", response.tags().get("bcblemb")); + Assertions.assertEquals(DataClassType.STREAM, response.properties().replicationScenario()); + Assertions.assertEquals(FlowProfileStatus.DISABLED, response.properties().status()); + Assertions.assertEquals("mlfmkqs", response.properties().description()); + Assertions.assertEquals(AntivirusSolutions.CLAM_AV, + response.properties().rulesets().antivirus().avSolutions().get(0)); + Assertions.assertEquals(165417238037681242L, + response.properties().rulesets().archives().minimumSizeForExpansion()); + Assertions.assertEquals(3480922619213281392L, + response.properties().rulesets().archives().maximumExpansionSizeLimit()); + Assertions.assertEquals(6563700004505435420L, response.properties().rulesets().archives().maximumDepthLimit()); + Assertions.assertEquals(45.141991686801305D, + response.properties().rulesets().archives().maximumCompressionRatioLimit()); + Assertions.assertEquals(6127617863372488579L, response.properties().rulesets().dataSize().maximum()); + Assertions.assertEquals(166767772147299373L, response.properties().rulesets().dataSize().minimum()); + Assertions.assertEquals(FilterType.ALLOW, response.properties().rulesets().mimeFilters().type()); + Assertions.assertEquals("xyasflvgsgzw", response.properties().rulesets().xmlFilters().defaultNamespace()); + Assertions.assertEquals(XmlReferenceType.INLINE, response.properties().rulesets().xmlFilters().reference()); + Assertions.assertEquals("oi", response.properties().rulesets().xmlFilters().schema()); + Assertions.assertEquals("mjblmljhlny", response.properties().rulesets().textMatching().deny().get(0).text()); + Assertions.assertEquals(MatchType.COMPLETE, + response.properties().rulesets().textMatching().deny().get(0).matchType()); + Assertions.assertEquals(Casing.INSENSITIVE, + response.properties().rulesets().textMatching().deny().get(0).caseSensitivity()); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.identity().type()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesGetWithResponseMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesGetWithResponseMockTests.java new file mode 100644 index 0000000000000..0adf52bf893bb --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesGetWithResponseMockTests.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.AntivirusSolutions; +import com.azure.resourcemanager.datatransfer.models.Casing; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.FilterType; +import com.azure.resourcemanager.datatransfer.models.FlowProfile; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.MatchType; +import com.azure.resourcemanager.datatransfer.models.XmlReferenceType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class FlowProfilesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Canceled\",\"flowProfileId\":\"ouau\",\"replicationScenario\":\"Complex\",\"status\":\"Enabled\",\"description\":\"tloqxfuojrn\",\"rulesets\":{\"antivirus\":{\"avSolutions\":[\"Defender\",\"Defender\",\"Defender\",\"ClamAv\"]},\"archives\":{\"minimumSizeForExpansion\":5394588020483902059,\"maximumExpansionSizeLimit\":7631584210516257592,\"maximumDepthLimit\":6769546219149410070,\"maximumCompressionRatioLimit\":91.6927151946404},\"dataSize\":{\"maximum\":7996059228480805157,\"minimum\":1642641561666020981},\"mimeFilters\":{\"type\":\"Allow\",\"filters\":[{},{},{},{}]},\"xmlFilters\":{\"defaultNamespace\":\"zslzojhp\",\"reference\":\"Inline\",\"schema\":\"mdxotngfdgu\"},\"textMatching\":{\"deny\":[{\"text\":\"i\",\"matchType\":\"Complete\",\"caseSensitivity\":\"Insensitive\"},{\"text\":\"kyuizabsnmfpp\",\"matchType\":\"Partial\",\"caseSensitivity\":\"Insensitive\"}]}}},\"identity\":{\"principalId\":\"vyhyhsgzfc\",\"tenantId\":\"gomfgbeglq\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"xeeebtijvacvbmqz\":{\"principalId\":\"i\",\"clientId\":\"tnluankrr\"}}},\"location\":\"q\",\"tags\":{\"h\":\"jrnwxacev\"},\"id\":\"kuyxoafg\",\"name\":\"oqltfae\",\"type\":\"linmfgv\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + FlowProfile response = manager.flowProfiles() + .getWithResponse("dyfpchrqbnj", "rcgegydcwboxjum", "qqoli", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("q", response.location()); + Assertions.assertEquals("jrnwxacev", response.tags().get("h")); + Assertions.assertEquals(DataClassType.COMPLEX, response.properties().replicationScenario()); + Assertions.assertEquals(FlowProfileStatus.ENABLED, response.properties().status()); + Assertions.assertEquals("tloqxfuojrn", response.properties().description()); + Assertions.assertEquals(AntivirusSolutions.DEFENDER, + response.properties().rulesets().antivirus().avSolutions().get(0)); + Assertions.assertEquals(5394588020483902059L, + response.properties().rulesets().archives().minimumSizeForExpansion()); + Assertions.assertEquals(7631584210516257592L, + response.properties().rulesets().archives().maximumExpansionSizeLimit()); + Assertions.assertEquals(6769546219149410070L, response.properties().rulesets().archives().maximumDepthLimit()); + Assertions.assertEquals(91.6927151946404D, + response.properties().rulesets().archives().maximumCompressionRatioLimit()); + Assertions.assertEquals(7996059228480805157L, response.properties().rulesets().dataSize().maximum()); + Assertions.assertEquals(1642641561666020981L, response.properties().rulesets().dataSize().minimum()); + Assertions.assertEquals(FilterType.ALLOW, response.properties().rulesets().mimeFilters().type()); + Assertions.assertEquals("zslzojhp", response.properties().rulesets().xmlFilters().defaultNamespace()); + Assertions.assertEquals(XmlReferenceType.INLINE, response.properties().rulesets().xmlFilters().reference()); + Assertions.assertEquals("mdxotngfdgu", response.properties().rulesets().xmlFilters().schema()); + Assertions.assertEquals("i", response.properties().rulesets().textMatching().deny().get(0).text()); + Assertions.assertEquals(MatchType.COMPLETE, + response.properties().rulesets().textMatching().deny().get(0).matchType()); + Assertions.assertEquals(Casing.INSENSITIVE, + response.properties().rulesets().textMatching().deny().get(0).caseSensitivity()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, response.identity().type()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesListByPipelineMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesListByPipelineMockTests.java new file mode 100644 index 0000000000000..0b408f42139ce --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesListByPipelineMockTests.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.AntivirusSolutions; +import com.azure.resourcemanager.datatransfer.models.Casing; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.FilterType; +import com.azure.resourcemanager.datatransfer.models.FlowProfile; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.MatchType; +import com.azure.resourcemanager.datatransfer.models.XmlReferenceType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class FlowProfilesListByPipelineMockTests { + @Test + public void testListByPipeline() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"flowProfileId\":\"smexiitdf\",\"replicationScenario\":\"SoftwareArtifacts\",\"status\":\"Disabled\",\"description\":\"yasiibmiy\",\"rulesets\":{\"antivirus\":{\"avSolutions\":[\"ClamAv\",\"ClamAv\"]},\"archives\":{\"minimumSizeForExpansion\":1948425303402168643,\"maximumExpansionSizeLimit\":5871871887515703016,\"maximumDepthLimit\":5528337560499983450,\"maximumCompressionRatioLimit\":31.01483222425886},\"dataSize\":{\"maximum\":4211321915913216397,\"minimum\":5485854076220810952},\"mimeFilters\":{\"type\":\"Deny\",\"filters\":[{},{},{}]},\"xmlFilters\":{\"defaultNamespace\":\"prot\",\"reference\":\"Inline\",\"schema\":\"ndm\"},\"textMatching\":{\"deny\":[{\"text\":\"gcmjkavl\",\"matchType\":\"Partial\",\"caseSensitivity\":\"Insensitive\"},{\"text\":\"bmftpmdt\",\"matchType\":\"Complete\",\"caseSensitivity\":\"Sensitive\"},{\"text\":\"ltfvnz\",\"matchType\":\"Partial\",\"caseSensitivity\":\"Sensitive\"},{\"text\":\"t\",\"matchType\":\"Complete\",\"caseSensitivity\":\"Insensitive\"}]}}},\"identity\":{\"principalId\":\"pvpbdbzqgqqiheds\",\"tenantId\":\"wthmkyib\",\"type\":\"None\",\"userAssignedIdentities\":{\"sufco\":{\"principalId\":\"sgqcwdho\",\"clientId\":\"dtmcd\"},\"wqqxeysko\":{\"principalId\":\"xbzlmc\",\"clientId\":\"apcvhdbe\"}}},\"location\":\"zinkfkbgbzbowxeq\",\"tags\":{\"qkjjeokbz\":\"jmygvk\",\"czurtlei\":\"fezrx\",\"bkwvzg\":\"q\",\"bzdixzmq\":\"zvd\"},\"id\":\"noda\",\"name\":\"opqhewjptmc\",\"type\":\"sbostzel\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.flowProfiles().listByPipeline("irpghriypoqeyh", "qhykprlpyzn", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("zinkfkbgbzbowxeq", response.iterator().next().location()); + Assertions.assertEquals("jmygvk", response.iterator().next().tags().get("qkjjeokbz")); + Assertions.assertEquals(DataClassType.SOFTWARE_ARTIFACTS, + response.iterator().next().properties().replicationScenario()); + Assertions.assertEquals(FlowProfileStatus.DISABLED, response.iterator().next().properties().status()); + Assertions.assertEquals("yasiibmiy", response.iterator().next().properties().description()); + Assertions.assertEquals(AntivirusSolutions.CLAM_AV, + response.iterator().next().properties().rulesets().antivirus().avSolutions().get(0)); + Assertions.assertEquals(1948425303402168643L, + response.iterator().next().properties().rulesets().archives().minimumSizeForExpansion()); + Assertions.assertEquals(5871871887515703016L, + response.iterator().next().properties().rulesets().archives().maximumExpansionSizeLimit()); + Assertions.assertEquals(5528337560499983450L, + response.iterator().next().properties().rulesets().archives().maximumDepthLimit()); + Assertions.assertEquals(31.01483222425886D, + response.iterator().next().properties().rulesets().archives().maximumCompressionRatioLimit()); + Assertions.assertEquals(4211321915913216397L, + response.iterator().next().properties().rulesets().dataSize().maximum()); + Assertions.assertEquals(5485854076220810952L, + response.iterator().next().properties().rulesets().dataSize().minimum()); + Assertions.assertEquals(FilterType.DENY, + response.iterator().next().properties().rulesets().mimeFilters().type()); + Assertions.assertEquals("prot", + response.iterator().next().properties().rulesets().xmlFilters().defaultNamespace()); + Assertions.assertEquals(XmlReferenceType.INLINE, + response.iterator().next().properties().rulesets().xmlFilters().reference()); + Assertions.assertEquals("ndm", response.iterator().next().properties().rulesets().xmlFilters().schema()); + Assertions.assertEquals("gcmjkavl", + response.iterator().next().properties().rulesets().textMatching().deny().get(0).text()); + Assertions.assertEquals(MatchType.PARTIAL, + response.iterator().next().properties().rulesets().textMatching().deny().get(0).matchType()); + Assertions.assertEquals(Casing.INSENSITIVE, + response.iterator().next().properties().rulesets().textMatching().deny().get(0).caseSensitivity()); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.iterator().next().identity().type()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesListResultInnerTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesListResultInnerTests.java new file mode 100644 index 0000000000000..dc72508abe463 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowProfilesListResultInnerTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.fluent.models.FlowProfilesListResultInner; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import org.junit.jupiter.api.Assertions; + +public final class FlowProfilesListResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FlowProfilesListResultInner model = BinaryData.fromString( + "{\"value\":[{\"pipeline\":\"ncvjts\",\"name\":\"cof\",\"replicationScenario\":\"Stream\",\"flowProfileId\":\"e\",\"status\":\"Enabled\",\"description\":\"dhgbjkvre\"},{\"pipeline\":\"jeamurv\",\"name\":\"mlovuanashcxl\",\"replicationScenario\":\"API\",\"flowProfileId\":\"jerbdkelvidizozs\",\"status\":\"Obsolete\",\"description\":\"ccxjm\"},{\"pipeline\":\"nfdgn\",\"name\":\"n\",\"replicationScenario\":\"Messaging\",\"flowProfileId\":\"puuw\",\"status\":\"Obsolete\",\"description\":\"tvuqjctzenkeifzz\"},{\"pipeline\":\"mkdasv\",\"name\":\"lyhb\",\"replicationScenario\":\"Complex\",\"flowProfileId\":\"udchxgsrboldforo\",\"status\":\"Obsolete\",\"description\":\"jlvizbfhfovva\"}]}") + .toObject(FlowProfilesListResultInner.class); + Assertions.assertEquals("ncvjts", model.value().get(0).pipeline()); + Assertions.assertEquals("cof", model.value().get(0).name()); + Assertions.assertEquals(DataClassType.STREAM, model.value().get(0).replicationScenario()); + Assertions.assertEquals("e", model.value().get(0).flowProfileId()); + Assertions.assertEquals(FlowProfileStatus.ENABLED, model.value().get(0).status()); + Assertions.assertEquals("dhgbjkvre", model.value().get(0).description()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetDestinationEndpointPortsWithResponseMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetDestinationEndpointPortsWithResponseMockTests.java new file mode 100644 index 0000000000000..08d8359494273 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetDestinationEndpointPortsWithResponseMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.GetDestinationEndpointPortsResult; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class FlowsGetDestinationEndpointPortsWithResponseMockTests { + @Test + public void testGetDestinationEndpointPortsWithResponse() throws Exception { + String responseStr = "{\"ports\":[7659517955968508578,3069082401150326102,5037986779075366865]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + GetDestinationEndpointPortsResult response = manager.flows() + .getDestinationEndpointPortsWithResponse("laohoqkp", "t", "qjilaywkdcwmqsyr", + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(7659517955968508578L, response.ports().get(0)); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetDestinationEndpointsWithResponseMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetDestinationEndpointsWithResponseMockTests.java new file mode 100644 index 0000000000000..80a8dd2348b36 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetDestinationEndpointsWithResponseMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.GetDestinationEndpointsResult; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class FlowsGetDestinationEndpointsWithResponseMockTests { + @Test + public void testGetDestinationEndpointsWithResponse() throws Exception { + String responseStr = "{\"endpoints\":[\"zocrdzgczeu\",\"tgxdncaqt\"]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + GetDestinationEndpointsResult response = manager.flows() + .getDestinationEndpointsWithResponse("lfylnkkbjpjvlyw", "tmfwobbjwhl", "yj", + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("zocrdzgczeu", response.endpoints().get(0)); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetSourceAddressesWithResponseMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetSourceAddressesWithResponseMockTests.java new file mode 100644 index 0000000000000..d46ccfab62acc --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetSourceAddressesWithResponseMockTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.StreamSourceAddresses; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class FlowsGetSourceAddressesWithResponseMockTests { + @Test + public void testGetSourceAddressesWithResponse() throws Exception { + String responseStr = "{\"sourceAddresses\":[\"hlqtxnrflkn\"]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + StreamSourceAddresses response = manager.flows() + .getSourceAddressesWithResponse("iekoif", "vnyttzgi", "gyrihlgm", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("hlqtxnrflkn", response.sourceAddresses().get(0)); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetStreamConnectionStringWithResponseMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetStreamConnectionStringWithResponseMockTests.java new file mode 100644 index 0000000000000..369aaba8b5814 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowsGetStreamConnectionStringWithResponseMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.GetStreamConnectionStringResult; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class FlowsGetStreamConnectionStringWithResponseMockTests { + @Test + public void testGetStreamConnectionStringWithResponse() throws Exception { + String responseStr = "{\"connectionString\":\"umljcirvpef\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + GetStreamConnectionStringResult response = manager.flows() + .getStreamConnectionStringWithResponse("rndpgfjodhdaqotw", "hipx", "gsabvcipowzafc", + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("umljcirvpef", response.connectionString()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowsPatchPropertiesTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowsPatchPropertiesTests.java new file mode 100644 index 0000000000000..a16e6312d297e --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowsPatchPropertiesTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.FlowsPatchProperties; +import com.azure.resourcemanager.datatransfer.models.StreamProtocol; +import org.junit.jupiter.api.Assertions; + +public final class FlowsPatchPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FlowsPatchProperties model = BinaryData.fromString( + "{\"streamProtocol\":\"SRT\",\"passphrase\":\"athwt\",\"streamId\":\"lbaemwmdxmeb\",\"streamLatency\":34566941819509688}") + .toObject(FlowsPatchProperties.class); + Assertions.assertEquals(StreamProtocol.SRT, model.streamProtocol()); + Assertions.assertEquals("athwt", model.passphrase()); + Assertions.assertEquals("lbaemwmdxmeb", model.streamId()); + Assertions.assertEquals(34566941819509688L, model.streamLatency()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FlowsPatchProperties model = new FlowsPatchProperties().withStreamProtocol(StreamProtocol.SRT) + .withPassphrase("athwt") + .withStreamId("lbaemwmdxmeb") + .withStreamLatency(34566941819509688L); + model = BinaryData.fromObject(model).toObject(FlowsPatchProperties.class); + Assertions.assertEquals(StreamProtocol.SRT, model.streamProtocol()); + Assertions.assertEquals("athwt", model.passphrase()); + Assertions.assertEquals("lbaemwmdxmeb", model.streamId()); + Assertions.assertEquals(34566941819509688L, model.streamLatency()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowsPatchTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowsPatchTests.java new file mode 100644 index 0000000000000..09633cf70bd8f --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowsPatchTests.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.FlowsPatch; +import com.azure.resourcemanager.datatransfer.models.FlowsPatchProperties; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.StreamProtocol; +import com.azure.resourcemanager.datatransfer.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class FlowsPatchTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FlowsPatch model = BinaryData.fromString( + "{\"properties\":{\"streamProtocol\":\"SRT\",\"passphrase\":\"idltugsresmkss\",\"streamId\":\"oiftxfkfwegprh\",\"streamLatency\":3447954674598592829},\"identity\":{\"principalId\":\"cbiqtgdqoh\",\"tenantId\":\"wsldrizetpwbr\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"joylh\":{\"principalId\":\"bphbqzmizakakank\",\"clientId\":\"dnjzh\"},\"slstvasy\":{\"principalId\":\"muoyxprimr\",\"clientId\":\"pteecjme\"}}},\"tags\":{\"uufuz\":\"dzaumweooh\"}}") + .toObject(FlowsPatch.class); + Assertions.assertEquals(StreamProtocol.SRT, model.properties().streamProtocol()); + Assertions.assertEquals("idltugsresmkss", model.properties().passphrase()); + Assertions.assertEquals("oiftxfkfwegprh", model.properties().streamId()); + Assertions.assertEquals(3447954674598592829L, model.properties().streamLatency()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); + Assertions.assertEquals("dzaumweooh", model.tags().get("uufuz")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FlowsPatch model = new FlowsPatch() + .withProperties(new FlowsPatchProperties().withStreamProtocol(StreamProtocol.SRT) + .withPassphrase("idltugsresmkss") + .withStreamId("oiftxfkfwegprh") + .withStreamLatency(3447954674598592829L)) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities( + mapOf("joylh", new UserAssignedIdentity(), "slstvasy", new UserAssignedIdentity()))) + .withTags(mapOf("uufuz", "dzaumweooh")); + model = BinaryData.fromObject(model).toObject(FlowsPatch.class); + Assertions.assertEquals(StreamProtocol.SRT, model.properties().streamProtocol()); + Assertions.assertEquals("idltugsresmkss", model.properties().passphrase()); + Assertions.assertEquals("oiftxfkfwegprh", model.properties().streamId()); + Assertions.assertEquals(3447954674598592829L, model.properties().streamLatency()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); + Assertions.assertEquals("dzaumweooh", model.tags().get("uufuz")); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowsUpdateMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowsUpdateMockTests.java new file mode 100644 index 0000000000000..52d5733ab4e3c --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/FlowsUpdateMockTests.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.FlowsPatch; +import com.azure.resourcemanager.datatransfer.models.FlowsPatchProperties; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.StreamProtocol; +import com.azure.resourcemanager.datatransfer.models.UserAssignedIdentity; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class FlowsUpdateMockTests { + @Test + public void testUpdate() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.flows() + .update("yzbfvxovqkx", "uxqggvqrnhyhl", "cjsqggjhffbxr", new FlowsPatch() + .withProperties(new FlowsPatchProperties().withStreamProtocol(StreamProtocol.UDP) + .withPassphrase("peuqlsdxeqztvxwm") + .withStreamId("mjswenawwamecle") + .withStreamLatency(7889615004017663344L)) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("cswqa", new UserAssignedIdentity()))) + .withTags(mapOf("tpgaeukya", "vtxigvjr", "csklhsidsjt", "ohpmwhqn", "gazlsvbz", "lpbnin", "e", "cpuo")), + com.azure.core.util.Context.NONE); + + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/GetDestinationEndpointPortsResultInnerTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/GetDestinationEndpointPortsResultInnerTests.java new file mode 100644 index 0000000000000..ca4b1020f2883 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/GetDestinationEndpointPortsResultInnerTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.fluent.models.GetDestinationEndpointPortsResultInner; +import org.junit.jupiter.api.Assertions; + +public final class GetDestinationEndpointPortsResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GetDestinationEndpointPortsResultInner model + = BinaryData.fromString("{\"ports\":[7702544556638830973,6057977291261276419,6361487186249709697]}") + .toObject(GetDestinationEndpointPortsResultInner.class); + Assertions.assertEquals(7702544556638830973L, model.ports().get(0)); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/GetDestinationEndpointsResultInnerTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/GetDestinationEndpointsResultInnerTests.java new file mode 100644 index 0000000000000..6024c04e914f7 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/GetDestinationEndpointsResultInnerTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.fluent.models.GetDestinationEndpointsResultInner; +import org.junit.jupiter.api.Assertions; + +public final class GetDestinationEndpointsResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GetDestinationEndpointsResultInner model + = BinaryData.fromString("{\"endpoints\":[\"igpibud\"]}").toObject(GetDestinationEndpointsResultInner.class); + Assertions.assertEquals("igpibud", model.endpoints().get(0)); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/GetStreamConnectionStringResultInnerTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/GetStreamConnectionStringResultInnerTests.java new file mode 100644 index 0000000000000..b751a95afd4b1 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/GetStreamConnectionStringResultInnerTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.fluent.models.GetStreamConnectionStringResultInner; +import org.junit.jupiter.api.Assertions; + +public final class GetStreamConnectionStringResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GetStreamConnectionStringResultInner model = BinaryData.fromString("{\"connectionString\":\"yxeb\"}") + .toObject(GetStreamConnectionStringResultInner.class); + Assertions.assertEquals("yxeb", model.connectionString()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/InternalMetadataPropertiesTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/InternalMetadataPropertiesTests.java new file mode 100644 index 0000000000000..92bf7403d0956 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/InternalMetadataPropertiesTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.InternalMetadataProperties; + +public final class InternalMetadataPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InternalMetadataProperties model = BinaryData.fromString( + "{\"operationStatus\":{\"status\":\"Failed\",\"id\":\"tfdygpfqb\",\"message\":\"ceopzfqrhhuaopp\"},\"statusSetBy\":\"qeqxo\",\"moizpos\":\"\\\"dataahzxctobgbk\\\"\",\"rmfqjhhkxbpvj\":\"\\\"datamgrcfbu\\\"\",\"xjyngudivk\":\"\\\"datamjh\\\"\"}") + .toObject(InternalMetadataProperties.class); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ListApprovedSchemasRequestTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ListApprovedSchemasRequestTests.java new file mode 100644 index 0000000000000..2e89b05b4918b --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ListApprovedSchemasRequestTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.Direction; +import com.azure.resourcemanager.datatransfer.models.ListApprovedSchemasRequest; +import org.junit.jupiter.api.Assertions; + +public final class ListApprovedSchemasRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ListApprovedSchemasRequest model + = BinaryData.fromString("{\"pipeline\":\"wrevkhgnlnzon\",\"direction\":\"Receive\"}") + .toObject(ListApprovedSchemasRequest.class); + Assertions.assertEquals("wrevkhgnlnzon", model.pipeline()); + Assertions.assertEquals(Direction.RECEIVE, model.direction()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ListApprovedSchemasRequest model + = new ListApprovedSchemasRequest().withPipeline("wrevkhgnlnzon").withDirection(Direction.RECEIVE); + model = BinaryData.fromObject(model).toObject(ListApprovedSchemasRequest.class); + Assertions.assertEquals("wrevkhgnlnzon", model.pipeline()); + Assertions.assertEquals(Direction.RECEIVE, model.direction()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ListFlowProfilesRequestTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ListFlowProfilesRequestTests.java new file mode 100644 index 0000000000000..52ee531cc707e --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ListFlowProfilesRequestTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.ListFlowProfilesRequest; +import org.junit.jupiter.api.Assertions; + +public final class ListFlowProfilesRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ListFlowProfilesRequest model + = BinaryData.fromString("{\"pipeline\":\"i\"}").toObject(ListFlowProfilesRequest.class); + Assertions.assertEquals("i", model.pipeline()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ListFlowProfilesRequest model = new ListFlowProfilesRequest().withPipeline("i"); + model = BinaryData.fromObject(model).toObject(ListFlowProfilesRequest.class); + Assertions.assertEquals("i", model.pipeline()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ListPipelineMetadataRequestTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ListPipelineMetadataRequestTests.java new file mode 100644 index 0000000000000..56e54ec8cc005 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ListPipelineMetadataRequestTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.ListPipelineMetadataRequest; +import org.junit.jupiter.api.Assertions; + +public final class ListPipelineMetadataRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ListPipelineMetadataRequest model + = BinaryData.fromString("{\"pipeline\":\"muaslzkw\"}").toObject(ListPipelineMetadataRequest.class); + Assertions.assertEquals("muaslzkw", model.pipeline()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ListPipelineMetadataRequest model = new ListPipelineMetadataRequest().withPipeline("muaslzkw"); + model = BinaryData.fromObject(model).toObject(ListPipelineMetadataRequest.class); + Assertions.assertEquals("muaslzkw", model.pipeline()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ListPipelineMetadataResultInnerTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ListPipelineMetadataResultInnerTests.java new file mode 100644 index 0000000000000..6f29ac48c1a3a --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ListPipelineMetadataResultInnerTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.fluent.models.ListPipelineMetadataResultInner; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.EnablementStatus; +import com.azure.resourcemanager.datatransfer.models.FlowBillingTier; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import org.junit.jupiter.api.Assertions; + +public final class ListPipelineMetadataResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ListPipelineMetadataResultInner model = BinaryData.fromString( + "{\"send\":{\"completeLinking\":\"Disabled\",\"connectionApprovals\":\"Enabled\",\"flowApprovals\":\"Disabled\",\"flowTypesAvailable\":[\"Mission\",\"Opaque\",\"Standard\"],\"messagingFlowTypeSchemaValidation\":\"Disabled\",\"flowProfileDataClassesAvailable\":[\"Files\",\"Stream\",\"SoftwareArtifacts\",\"API\"],\"messagingFlowsPricingOptions\":[\"BlobTransport\",\"BlobTransport\",\"BlobTransport\"]},\"receive\":{\"completeLinking\":\"Disabled\",\"connectionApprovals\":\"Enabled\",\"flowApprovals\":\"Disabled\",\"flowTypesAvailable\":[\"MissionOpaqueXML\",\"Standard\",\"StreamingVideo\",\"StreamingVideo\"],\"messagingFlowTypeSchemaValidation\":\"Enabled\",\"flowProfileDataClassesAvailable\":[\"SoftwareArtifacts\",\"API\",\"SoftwareArtifacts\",\"Complex\"],\"messagingFlowsPricingOptions\":[\"Standard\",\"Standard\"]}}") + .toObject(ListPipelineMetadataResultInner.class); + Assertions.assertEquals(EnablementStatus.DISABLED, model.send().completeLinking()); + Assertions.assertEquals(EnablementStatus.ENABLED, model.send().connectionApprovals()); + Assertions.assertEquals(EnablementStatus.DISABLED, model.send().flowApprovals()); + Assertions.assertEquals(FlowType.MISSION, model.send().flowTypesAvailable().get(0)); + Assertions.assertEquals(EnablementStatus.DISABLED, model.send().messagingFlowTypeSchemaValidation()); + Assertions.assertEquals(DataClassType.FILES, model.send().flowProfileDataClassesAvailable().get(0)); + Assertions.assertEquals(FlowBillingTier.BLOB_TRANSPORT, model.send().messagingFlowsPricingOptions().get(0)); + Assertions.assertEquals(EnablementStatus.DISABLED, model.receive().completeLinking()); + Assertions.assertEquals(EnablementStatus.ENABLED, model.receive().connectionApprovals()); + Assertions.assertEquals(EnablementStatus.DISABLED, model.receive().flowApprovals()); + Assertions.assertEquals(FlowType.MISSION_OPAQUE_XML, model.receive().flowTypesAvailable().get(0)); + Assertions.assertEquals(EnablementStatus.ENABLED, model.receive().messagingFlowTypeSchemaValidation()); + Assertions.assertEquals(DataClassType.SOFTWARE_ARTIFACTS, + model.receive().flowProfileDataClassesAvailable().get(0)); + Assertions.assertEquals(FlowBillingTier.STANDARD, model.receive().messagingFlowsPricingOptions().get(0)); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ManagedServiceIdentityTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ManagedServiceIdentityTests.java new file mode 100644 index 0000000000000..aa571dd668358 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ManagedServiceIdentityTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ManagedServiceIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedServiceIdentity model = BinaryData.fromString( + "{\"principalId\":\"uckyf\",\"tenantId\":\"rfidfvzwdz\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"km\":{\"principalId\":\"wisdkft\",\"clientId\":\"xmnteiwaop\"},\"uf\":{\"principalId\":\"c\",\"clientId\":\"xdcu\"},\"sne\":{\"principalId\":\"pymzidnsezcxtbzs\",\"clientId\":\"yc\"}}}") + .toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("km", new UserAssignedIdentity(), "uf", new UserAssignedIdentity(), "sne", + new UserAssignedIdentity())); + model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/MessagingOptionsTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/MessagingOptionsTests.java new file mode 100644 index 0000000000000..4345710acb2df --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/MessagingOptionsTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.EnablementStatus; +import com.azure.resourcemanager.datatransfer.models.FlowBillingTier; +import com.azure.resourcemanager.datatransfer.models.MessagingOptions; +import org.junit.jupiter.api.Assertions; + +public final class MessagingOptionsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MessagingOptions model + = BinaryData.fromString("{\"billingTier\":\"BlobTransport\",\"performancePriority\":\"Enabled\"}") + .toObject(MessagingOptions.class); + Assertions.assertEquals(FlowBillingTier.BLOB_TRANSPORT, model.billingTier()); + Assertions.assertEquals(EnablementStatus.ENABLED, model.performancePriority()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MessagingOptions model = new MessagingOptions().withBillingTier(FlowBillingTier.BLOB_TRANSPORT) + .withPerformancePriority(EnablementStatus.ENABLED); + model = BinaryData.fromObject(model).toObject(MessagingOptions.class); + Assertions.assertEquals(FlowBillingTier.BLOB_TRANSPORT, model.billingTier()); + Assertions.assertEquals(EnablementStatus.ENABLED, model.performancePriority()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/MimeFilterRulesetTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/MimeFilterRulesetTests.java new file mode 100644 index 0000000000000..c15a68d0e6445 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/MimeFilterRulesetTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.FilterType; +import com.azure.resourcemanager.datatransfer.models.MimeFilterRuleset; +import com.azure.resourcemanager.datatransfer.models.MimeTypeFilter; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MimeFilterRulesetTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MimeFilterRuleset model = BinaryData.fromString( + "{\"type\":\"Allow\",\"filters\":[{\"media\":\"qedqytbciqfoufl\",\"extensions\":[\"kzsmodm\",\"lougpbkw\",\"mutduqktaps\"]},{\"media\":\"gcue\",\"extensions\":[\"mkdo\",\"vqwhbmdgbbjfd\",\"gmbmbexppbh\",\"q\"]}]}") + .toObject(MimeFilterRuleset.class); + Assertions.assertEquals(FilterType.ALLOW, model.type()); + Assertions.assertEquals("qedqytbciqfoufl", model.filters().get(0).media()); + Assertions.assertEquals("kzsmodm", model.filters().get(0).extensions().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MimeFilterRuleset model = new MimeFilterRuleset().withType(FilterType.ALLOW) + .withFilters(Arrays.asList( + new MimeTypeFilter().withMedia("qedqytbciqfoufl") + .withExtensions(Arrays.asList("kzsmodm", "lougpbkw", "mutduqktaps")), + new MimeTypeFilter().withMedia("gcue") + .withExtensions(Arrays.asList("mkdo", "vqwhbmdgbbjfd", "gmbmbexppbh", "q")))); + model = BinaryData.fromObject(model).toObject(MimeFilterRuleset.class); + Assertions.assertEquals(FilterType.ALLOW, model.type()); + Assertions.assertEquals("qedqytbciqfoufl", model.filters().get(0).media()); + Assertions.assertEquals("kzsmodm", model.filters().get(0).extensions().get(0)); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/MimeTypeFilterTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/MimeTypeFilterTests.java new file mode 100644 index 0000000000000..133fadf310437 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/MimeTypeFilterTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.MimeTypeFilter; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MimeTypeFilterTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MimeTypeFilter model + = BinaryData.fromString("{\"media\":\"ol\",\"extensions\":[\"psalgbqux\",\"gjyjgzjaoyfhrtxi\",\"n\"]}") + .toObject(MimeTypeFilter.class); + Assertions.assertEquals("ol", model.media()); + Assertions.assertEquals("psalgbqux", model.extensions().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MimeTypeFilter model + = new MimeTypeFilter().withMedia("ol").withExtensions(Arrays.asList("psalgbqux", "gjyjgzjaoyfhrtxi", "n")); + model = BinaryData.fromObject(model).toObject(MimeTypeFilter.class); + Assertions.assertEquals("ol", model.media()); + Assertions.assertEquals("psalgbqux", model.extensions().get(0)); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/OperationDisplayTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/OperationDisplayTests.java new file mode 100644 index 0000000000000..42540357e4882 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/OperationDisplayTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.OperationDisplay; + +public final class OperationDisplayTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationDisplay model = BinaryData.fromString( + "{\"provider\":\"cdm\",\"resource\":\"rcryuanzwuxzdxta\",\"operation\":\"lhmwhfpmrqobm\",\"description\":\"kknryrtihf\"}") + .toObject(OperationDisplay.class); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/OperationInnerTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/OperationInnerTests.java new file mode 100644 index 0000000000000..da64c3cd88621 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/OperationInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.fluent.models.OperationInner; + +public final class OperationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationInner model = BinaryData.fromString( + "{\"name\":\"nygj\",\"isDataAction\":true,\"display\":{\"provider\":\"eqsrdeupewnwreit\",\"resource\":\"yflusarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") + .toObject(OperationInner.class); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/OperationListResultTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/OperationListResultTests.java new file mode 100644 index 0000000000000..fcd9db2304121 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/OperationListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.implementation.models.OperationListResult; +import org.junit.jupiter.api.Assertions; + +public final class OperationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationListResult model = BinaryData.fromString( + "{\"value\":[{\"name\":\"hq\",\"isDataAction\":true,\"display\":{\"provider\":\"pybczmehmtzopb\",\"resource\":\"h\",\"operation\":\"pidgsybbejhphoyc\",\"description\":\"xaobhdxbmtqioqjz\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"fpownoizhwlr\",\"isDataAction\":false,\"display\":{\"provider\":\"oqijgkdmbpaz\",\"resource\":\"bc\",\"operation\":\"pdznrbtcqqjnqgl\",\"description\":\"gnufoooj\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"esaagdfm\",\"isDataAction\":true,\"display\":{\"provider\":\"j\",\"resource\":\"ifkwmrvktsizntoc\",\"operation\":\"a\",\"description\":\"ajpsquc\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"kfo\"}") + .toObject(OperationListResult.class); + Assertions.assertEquals("kfo", model.nextLink()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/OperationStatusPropertiesTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/OperationStatusPropertiesTests.java new file mode 100644 index 0000000000000..b8c4d85474538 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/OperationStatusPropertiesTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.OperationStatusProperties; + +public final class OperationStatusPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationStatusProperties model + = BinaryData.fromString("{\"status\":\"Failed\",\"id\":\"bxqz\",\"message\":\"zjf\"}") + .toObject(OperationStatusProperties.class); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/OperationsListMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/OperationsListMockTests.java new file mode 100644 index 0000000000000..ab387512d2785 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/OperationsListMockTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.Operation; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OperationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"name\":\"zyvli\",\"isDataAction\":false,\"display\":{\"provider\":\"cxkjibnxmysuxswq\",\"resource\":\"tvlwijpsttexoq\",\"operation\":\"wcyyufmhruncu\",\"description\":\"qspkcdqzhlctd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PendingConnectionInnerTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PendingConnectionInnerTests.java new file mode 100644 index 0000000000000..d6be04ebf9293 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PendingConnectionInnerTests.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.fluent.models.PendingConnectionInner; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.Direction; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.SchemaStatus; +import com.azure.resourcemanager.datatransfer.models.SchemaType; +import org.junit.jupiter.api.Assertions; + +public final class PendingConnectionInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PendingConnectionInner model = BinaryData.fromString( + "{\"subscriptionId\":\"gketwzhhzjhf\",\"pipeline\":\"mhv\",\"direction\":\"Send\",\"justification\":\"gpmuneqsxvmhfbuz\",\"status\":\"Approved\",\"forceDisabledStatus\":[\"ConnectionForceDisabled\",\"FlowTypeForceDisabled\"],\"statusReason\":\"hudypohyuemsl\",\"linkStatus\":\"Linked\",\"linkedConnectionId\":\"yrpfoobrlttymsj\",\"flowTypes\":[\"Opaque\",\"Mission\",\"MissionOpaqueXML\"],\"flowProfileList\":[{\"pipeline\":\"qzdz\",\"name\":\"tilaxh\",\"replicationScenario\":\"Files\",\"flowProfileId\":\"hqlyvijo\",\"status\":\"Disabled\",\"description\":\"iv\"},{\"pipeline\":\"xoyzunbix\",\"name\":\"rtikvcpwpg\",\"replicationScenario\":\"Stream\",\"flowProfileId\":\"rc\",\"status\":\"Enabled\",\"description\":\"tso\"},{\"pipeline\":\"frkenxpmyyefrp\",\"name\":\"pdnqqskawaoqvmmb\",\"replicationScenario\":\"Complex\",\"flowProfileId\":\"qfr\",\"status\":\"Enabled\",\"description\":\"lkzmegnitgvkxl\"},{\"pipeline\":\"yqdrf\",\"name\":\"gcealzxwh\",\"replicationScenario\":\"Stream\",\"flowProfileId\":\"nsymoyqhlwigd\",\"status\":\"Enabled\",\"description\":\"bkbxgomfa\"}],\"requirementId\":\"wasqvdaeyyg\",\"remoteSubscriptionId\":\"akjsqz\",\"approver\":\"bezkgimsidxasic\",\"pin\":\"yvvjskgfmo\",\"dateSubmitted\":\"2021-07-09T10:32:32Z\",\"primaryContact\":\"pqg\",\"secondaryContacts\":[\"eaahhvjhhn\",\"kzyb\",\"jjidjk\"],\"provisioningState\":\"Canceled\",\"policies\":[\"xvxevblbjednljla\",\"euaulxu\",\"smjbnkppxyn\"],\"schemas\":[{\"id\":\"vxei\",\"connectionId\":\"gwklnsr\",\"status\":\"Approved\",\"name\":\"ycxcktpiym\",\"content\":\"teeammxqiekkkzd\",\"direction\":\"Receive\",\"schemaUri\":\"g\",\"schemaType\":\"Zip\"},{\"id\":\"mxvavrefdee\",\"connectionId\":\"ecuijpxtxs\",\"status\":\"Approved\",\"name\":\"tujwsawdd\",\"content\":\"babxvitit\",\"direction\":\"Receive\",\"schemaUri\":\"exavoxt\",\"schemaType\":\"Zip\"}],\"schemaUris\":[\"dmdqb\"],\"apiHostname\":\"ypq\",\"tags\":{\"vodhtn\":\"fjacbslhhxudb\"},\"location\":\"irudh\",\"id\":\"mes\",\"name\":\"dlpagzrcxfail\",\"type\":\"xwmdboxd\"}") + .toObject(PendingConnectionInner.class); + Assertions.assertEquals("mhv", model.pipeline()); + Assertions.assertEquals(Direction.SEND, model.direction()); + Assertions.assertEquals("gpmuneqsxvmhfbuz", model.justification()); + Assertions.assertEquals(FlowType.OPAQUE, model.flowTypes().get(0)); + Assertions.assertEquals("qzdz", model.flowProfileList().get(0).pipeline()); + Assertions.assertEquals("tilaxh", model.flowProfileList().get(0).name()); + Assertions.assertEquals(DataClassType.FILES, model.flowProfileList().get(0).replicationScenario()); + Assertions.assertEquals("hqlyvijo", model.flowProfileList().get(0).flowProfileId()); + Assertions.assertEquals(FlowProfileStatus.DISABLED, model.flowProfileList().get(0).status()); + Assertions.assertEquals("iv", model.flowProfileList().get(0).description()); + Assertions.assertEquals("wasqvdaeyyg", model.requirementId()); + Assertions.assertEquals("akjsqz", model.remoteSubscriptionId()); + Assertions.assertEquals("yvvjskgfmo", model.pin()); + Assertions.assertEquals("pqg", model.primaryContact()); + Assertions.assertEquals("eaahhvjhhn", model.secondaryContacts().get(0)); + Assertions.assertEquals("xvxevblbjednljla", model.policies().get(0)); + Assertions.assertEquals("vxei", model.schemas().get(0).id()); + Assertions.assertEquals("gwklnsr", model.schemas().get(0).connectionId()); + Assertions.assertEquals(SchemaStatus.APPROVED, model.schemas().get(0).status()); + Assertions.assertEquals("ycxcktpiym", model.schemas().get(0).name()); + Assertions.assertEquals("teeammxqiekkkzd", model.schemas().get(0).content()); + Assertions.assertEquals(Direction.RECEIVE, model.schemas().get(0).direction()); + Assertions.assertEquals("g", model.schemas().get(0).schemaUri()); + Assertions.assertEquals(SchemaType.ZIP, model.schemas().get(0).schemaType()); + Assertions.assertEquals("dmdqb", model.schemaUris().get(0)); + Assertions.assertEquals("ypq", model.apiHostname()); + Assertions.assertEquals("fjacbslhhxudb", model.tags().get("vodhtn")); + Assertions.assertEquals("irudh", model.location()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PendingConnectionListResultTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PendingConnectionListResultTests.java new file mode 100644 index 0000000000000..f9293f7cb9da3 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PendingConnectionListResultTests.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.implementation.models.PendingConnectionListResult; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.Direction; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.SchemaStatus; +import com.azure.resourcemanager.datatransfer.models.SchemaType; +import org.junit.jupiter.api.Assertions; + +public final class PendingConnectionListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PendingConnectionListResult model = BinaryData.fromString( + "{\"value\":[{\"subscriptionId\":\"lllchpodb\",\"pipeline\":\"evwrdnhfuk\",\"direction\":\"Receive\",\"justification\":\"cswsmystul\",\"status\":\"Accepted\",\"forceDisabledStatus\":[\"FlowProfileForceDisabled\",\"FlowProfileForceDisabled\"],\"statusReason\":\"er\",\"linkStatus\":\"Unlinked\",\"linkedConnectionId\":\"bm\",\"flowTypes\":[\"MissionOpaqueXML\",\"MissionOpaqueXML\"],\"flowProfileList\":[{\"pipeline\":\"idfcxsspuunnoxyh\",\"name\":\"xgqddrih\",\"replicationScenario\":\"Files\",\"flowProfileId\":\"hoqca\",\"status\":\"Obsolete\",\"description\":\"wdaomdjvlpjxxkzb\"}],\"requirementId\":\"sgeivsiy\",\"remoteSubscriptionId\":\"kdncj\",\"approver\":\"onbzoggculapzwy\",\"pin\":\"gogtqxepnylbf\",\"dateSubmitted\":\"2021-07-07T20:12:10Z\",\"primaryContact\":\"yjt\",\"secondaryContacts\":[\"fqzhv\"],\"provisioningState\":\"Failed\",\"policies\":[\"fmo\"],\"schemas\":[{\"id\":\"kjpvdwxf\",\"connectionId\":\"iivwzjbhyzsxjrka\",\"status\":\"Approved\",\"name\":\"negvmnvuqe\",\"content\":\"lds\",\"direction\":\"Receive\",\"schemaUri\":\"jbkkdmflvestmjl\",\"schemaType\":\"Xsd\"},{\"id\":\"lozapeewchpxlk\",\"connectionId\":\"kuziycsle\",\"status\":\"New\",\"name\":\"ztcktyh\",\"content\":\"qedcgzulwm\",\"direction\":\"Send\",\"schemaUri\":\"zrrjvpgly\",\"schemaType\":\"Zip\"}],\"schemaUris\":[\"vqeevtoep\",\"yutnwytpzdmov\",\"vf\",\"aawzqadfl\"],\"apiHostname\":\"ur\",\"tags\":{\"kpvzmlq\":\"aecxndtic\",\"npkc\":\"mldgxobfirc\",\"khyawfvjlboxqv\":\"ayzri\"},\"location\":\"jlmxhomdynhd\",\"id\":\"igu\",\"name\":\"nraauzz\",\"type\":\"jazysdzhezwwvaiq\"},{\"subscriptionId\":\"vfonkphhqyikvyl\",\"pipeline\":\"uyav\",\"direction\":\"Send\",\"justification\":\"ncstt\",\"status\":\"Approved\",\"forceDisabledStatus\":[\"ConnectionForceDisabled\",\"PipelineForceDisabled\",\"ConnectionForceDisabled\",\"FlowTypeForceDisabled\"],\"statusReason\":\"rsg\",\"linkStatus\":\"Linked\",\"linkedConnectionId\":\"huzqgn\",\"flowTypes\":[\"BasicFiles\",\"BasicFiles\",\"Mission\"],\"flowProfileList\":[{\"pipeline\":\"liqhzvhx\",\"name\":\"komtkubotppn\",\"replicationScenario\":\"Complex\",\"flowProfileId\":\"xz\",\"status\":\"Disabled\",\"description\":\"ihfrbbcevqa\"}],\"requirementId\":\"ltd\",\"remoteSubscriptionId\":\"fkqojpy\",\"approver\":\"gtrd\",\"pin\":\"ifmzzsd\",\"dateSubmitted\":\"2021-09-12T12:46:22Z\",\"primaryContact\":\"nysuxmprafwgckh\",\"secondaryContacts\":[\"vdff\"],\"provisioningState\":\"Succeeded\",\"policies\":[\"roud\",\"spave\"],\"schemas\":[{\"id\":\"kbunzoz\",\"connectionId\":\"hcxgkmoyx\",\"status\":\"New\",\"name\":\"ibhmfdn\",\"content\":\"ydvfvfcjnae\",\"direction\":\"Receive\",\"schemaUri\":\"vhmgorffukis\",\"schemaType\":\"Xsd\"}],\"schemaUris\":[\"hwplefaxvx\",\"l\",\"btgn\",\"nzeyqxtjj\"],\"apiHostname\":\"qlqhycavodg\",\"tags\":{\"iaa\":\"beesmieknlra\",\"agt\":\"iuagydwqfbylyrfg\"},\"location\":\"ojocqwogf\",\"id\":\"jvusfzldmozux\",\"name\":\"fsbtkad\",\"type\":\"s\"},{\"subscriptionId\":\"btgkbugrjqctoj\",\"pipeline\":\"mi\",\"direction\":\"Receive\",\"justification\":\"eypefojyqd\",\"status\":\"InReview\",\"forceDisabledStatus\":[\"ConnectionForceDisabled\",\"FlowTypeForceDisabled\"],\"statusReason\":\"cwkhihi\",\"linkStatus\":\"Unlinked\",\"linkedConnectionId\":\"dsqtzbsrgnowcjh\",\"flowTypes\":[\"DevSecOps\"],\"flowProfileList\":[{\"pipeline\":\"actxmwoteyowc\",\"name\":\"uqovekqvgqouwif\",\"replicationScenario\":\"Complex\",\"flowProfileId\":\"pjwyiv\",\"status\":\"Disabled\",\"description\":\"kfxcvhrfs\"}],\"requirementId\":\"uagrttikteusqc\",\"remoteSubscriptionId\":\"vyklxuby\",\"approver\":\"ff\",\"pin\":\"fblcq\",\"dateSubmitted\":\"2021-12-02T06:18Z\",\"primaryContact\":\"gqibrtalmetttw\",\"secondaryContacts\":[\"lqxihhrmooiz\",\"seypxiutcxapz\"],\"provisioningState\":\"Accepted\",\"policies\":[\"togebjoxsl\",\"vnh\"],\"schemas\":[{\"id\":\"q\",\"connectionId\":\"kzjcjbtrgae\",\"status\":\"New\",\"name\":\"brxjjsto\",\"content\":\"eitpkxztmo\",\"direction\":\"Send\",\"schemaUri\":\"ft\",\"schemaType\":\"Zip\"},{\"id\":\"cwq\",\"connectionId\":\"imaq\",\"status\":\"New\",\"name\":\"mjyhohujswtwko\",\"content\":\"wculkbaw\",\"direction\":\"Receive\",\"schemaUri\":\"njwltlwtjjgu\",\"schemaType\":\"Xsd\"},{\"id\":\"hsnvkcdmxzrp\",\"connectionId\":\"imlnwiaaomylw\",\"status\":\"New\",\"name\":\"lcsethwwnpj\",\"content\":\"fz\",\"direction\":\"Send\",\"schemaUri\":\"hwahfbousn\",\"schemaType\":\"Zip\"}],\"schemaUris\":[\"ewetwlyxgncxykxh\",\"jhlimmbcxfhbcpo\",\"xvxcjzhq\",\"zxfpxtgqsc\"],\"apiHostname\":\"vftjuhd\",\"tags\":{\"tgguwpijrajcivmm\":\"k\",\"wrxgkneuvy\":\"hfcf\",\"hoxgsgbpf\":\"nzqodfvpg\",\"aqvlgafcqusr\":\"zdjtxvzflbqv\"},\"location\":\"vetnwsdtutn\",\"id\":\"duy\",\"name\":\"uzhyrmewipmvekdx\",\"type\":\"uqgsj\"}],\"nextLink\":\"n\"}") + .toObject(PendingConnectionListResult.class); + Assertions.assertEquals("evwrdnhfuk", model.value().get(0).pipeline()); + Assertions.assertEquals(Direction.RECEIVE, model.value().get(0).direction()); + Assertions.assertEquals("cswsmystul", model.value().get(0).justification()); + Assertions.assertEquals(FlowType.MISSION_OPAQUE_XML, model.value().get(0).flowTypes().get(0)); + Assertions.assertEquals("idfcxsspuunnoxyh", model.value().get(0).flowProfileList().get(0).pipeline()); + Assertions.assertEquals("xgqddrih", model.value().get(0).flowProfileList().get(0).name()); + Assertions.assertEquals(DataClassType.FILES, + model.value().get(0).flowProfileList().get(0).replicationScenario()); + Assertions.assertEquals("hoqca", model.value().get(0).flowProfileList().get(0).flowProfileId()); + Assertions.assertEquals(FlowProfileStatus.OBSOLETE, model.value().get(0).flowProfileList().get(0).status()); + Assertions.assertEquals("wdaomdjvlpjxxkzb", model.value().get(0).flowProfileList().get(0).description()); + Assertions.assertEquals("sgeivsiy", model.value().get(0).requirementId()); + Assertions.assertEquals("kdncj", model.value().get(0).remoteSubscriptionId()); + Assertions.assertEquals("gogtqxepnylbf", model.value().get(0).pin()); + Assertions.assertEquals("yjt", model.value().get(0).primaryContact()); + Assertions.assertEquals("fqzhv", model.value().get(0).secondaryContacts().get(0)); + Assertions.assertEquals("fmo", model.value().get(0).policies().get(0)); + Assertions.assertEquals("kjpvdwxf", model.value().get(0).schemas().get(0).id()); + Assertions.assertEquals("iivwzjbhyzsxjrka", model.value().get(0).schemas().get(0).connectionId()); + Assertions.assertEquals(SchemaStatus.APPROVED, model.value().get(0).schemas().get(0).status()); + Assertions.assertEquals("negvmnvuqe", model.value().get(0).schemas().get(0).name()); + Assertions.assertEquals("lds", model.value().get(0).schemas().get(0).content()); + Assertions.assertEquals(Direction.RECEIVE, model.value().get(0).schemas().get(0).direction()); + Assertions.assertEquals("jbkkdmflvestmjl", model.value().get(0).schemas().get(0).schemaUri()); + Assertions.assertEquals(SchemaType.XSD, model.value().get(0).schemas().get(0).schemaType()); + Assertions.assertEquals("vqeevtoep", model.value().get(0).schemaUris().get(0)); + Assertions.assertEquals("ur", model.value().get(0).apiHostname()); + Assertions.assertEquals("aecxndtic", model.value().get(0).tags().get("kpvzmlq")); + Assertions.assertEquals("jlmxhomdynhd", model.value().get(0).location()); + Assertions.assertEquals("n", model.nextLink()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelineConnectionPropertiesTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelineConnectionPropertiesTests.java new file mode 100644 index 0000000000000..f5ec083b62d0b --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelineConnectionPropertiesTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.PipelineConnectionProperties; + +public final class PipelineConnectionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PipelineConnectionProperties model = BinaryData.fromString( + "{\"internalMetadata\":{\"operationStatus\":{\"status\":\"Failed\",\"id\":\"bxwyjsflhhcaa\",\"message\":\"jixisxyawjoyaqcs\"},\"statusSetBy\":\"jpkiidzyexznelix\",\"alaulppggdtpnapn\":\"\\\"dataztfolhbnxk\\\"\"},\"pgylg\":\"\\\"dataopuhpig\\\"\",\"medjvcslynqwwncw\":\"\\\"datagit\\\"\",\"pkteo\":\"\\\"datazhxgktrmgucn\\\"\"}") + .toObject(PipelineConnectionProperties.class); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelineInnerTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelineInnerTests.java new file mode 100644 index 0000000000000..2cf5a76d95248 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelineInnerTests.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.fluent.models.PipelineInner; +import com.azure.resourcemanager.datatransfer.models.DataClass; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.PipelineProperties; +import com.azure.resourcemanager.datatransfer.models.PipelineStatus; +import com.azure.resourcemanager.datatransfer.models.Subscriber; +import com.azure.resourcemanager.datatransfer.models.UserAssignedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class PipelineInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PipelineInner model = BinaryData.fromString( + "{\"properties\":{\"remoteCloud\":\"gidyjrrf\",\"displayName\":\"aos\",\"connections\":[{\"id\":\"csonpclhoco\",\"name\":\"lkevle\",\"type\":\"zfbuhf\",\"location\":\"faxkffeii\",\"etag\":\"lvmezyvshxmzsbbz\",\"properties\":{\"internalMetadata\":{\"operationStatus\":{},\"statusSetBy\":\"xwburvjxxjns\",\"udwtiukbl\":\"\\\"dataptkoenkoukn\\\"\",\"o\":\"\\\"datangkpocipazy\\\"\",\"ntypmrbpizcdrqj\":\"\\\"datagukgjnpiucgygevq\\\"\"},\"cwif\":\"\\\"dataydnfyhxdeoejz\\\"\"},\"jdeyeamdpha\":\"\\\"datatgzfbishcbkh\\\"\",\"wkgshwa\":\"\\\"dataalpbuxwgipwhon\\\"\"}],\"subscribers\":[{\"email\":\"zbinjeputtm\",\"notifications\":8855720569573412705},{\"email\":\"zoqftiyqzrnkcqvy\",\"notifications\":3429279847863801881},{\"email\":\"lsicohoqqnwv\",\"notifications\":3263586208444372741},{\"email\":\"w\",\"notifications\":3153727360520202232}],\"provisioningState\":\"Accepted\",\"policies\":[\"hgyxzkonoc\",\"koklya\",\"uconuqszfkbey\",\"ewrmjmwvvjektc\"],\"flowTypes\":[\"DevSecOps\",\"Data\"],\"disabledFlowTypes\":[\"Data\"],\"disabledDataClass\":[\"ApiSDK\",\"ApiEndpoint\",\"ServiceBus\",\"ServiceBus\"],\"quarantineDownloadStorageAccount\":\"v\",\"quarantineDownloadStorageContainer\":\"dqgbiqylihkaetc\",\"status\":\"Disabled\"},\"identity\":{\"principalId\":\"ivfsnk\",\"tenantId\":\"uctqhjfbe\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"nljky\":{\"principalId\":\"erfuwuttt\",\"clientId\":\"vjrbirphxepcyvah\"},\"jljyoxgv\":{\"principalId\":\"j\",\"clientId\":\"ujqgidok\"}}},\"location\":\"tbgsncghkj\",\"tags\":{\"xbf\":\"zhbijhtxfv\"},\"id\":\"mxnehmp\",\"name\":\"ec\",\"type\":\"godebfqkkrbmpu\"}") + .toObject(PipelineInner.class); + Assertions.assertEquals("tbgsncghkj", model.location()); + Assertions.assertEquals("zhbijhtxfv", model.tags().get("xbf")); + Assertions.assertEquals("gidyjrrf", model.properties().remoteCloud()); + Assertions.assertEquals("aos", model.properties().displayName()); + Assertions.assertEquals("zbinjeputtm", model.properties().subscribers().get(0).email()); + Assertions.assertEquals(8855720569573412705L, model.properties().subscribers().get(0).notifications()); + Assertions.assertEquals("hgyxzkonoc", model.properties().policies().get(0)); + Assertions.assertEquals(FlowType.DEV_SEC_OPS, model.properties().flowTypes().get(0)); + Assertions.assertEquals(FlowType.DATA, model.properties().disabledFlowTypes().get(0)); + Assertions.assertEquals(DataClass.API_SDK, model.properties().disabledDataClass().get(0)); + Assertions.assertEquals("v", model.properties().quarantineDownloadStorageAccount()); + Assertions.assertEquals("dqgbiqylihkaetc", model.properties().quarantineDownloadStorageContainer()); + Assertions.assertEquals(PipelineStatus.DISABLED, model.properties().status()); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PipelineInner model + = new PipelineInner().withLocation("tbgsncghkj") + .withTags(mapOf("xbf", "zhbijhtxfv")) + .withProperties( + new PipelineProperties().withRemoteCloud("gidyjrrf") + .withDisplayName("aos") + .withSubscribers(Arrays.asList( + new Subscriber().withEmail("zbinjeputtm").withNotifications(8855720569573412705L), + new Subscriber().withEmail("zoqftiyqzrnkcqvy").withNotifications(3429279847863801881L), + new Subscriber().withEmail("lsicohoqqnwv").withNotifications(3263586208444372741L), + new Subscriber().withEmail("w").withNotifications(3153727360520202232L))) + .withPolicies(Arrays.asList("hgyxzkonoc", "koklya", "uconuqszfkbey", "ewrmjmwvvjektc")) + .withFlowTypes(Arrays.asList(FlowType.DEV_SEC_OPS, FlowType.DATA)) + .withDisabledFlowTypes(Arrays.asList(FlowType.DATA)) + .withDisabledDataClass(Arrays.asList(DataClass.API_SDK, DataClass.API_ENDPOINT, + DataClass.SERVICE_BUS, DataClass.SERVICE_BUS)) + .withQuarantineDownloadStorageAccount("v") + .withQuarantineDownloadStorageContainer("dqgbiqylihkaetc") + .withStatus(PipelineStatus.DISABLED)) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf("nljky", new UserAssignedIdentity(), "jljyoxgv", new UserAssignedIdentity()))); + model = BinaryData.fromObject(model).toObject(PipelineInner.class); + Assertions.assertEquals("tbgsncghkj", model.location()); + Assertions.assertEquals("zhbijhtxfv", model.tags().get("xbf")); + Assertions.assertEquals("gidyjrrf", model.properties().remoteCloud()); + Assertions.assertEquals("aos", model.properties().displayName()); + Assertions.assertEquals("zbinjeputtm", model.properties().subscribers().get(0).email()); + Assertions.assertEquals(8855720569573412705L, model.properties().subscribers().get(0).notifications()); + Assertions.assertEquals("hgyxzkonoc", model.properties().policies().get(0)); + Assertions.assertEquals(FlowType.DEV_SEC_OPS, model.properties().flowTypes().get(0)); + Assertions.assertEquals(FlowType.DATA, model.properties().disabledFlowTypes().get(0)); + Assertions.assertEquals(DataClass.API_SDK, model.properties().disabledDataClass().get(0)); + Assertions.assertEquals("v", model.properties().quarantineDownloadStorageAccount()); + Assertions.assertEquals("dqgbiqylihkaetc", model.properties().quarantineDownloadStorageContainer()); + Assertions.assertEquals(PipelineStatus.DISABLED, model.properties().status()); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelineListResultTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelineListResultTests.java new file mode 100644 index 0000000000000..7c3228aec4527 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelineListResultTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.implementation.models.PipelineListResult; +import com.azure.resourcemanager.datatransfer.models.DataClass; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.PipelineStatus; +import org.junit.jupiter.api.Assertions; + +public final class PipelineListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PipelineListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"remoteCloud\":\"vnaenqpehindoyg\",\"displayName\":\"fthnzdn\",\"connections\":[{\"id\":\"gnayqigynduh\",\"name\":\"hqlkthumaqo\",\"type\":\"gycdu\",\"location\":\"r\",\"etag\":\"ccymvaolpsslql\",\"properties\":{},\"yhz\":\"\\\"databbglzpswiydmc\\\"\"}],\"subscribers\":[{\"email\":\"adbzmnvdfznud\",\"notifications\":6737445379863438751}],\"provisioningState\":\"Succeeded\",\"policies\":[\"cblylpstdbhhxsr\",\"dzu\",\"erscdntne\"],\"flowTypes\":[\"DevSecOps\",\"Mission\",\"StreamingVideo\"],\"disabledFlowTypes\":[\"Mission\",\"MissionOpaqueXML\",\"StreamingVideo\"],\"disabledDataClass\":[\"Table\",\"Video\",\"ApiEndpoint\",\"ApiSDK\"],\"quarantineDownloadStorageAccount\":\"eriofzpyqs\",\"quarantineDownloadStorageContainer\":\"wab\",\"status\":\"Disabled\"},\"identity\":{\"principalId\":\"hszhedplvwiwu\",\"tenantId\":\"wmbesldnkw\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"nsikvmkqzeqqkdl\":{\"principalId\":\"flcxoga\",\"clientId\":\"onz\"},\"gxtibqdxbxw\":{\"principalId\":\"zxmhhvhgu\",\"clientId\":\"odkwobd\"},\"bebxmubyyntwl\":{\"principalId\":\"bogqxndlkzgxhu\",\"clientId\":\"plbpodxun\"}}},\"location\":\"qtkoievs\",\"tags\":{\"wzizxbmpgcjefuzm\":\"gqrlltmuwla\"},\"id\":\"vpbttd\",\"name\":\"morppxebmnzbtbh\",\"type\":\"pglkf\"},{\"properties\":{\"remoteCloud\":\"hdneuelfph\",\"displayName\":\"yhtozfikdowwqu\",\"connections\":[{\"id\":\"zx\",\"name\":\"vithh\",\"type\":\"o\",\"location\":\"sg\",\"etag\":\"hcohfwdsjnk\",\"properties\":{},\"kfvhqcrailvpn\":\"\\\"dataiiswacffgdkzze\\\"\",\"mh\":\"\\\"datapfuflrw\\\"\",\"sag\":\"\\\"datalxyjr\\\"\"},{\"id\":\"fcnihgwq\",\"name\":\"nedgfbc\",\"type\":\"cvqvpkeqdcv\",\"location\":\"hvoodsotbobzd\",\"etag\":\"cjwvn\",\"properties\":{},\"twuoegrpkhjwni\":\"\\\"datamgxcxrslpm\\\"\",\"ggkzzlvmbmpa\":\"\\\"dataqsluicp\\\"\",\"yhrfouyftaakcpw\":\"\\\"datamodfvuefywsbpfvm\\\"\"}],\"subscribers\":[{\"email\":\"qtmnubexkpzk\",\"notifications\":6659081413348995373},{\"email\":\"jmquxvypomgk\",\"notifications\":462697352148793836},{\"email\":\"ojvpa\",\"notifications\":6027886219408436897}],\"provisioningState\":\"Failed\",\"policies\":[\"cmbqfqvmk\",\"xozap\",\"helxprglya\",\"dd\"],\"flowTypes\":[\"Standard\",\"Messaging\",\"Standard\",\"BasicFiles\"],\"disabledFlowTypes\":[\"MicrosoftInternal\",\"Complex\",\"Messaging\"],\"disabledDataClass\":[\"ApiSDK\"],\"quarantineDownloadStorageAccount\":\"brh\",\"quarantineDownloadStorageContainer\":\"xsdqrhzoymibmrqy\",\"status\":\"Disabled\"},\"identity\":{\"principalId\":\"fluszdtm\",\"tenantId\":\"kwofyyvoq\",\"type\":\"None\",\"userAssignedIdentities\":{\"dtkcnqxwbpokulp\":{\"principalId\":\"xpbtgiwbwo\",\"clientId\":\"washr\"},\"pqlpq\":{\"principalId\":\"jwaa\",\"clientId\":\"pqiiobyuqe\"},\"joxafnndlpi\":{\"principalId\":\"ciuqgbdb\",\"clientId\":\"auvfbtkuwhhmhyk\"}}},\"location\":\"koymkcd\",\"tags\":{\"reqnovvqfov\":\"pkkpw\",\"rsndsytgadgvra\":\"jxywsuws\",\"uu\":\"aeneqnzarrwl\"},\"id\":\"jfqka\",\"name\":\"e\",\"type\":\"iipfpubj\"},{\"properties\":{\"remoteCloud\":\"wwiftohqkvpuv\",\"displayName\":\"gplsaknynf\",\"connections\":[{\"id\":\"ljphuopxodl\",\"name\":\"ynt\",\"type\":\"zihleosjswsr\",\"location\":\"lyzrpzbchckqqzqi\",\"etag\":\"iysui\",\"properties\":{},\"itsmypyyn\":\"\\\"dataedyatrwyhqmibzyh\\\"\"}],\"subscribers\":[{\"email\":\"umnzgmwznmabik\",\"notifications\":1884314669361039477},{\"email\":\"jhxbld\",\"notifications\":3033706853935881392},{\"email\":\"lkdmtncvokotllxd\",\"notifications\":8614672168967170032}],\"provisioningState\":\"Failed\",\"policies\":[\"gjltdtbnnhado\",\"crkvcikhnv\",\"amqgxqquezikyw\",\"gxk\"],\"flowTypes\":[\"Data\"],\"disabledFlowTypes\":[\"Mission\",\"Standard\",\"Messaging\"],\"disabledDataClass\":[\"Blob\",\"Table\"],\"quarantineDownloadStorageAccount\":\"cjzkzivgvvcna\",\"quarantineDownloadStorageContainer\":\"hyrnxxmu\",\"status\":\"Disabled\"},\"identity\":{\"principalId\":\"rdvstkwqqtch\",\"tenantId\":\"lmfmtdaay\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"himdbl\":{\"principalId\":\"gpiohgwxrtfudxe\",\"clientId\":\"gyqagvrvmnpkuk\"},\"xw\":{\"principalId\":\"wi\",\"clientId\":\"njhf\"}}},\"location\":\"zk\",\"tags\":{\"fjawneaivxwczel\":\"qreyfkzi\",\"r\":\"c\",\"xbjhwuaanozjosph\":\"lsfeaenwabfatkld\",\"ag\":\"oulpjrv\"},\"id\":\"rvimjwosytxitcsk\",\"name\":\"cktqumiekkezzi\",\"type\":\"hlyfjhdgqgg\"}],\"nextLink\":\"dunyg\"}") + .toObject(PipelineListResult.class); + Assertions.assertEquals("qtkoievs", model.value().get(0).location()); + Assertions.assertEquals("gqrlltmuwla", model.value().get(0).tags().get("wzizxbmpgcjefuzm")); + Assertions.assertEquals("vnaenqpehindoyg", model.value().get(0).properties().remoteCloud()); + Assertions.assertEquals("fthnzdn", model.value().get(0).properties().displayName()); + Assertions.assertEquals("adbzmnvdfznud", model.value().get(0).properties().subscribers().get(0).email()); + Assertions.assertEquals(6737445379863438751L, + model.value().get(0).properties().subscribers().get(0).notifications()); + Assertions.assertEquals("cblylpstdbhhxsr", model.value().get(0).properties().policies().get(0)); + Assertions.assertEquals(FlowType.DEV_SEC_OPS, model.value().get(0).properties().flowTypes().get(0)); + Assertions.assertEquals(FlowType.MISSION, model.value().get(0).properties().disabledFlowTypes().get(0)); + Assertions.assertEquals(DataClass.TABLE, model.value().get(0).properties().disabledDataClass().get(0)); + Assertions.assertEquals("eriofzpyqs", model.value().get(0).properties().quarantineDownloadStorageAccount()); + Assertions.assertEquals("wab", model.value().get(0).properties().quarantineDownloadStorageContainer()); + Assertions.assertEquals(PipelineStatus.DISABLED, model.value().get(0).properties().status()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); + Assertions.assertEquals("dunyg", model.nextLink()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinePropertiesTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinePropertiesTests.java new file mode 100644 index 0000000000000..81b6fd4d9cbf1 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinePropertiesTests.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.DataClass; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.PipelineProperties; +import com.azure.resourcemanager.datatransfer.models.PipelineStatus; +import com.azure.resourcemanager.datatransfer.models.Subscriber; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class PipelinePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PipelineProperties model = BinaryData.fromString( + "{\"remoteCloud\":\"gr\",\"displayName\":\"flz\",\"connections\":[{\"id\":\"xzpuzycisp\",\"name\":\"zahmgkbrpyydhibn\",\"type\":\"qkpikadrgvtqagnb\",\"location\":\"nhijggmebfsi\",\"etag\":\"butr\",\"properties\":{\"internalMetadata\":{\"operationStatus\":{\"status\":\"Succeeded\",\"id\":\"hj\",\"message\":\"nmpxttdb\"},\"statusSetBy\":\"bnlankxmyskpb\",\"qidybyx\":\"\\\"databtkcxywnytnrsyn\\\"\",\"aaxdbabphlwrq\":\"\\\"datazfcl\\\"\",\"hsucoc\":\"\\\"datafkts\\\"\",\"ckzywbiexzfeyue\":\"\\\"datanyyazttbtwwrqpue\\\"\"},\"wbhqwal\":\"\\\"databxu\\\"\"},\"pdkzjancuxr\":\"\\\"datayoxa\\\"\",\"bavxbniwdjswzt\":\"\\\"datad\\\"\",\"xbzpfzab\":\"\\\"datadbpgnxytxhp\\\"\",\"ovplw\":\"\\\"datalcuhxwtctyqiklb\\\"\"},{\"id\":\"bhvgy\",\"name\":\"uosvmkfssxqukk\",\"type\":\"l\",\"location\":\"gsxnkjzkdeslpv\",\"etag\":\"pwiyig\",\"properties\":{\"internalMetadata\":{\"operationStatus\":{\"status\":\"Failed\",\"id\":\"aiuebbaumnyqu\",\"message\":\"deoj\"},\"statusSetBy\":\"bckhsmtxpsi\",\"rdqmhjjdhtldwkyz\":\"\\\"datafhvpesaps\\\"\",\"cwsvlxotog\":\"\\\"datauutkncw\\\"\",\"o\":\"\\\"datawrupqsxvnmicykvc\\\"\",\"vnotyfjfcnj\":\"\\\"dataeil\\\"\"},\"kphywpnvjto\":\"\\\"datanxdhbt\\\"\"},\"crpab\":\"\\\"datarmclfplphoxu\\\"\",\"sbj\":\"\\\"dataye\\\"\",\"wfqkquj\":\"\\\"dataazqugxywpmueefj\\\"\",\"cq\":\"\\\"datadsuyonobgla\\\"\"},{\"id\":\"tcc\",\"name\":\"yudxytlmoy\",\"type\":\"vwfudwpzntxhd\",\"location\":\"lrqjbhckfr\",\"etag\":\"rxsbkyvp\",\"properties\":{\"internalMetadata\":{\"operationStatus\":{\"status\":\"Succeeded\",\"id\":\"zka\",\"message\":\"uwbc\"},\"statusSetBy\":\"wbme\",\"maofmxagkv\":\"\\\"dataeyvjusrtslhspkde\\\"\",\"vljua\":\"\\\"datamelmqkrha\\\"\"},\"ualaexqpvfadmw\":\"\\\"datauhcdhm\\\"\",\"vgomz\":\"\\\"datarcrgvx\\\"\",\"bnbbeldawkz\":\"\\\"datafmisg\\\"\"},\"rqhakauha\":\"\\\"dataio\\\"\",\"cjooxdjebwpucwwf\":\"\\\"datahsfwxosowzxcug\\\"\",\"hzceuojgjrwjue\":\"\\\"dataovbvmeueciv\\\"\"}],\"subscribers\":[{\"email\":\"mcdytdxwitxnrj\",\"notifications\":7022663417329031305}],\"provisioningState\":\"Failed\",\"policies\":[\"ni\",\"kxfbkpycgklwndn\",\"jdauwhvy\"],\"flowTypes\":[\"Data\"],\"disabledFlowTypes\":[\"MicrosoftInternal\",\"Messaging\",\"StreamingVideo\"],\"disabledDataClass\":[\"ApiEndpoint\",\"EventHub\",\"EventHub\",\"EventHub\"],\"quarantineDownloadStorageAccount\":\"wuwprzqlv\",\"quarantineDownloadStorageContainer\":\"alupjm\",\"status\":\"Disabled\"}") + .toObject(PipelineProperties.class); + Assertions.assertEquals("gr", model.remoteCloud()); + Assertions.assertEquals("flz", model.displayName()); + Assertions.assertEquals("mcdytdxwitxnrj", model.subscribers().get(0).email()); + Assertions.assertEquals(7022663417329031305L, model.subscribers().get(0).notifications()); + Assertions.assertEquals("ni", model.policies().get(0)); + Assertions.assertEquals(FlowType.DATA, model.flowTypes().get(0)); + Assertions.assertEquals(FlowType.MICROSOFT_INTERNAL, model.disabledFlowTypes().get(0)); + Assertions.assertEquals(DataClass.API_ENDPOINT, model.disabledDataClass().get(0)); + Assertions.assertEquals("wuwprzqlv", model.quarantineDownloadStorageAccount()); + Assertions.assertEquals("alupjm", model.quarantineDownloadStorageContainer()); + Assertions.assertEquals(PipelineStatus.DISABLED, model.status()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PipelineProperties model = new PipelineProperties().withRemoteCloud("gr") + .withDisplayName("flz") + .withSubscribers( + Arrays.asList(new Subscriber().withEmail("mcdytdxwitxnrj").withNotifications(7022663417329031305L))) + .withPolicies(Arrays.asList("ni", "kxfbkpycgklwndn", "jdauwhvy")) + .withFlowTypes(Arrays.asList(FlowType.DATA)) + .withDisabledFlowTypes( + Arrays.asList(FlowType.MICROSOFT_INTERNAL, FlowType.MESSAGING, FlowType.STREAMING_VIDEO)) + .withDisabledDataClass( + Arrays.asList(DataClass.API_ENDPOINT, DataClass.EVENT_HUB, DataClass.EVENT_HUB, DataClass.EVENT_HUB)) + .withQuarantineDownloadStorageAccount("wuwprzqlv") + .withQuarantineDownloadStorageContainer("alupjm") + .withStatus(PipelineStatus.DISABLED); + model = BinaryData.fromObject(model).toObject(PipelineProperties.class); + Assertions.assertEquals("gr", model.remoteCloud()); + Assertions.assertEquals("flz", model.displayName()); + Assertions.assertEquals("mcdytdxwitxnrj", model.subscribers().get(0).email()); + Assertions.assertEquals(7022663417329031305L, model.subscribers().get(0).notifications()); + Assertions.assertEquals("ni", model.policies().get(0)); + Assertions.assertEquals(FlowType.DATA, model.flowTypes().get(0)); + Assertions.assertEquals(FlowType.MICROSOFT_INTERNAL, model.disabledFlowTypes().get(0)); + Assertions.assertEquals(DataClass.API_ENDPOINT, model.disabledDataClass().get(0)); + Assertions.assertEquals("wuwprzqlv", model.quarantineDownloadStorageAccount()); + Assertions.assertEquals("alupjm", model.quarantineDownloadStorageContainer()); + Assertions.assertEquals(PipelineStatus.DISABLED, model.status()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesApproveConnectionMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesApproveConnectionMockTests.java new file mode 100644 index 0000000000000..7a47db4d1f8e4 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesApproveConnectionMockTests.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.Connection; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.Direction; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.ResourceBody; +import com.azure.resourcemanager.datatransfer.models.SchemaStatus; +import com.azure.resourcemanager.datatransfer.models.SchemaType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PipelinesApproveConnectionMockTests { + @Test + public void testApproveConnection() throws Exception { + String responseStr + = "{\"properties\":{\"pipeline\":\"jcpeogkhnmg\",\"direction\":\"Receive\",\"justification\":\"xddbhfhpfpaz\",\"status\":\"Accepted\",\"forceDisabledStatus\":[\"FlowProfileForceDisabled\",\"FlowProfileForceDisabled\",\"FlowTypeForceDisabled\"],\"statusReason\":\"dulontacn\",\"linkStatus\":\"Linked\",\"linkedConnectionId\":\"ehtuevrhr\",\"flowTypes\":[\"BasicFiles\",\"Standard\"],\"flowProfileList\":[{\"pipeline\":\"xh\",\"name\":\"sd\",\"replicationScenario\":\"Stream\",\"flowProfileId\":\"gwbsreurf\",\"status\":\"Enabled\",\"description\":\"fuarenlvhht\"}],\"requirementId\":\"nvnaf\",\"remoteSubscriptionId\":\"kyfede\",\"approver\":\"bo\",\"pin\":\"cqxypokkhminq\",\"dateSubmitted\":\"2021-04-03T03:13:08Z\",\"primaryContact\":\"zng\",\"secondaryContacts\":[\"xxewu\",\"invudbch\",\"qdtvqecrqctmxx\"],\"provisioningState\":\"Succeeded\",\"policies\":[\"flhuytxzv\",\"zna\",\"xbannovvoxc\",\"ytprwnwvroev\"],\"schemas\":[{\"id\":\"okrrrouuxv\",\"connectionId\":\"asbcrymodizrx\",\"status\":\"Approved\",\"name\":\"d\",\"content\":\"azpmkmlmv\",\"direction\":\"Send\",\"schemaUri\":\"zopjhbzxliohr\",\"schemaType\":\"Zip\"},{\"id\":\"fg\",\"connectionId\":\"ba\",\"status\":\"New\",\"name\":\"bnzqcyknapq\",\"content\":\"yuicdhzbdy\",\"direction\":\"Receive\",\"schemaUri\":\"bdvibidmhmwffpl\",\"schemaType\":\"Xsd\"},{\"id\":\"apckccrrvw\",\"connectionId\":\"oxoyyukp\",\"status\":\"Approved\",\"name\":\"moiroqb\",\"content\":\"hbragapyyr\",\"direction\":\"Receive\",\"schemaUri\":\"bpav\",\"schemaType\":\"Xsd\"}],\"schemaUris\":[\"pdbwnupgahxkum\",\"sjcaacfdmmcpugm\",\"hqepvufhbzehewh\",\"qhnlbqnbld\"],\"apiHostname\":\"aclgschorimk\"},\"identity\":{\"principalId\":\"rmoucsofl\",\"tenantId\":\"uviyfcaabeo\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"jxnqp\":{\"principalId\":\"vbmxuqibsx\",\"clientId\":\"cudfbsfarfsiowl\"},\"afclu\":{\"principalId\":\"gf\",\"clientId\":\"mhqykizmdksa\"}}},\"location\":\"oxmycjimryvw\",\"tags\":{\"hecbvopwndyq\":\"wpbmzgwesydsxwef\",\"kxxpvbrd\":\"eallklmtkhlo\",\"tlhikcyychun\":\"jmzsyzfh\"},\"id\":\"jlpjrtwszhv\",\"name\":\"uic\",\"type\":\"hvtrrmhwrbfdpyf\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Connection response = manager.pipelines() + .approveConnection("axmqeqal", "hjnhgwydyynfsvk", + new ResourceBody().withId("gbv").withStatusReason("anarfdlpukhpyrne"), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("oxmycjimryvw", response.location()); + Assertions.assertEquals("wpbmzgwesydsxwef", response.tags().get("hecbvopwndyq")); + Assertions.assertEquals("jcpeogkhnmg", response.properties().pipeline()); + Assertions.assertEquals(Direction.RECEIVE, response.properties().direction()); + Assertions.assertEquals("xddbhfhpfpaz", response.properties().justification()); + Assertions.assertEquals(FlowType.BASIC_FILES, response.properties().flowTypes().get(0)); + Assertions.assertEquals("xh", response.properties().flowProfileList().get(0).pipeline()); + Assertions.assertEquals("sd", response.properties().flowProfileList().get(0).name()); + Assertions.assertEquals(DataClassType.STREAM, + response.properties().flowProfileList().get(0).replicationScenario()); + Assertions.assertEquals("gwbsreurf", response.properties().flowProfileList().get(0).flowProfileId()); + Assertions.assertEquals(FlowProfileStatus.ENABLED, response.properties().flowProfileList().get(0).status()); + Assertions.assertEquals("fuarenlvhht", response.properties().flowProfileList().get(0).description()); + Assertions.assertEquals("nvnaf", response.properties().requirementId()); + Assertions.assertEquals("kyfede", response.properties().remoteSubscriptionId()); + Assertions.assertEquals("cqxypokkhminq", response.properties().pin()); + Assertions.assertEquals("zng", response.properties().primaryContact()); + Assertions.assertEquals("xxewu", response.properties().secondaryContacts().get(0)); + Assertions.assertEquals("flhuytxzv", response.properties().policies().get(0)); + Assertions.assertEquals("okrrrouuxv", response.properties().schemas().get(0).id()); + Assertions.assertEquals("asbcrymodizrx", response.properties().schemas().get(0).connectionId()); + Assertions.assertEquals(SchemaStatus.APPROVED, response.properties().schemas().get(0).status()); + Assertions.assertEquals("d", response.properties().schemas().get(0).name()); + Assertions.assertEquals("azpmkmlmv", response.properties().schemas().get(0).content()); + Assertions.assertEquals(Direction.SEND, response.properties().schemas().get(0).direction()); + Assertions.assertEquals("zopjhbzxliohr", response.properties().schemas().get(0).schemaUri()); + Assertions.assertEquals(SchemaType.ZIP, response.properties().schemas().get(0).schemaType()); + Assertions.assertEquals("pdbwnupgahxkum", response.properties().schemaUris().get(0)); + Assertions.assertEquals("aclgschorimk", response.properties().apiHostname()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesCreateOrUpdateMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesCreateOrUpdateMockTests.java new file mode 100644 index 0000000000000..5cba5907e2aa6 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesCreateOrUpdateMockTests.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.DataClass; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.Pipeline; +import com.azure.resourcemanager.datatransfer.models.PipelineProperties; +import com.azure.resourcemanager.datatransfer.models.PipelineStatus; +import com.azure.resourcemanager.datatransfer.models.Subscriber; +import com.azure.resourcemanager.datatransfer.models.UserAssignedIdentity; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PipelinesCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"remoteCloud\":\"yeip\",\"displayName\":\"smjtgrqgdg\",\"connections\":[{\"id\":\"leplkcsmk\",\"name\":\"wtbbaedorvvmqf\",\"type\":\"ygbdgwumgxdgdhpa\",\"location\":\"dexjddvjs\",\"etag\":\"wotmmwllcolsrsxa\",\"properties\":{\"internalMetadata\":{},\"bekpeeksnbksdqhj\":\"\\\"dataxcgjokjljnhvlq\\\"\",\"lkhhu\":\"\\\"datayklxe\\\"\",\"nwqjwgokn\":\"\\\"datatcpoqma\\\"\",\"jbzten\":\"\\\"dataejjjkxybwfdb\\\"\"},\"shcdpkupnqrmg\":\"\\\"datazykjtjknsxfw\\\"\",\"eoiojfizfavkjzw\":\"\\\"datafbpkuw\\\"\"},{\"id\":\"bcyaykmmfzs\",\"name\":\"wxrzxmdewsrsxkrp\",\"type\":\"jazejwwviyoyp\",\"location\":\"hbrnnhjx\",\"etag\":\"wjh\",\"properties\":{\"internalMetadata\":{},\"ozycy\":\"\\\"datat\\\"\",\"zlex\":\"\\\"dataiqyhgfse\\\"\",\"jpziu\":\"\\\"datasfledyn\\\"\"},\"cljse\":\"\\\"datazkkdtnhqs\\\"\",\"evxrhyz\":\"\\\"datapkpbafvafhlbylcc\\\"\"}],\"subscribers\":[{\"email\":\"sofpltd\",\"notifications\":4950061805542007128}],\"provisioningState\":\"Succeeded\",\"policies\":[\"hfnrac\"],\"flowTypes\":[\"MissionOpaqueXML\",\"BasicFiles\",\"DiskImages\",\"Opaque\"],\"disabledFlowTypes\":[\"DevSecOps\",\"API\",\"DevSecOps\"],\"disabledDataClass\":[\"ServiceBus\",\"Table\",\"ServiceBus\",\"Blob\"],\"quarantineDownloadStorageAccount\":\"grbjbxsjybvitvqk\",\"quarantineDownloadStorageContainer\":\"az\",\"status\":\"Enabled\"},\"identity\":{\"principalId\":\"gmuwdchozfnkf\",\"tenantId\":\"lv\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"kwph\":{\"principalId\":\"izvoaiknaqlnuwi\",\"clientId\":\"yxl\"},\"vkcqhr\":{\"principalId\":\"zc\",\"clientId\":\"hmpejtlkexaonw\"},\"upijubyqjfkakfq\":{\"principalId\":\"xk\",\"clientId\":\"ccrmmk\"}}},\"location\":\"kemyil\",\"tags\":{\"owvfdjkpdxph\":\"xjas\",\"nmgzvyfijdkzuqnw\":\"kk\",\"uqoly\":\"it\"},\"id\":\"hluqwquls\",\"name\":\"trjbhxykfhyq\",\"type\":\"zvqqugdrftbcvexr\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Pipeline response + = manager.pipelines() + .define("t") + .withRegion("yvwehtaemxh") + .withExistingResourceGroup("randoypmb") + .withTags(mapOf("usxivzrrryvei", "se")) + .withProperties( + new PipelineProperties().withRemoteCloud("rmkfqlwxldykals") + .withDisplayName("aolnjpnnbmjk") + .withSubscribers(Arrays.asList( + new Subscriber().withEmail("txfkndlqvt").withNotifications(3979607074164714035L), + new Subscriber().withEmail("mmbugtywatmqaq").withNotifications(3366425827528139165L), + new Subscriber().withEmail("groeshoyg").withNotifications(1266954312744807835L), + new Subscriber().withEmail("qxkfaoytehqp").withNotifications(7114361752140588618L))) + .withPolicies(Arrays.asList("dwckygroe", "n")) + .withFlowTypes(Arrays.asList(FlowType.COMPLEX, FlowType.MISSION_OPAQUE_XML, FlowType.MESSAGING, + FlowType.COMPLEX)) + .withDisabledFlowTypes(Arrays.asList(FlowType.DISK_IMAGES)) + .withDisabledDataClass(Arrays.asList(DataClass.API_SDK)) + .withQuarantineDownloadStorageAccount("ynkceysfaqegpl") + .withQuarantineDownloadStorageContainer("ysh") + .withStatus(PipelineStatus.ENABLED)) + .withIdentity( + new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf("kdnwqapfgsdpcve", new UserAssignedIdentity(), "blhtjq", new UserAssignedIdentity()))) + .create(); + + Assertions.assertEquals("kemyil", response.location()); + Assertions.assertEquals("xjas", response.tags().get("owvfdjkpdxph")); + Assertions.assertEquals("yeip", response.properties().remoteCloud()); + Assertions.assertEquals("smjtgrqgdg", response.properties().displayName()); + Assertions.assertEquals("sofpltd", response.properties().subscribers().get(0).email()); + Assertions.assertEquals(4950061805542007128L, response.properties().subscribers().get(0).notifications()); + Assertions.assertEquals("hfnrac", response.properties().policies().get(0)); + Assertions.assertEquals(FlowType.MISSION_OPAQUE_XML, response.properties().flowTypes().get(0)); + Assertions.assertEquals(FlowType.DEV_SEC_OPS, response.properties().disabledFlowTypes().get(0)); + Assertions.assertEquals(DataClass.SERVICE_BUS, response.properties().disabledDataClass().get(0)); + Assertions.assertEquals("grbjbxsjybvitvqk", response.properties().quarantineDownloadStorageAccount()); + Assertions.assertEquals("az", response.properties().quarantineDownloadStorageContainer()); + Assertions.assertEquals(PipelineStatus.ENABLED, response.properties().status()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesExecuteActionMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesExecuteActionMockTests.java new file mode 100644 index 0000000000000..031d45cbb50ee --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesExecuteActionMockTests.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.Action; +import com.azure.resourcemanager.datatransfer.models.DataClass; +import com.azure.resourcemanager.datatransfer.models.DateTransferActionType; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.Pipeline; +import com.azure.resourcemanager.datatransfer.models.PipelineStatus; +import com.azure.resourcemanager.datatransfer.models.TargetType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PipelinesExecuteActionMockTests { + @Test + public void testExecuteAction() throws Exception { + String responseStr + = "{\"properties\":{\"remoteCloud\":\"yejylmbkzudnigrf\",\"displayName\":\"otjewlpxuzzjgnre\",\"connections\":[{\"id\":\"hqo\",\"name\":\"ihiqakydiw\",\"type\":\"rkwpzdqtvhcspod\",\"location\":\"axsipietgb\",\"etag\":\"jfulbmoic\",\"properties\":{\"internalMetadata\":{},\"iqsowsaaelc\":\"\\\"datapubntnbatz\\\"\",\"mjvlgfgg\":\"\\\"datattcjuhplrvkmjc\\\"\",\"sfuztlvtmv\":\"\\\"datavkyylizrzbjpsf\\\"\"},\"dqlvhukoveof\":\"\\\"dataw\\\"\",\"lkujrllfojui\":\"\\\"datazrvjfnmjmvlwyzgi\\\"\"},{\"id\":\"jpu\",\"name\":\"jucejikzoeovvtz\",\"type\":\"et\",\"location\":\"ln\",\"etag\":\"k\",\"properties\":{\"internalMetadata\":{},\"vhqjwtrhtgvg\":\"\\\"databqzolxr\\\"\",\"lawjmjsmwrok\":\"\\\"datapcrrk\\\"\",\"tlhguynuchl\":\"\\\"datadxfzzzwyjaf\\\"\",\"whmozusgzvlnsnnj\":\"\\\"datamltx\\\"\"},\"gdphtvdula\":\"\\\"dataafolpymwamxqzrag\\\"\",\"jchcsrlzknmzla\":\"\\\"datavl\\\"\"},{\"id\":\"rupdwvnphcnzq\",\"name\":\"jhmqrhvthla\",\"type\":\"dcxsmlz\",\"location\":\"zdtxetlgyd\",\"etag\":\"qvlnnpxybafiqgea\",\"properties\":{\"internalMetadata\":{},\"mzegjon\":\"\\\"datakglklbyulidwcw\\\"\",\"rwgdnqzbrfks\":\"\\\"datahj\\\"\"},\"digsxcdgl\":\"\\\"datazmtksjci\\\"\",\"wfpfmdgycx\":\"\\\"dataplkeuachtomflryt\\\"\"},{\"id\":\"mskwhqjjysl\",\"name\":\"lpshhkvpedwqslsr\",\"type\":\"pq\",\"location\":\"wskondcbrwimuvqe\",\"etag\":\"so\",\"properties\":{\"internalMetadata\":{},\"sinuqtljqobbpih\":\"\\\"dataa\\\"\",\"bbmpxdlvykfre\":\"\\\"datahcecybmrqbr\\\"\"},\"qwjksghudgz\":\"\\\"datas\\\"\",\"ggsvoujkxibdaf\":\"\\\"dataxog\\\"\",\"xfbvfb\":\"\\\"datarkmdyom\\\"\",\"rhpw\":\"\\\"datady\\\"\"}],\"subscribers\":[{\"email\":\"eimawzovgkkumui\",\"notifications\":2524872164950013977}],\"provisioningState\":\"Succeeded\",\"policies\":[\"bwsnsqow\"],\"flowTypes\":[\"Unknown\",\"BasicFiles\",\"Opaque\",\"API\"],\"disabledFlowTypes\":[\"Mission\",\"Messaging\",\"Standard\",\"Messaging\"],\"disabledDataClass\":[\"EventHub\",\"ServiceBus\",\"Video\"],\"quarantineDownloadStorageAccount\":\"cvejyfdvlvhbwrn\",\"quarantineDownloadStorageContainer\":\"tgddpqthehnmnaoy\",\"status\":\"Disabled\"},\"identity\":{\"principalId\":\"eqswanklty\",\"tenantId\":\"hdroznnh\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"wyw\":{\"principalId\":\"gjc\",\"clientId\":\"guxhem\"}}},\"location\":\"eczgfb\",\"tags\":{\"rlsmdesqplpvmjc\":\"lelssxblycsxzujk\",\"vteo\":\"oewbid\"},\"id\":\"xvgpiude\",\"name\":\"gfsxzec\",\"type\":\"axwk\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Pipeline response = manager.pipelines() + .executeAction("ubhvj", "lrocuyzlwh", + new Action().withActionType(DateTransferActionType.FORCE_DISABLE) + .withTargetType(TargetType.FLOW_TYPE) + .withTargets(Arrays.asList("ooclutnp", "memczjkmmyk")) + .withJustification("jxsglhsr"), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("eczgfb", response.location()); + Assertions.assertEquals("lelssxblycsxzujk", response.tags().get("rlsmdesqplpvmjc")); + Assertions.assertEquals("yejylmbkzudnigrf", response.properties().remoteCloud()); + Assertions.assertEquals("otjewlpxuzzjgnre", response.properties().displayName()); + Assertions.assertEquals("eimawzovgkkumui", response.properties().subscribers().get(0).email()); + Assertions.assertEquals(2524872164950013977L, response.properties().subscribers().get(0).notifications()); + Assertions.assertEquals("bwsnsqow", response.properties().policies().get(0)); + Assertions.assertEquals(FlowType.UNKNOWN, response.properties().flowTypes().get(0)); + Assertions.assertEquals(FlowType.MISSION, response.properties().disabledFlowTypes().get(0)); + Assertions.assertEquals(DataClass.EVENT_HUB, response.properties().disabledDataClass().get(0)); + Assertions.assertEquals("cvejyfdvlvhbwrn", response.properties().quarantineDownloadStorageAccount()); + Assertions.assertEquals("tgddpqthehnmnaoy", response.properties().quarantineDownloadStorageContainer()); + Assertions.assertEquals(PipelineStatus.DISABLED, response.properties().status()); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.identity().type()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesGetByResourceGroupWithResponseMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesGetByResourceGroupWithResponseMockTests.java new file mode 100644 index 0000000000000..3359c4b561eb5 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesGetByResourceGroupWithResponseMockTests.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.DataClass; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.Pipeline; +import com.azure.resourcemanager.datatransfer.models.PipelineStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PipelinesGetByResourceGroupWithResponseMockTests { + @Test + public void testGetByResourceGroupWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"remoteCloud\":\"ofrzgb\",\"displayName\":\"edm\",\"connections\":[{\"id\":\"vnlvxbcuiiznktwf\",\"name\":\"snvpdibmi\",\"type\":\"stbz\",\"location\":\"iwbuqny\",\"etag\":\"hzfylsgcrpfbc\",\"properties\":{\"internalMetadata\":{},\"elfwy\":\"\\\"datae\\\"\"},\"wetnpsihc\":\"\\\"datawx\\\"\",\"qwztcmwqkc\":\"\\\"dataafzvaylptrs\\\"\"},{\"id\":\"cxwaxfewz\",\"name\":\"jexfdeqvhp\",\"type\":\"lkkshkbffmbmx\",\"location\":\"rgywwp\",\"etag\":\"xs\",\"properties\":{\"internalMetadata\":{},\"tdewemxswvruu\":\"\\\"datagicgaaoepttaq\\\"\",\"rtixokff\":\"\\\"datazzjgehkfki\\\"\"},\"shiy\":\"\\\"datanljqepqwhixmons\\\"\",\"du\":\"\\\"datagvelfc\\\"\",\"rds\":\"\\\"datacb\\\"\",\"b\":\"\\\"datauwc\\\"\"},{\"id\":\"egstmninwjizci\",\"name\":\"ghgshejjtbxqmu\",\"type\":\"xlxqzvn\",\"location\":\"sbycucrwnamikz\",\"etag\":\"rqbsmswziq\",\"properties\":{\"internalMetadata\":{},\"hczznvf\":\"\\\"datazruswh\\\"\",\"wwixzvumw\":\"\\\"dataycjsx\\\"\"},\"djh\":\"\\\"datahndvnoamldsehao\\\"\",\"pelnjetag\":\"\\\"dataflzokxco\\\"\",\"npbs\":\"\\\"datatsxoatftgz\\\"\"},{\"id\":\"vefloccsrmozihmi\",\"name\":\"awtxxpk\",\"type\":\"cxcjxgry\",\"location\":\"mpcycilrmcaykgg\",\"etag\":\"xu\",\"properties\":{\"internalMetadata\":{},\"d\":\"\\\"datawp\\\"\",\"srxuzvoam\":\"\\\"datacpfnznthjtwkja\\\"\",\"zah\":\"\\\"datatcqiosmg\\\"\"},\"rtltla\":\"\\\"datadl\\\"\",\"nbsoqeqalarv\":\"\\\"datarltzkatbhjmz\\\"\"}],\"subscribers\":[{\"email\":\"nbtgfebwl\",\"notifications\":434990106020614048},{\"email\":\"reeudzqavb\",\"notifications\":8831511636690175836},{\"email\":\"xlyyzglgou\",\"notifications\":7389766894389519511},{\"email\":\"jyuojqtobaxkjeyt\",\"notifications\":7103604818912185763}],\"provisioningState\":\"Canceled\",\"policies\":[\"rusnk\"],\"flowTypes\":[\"Messaging\",\"BasicFiles\"],\"disabledFlowTypes\":[\"BasicFiles\",\"Unknown\"],\"disabledDataClass\":[\"ServiceBus\"],\"quarantineDownloadStorageAccount\":\"enx\",\"quarantineDownloadStorageContainer\":\"l\",\"status\":\"Disabled\"},\"identity\":{\"principalId\":\"kifmjn\",\"tenantId\":\"wtqabpxuckp\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"xiw\":{\"principalId\":\"eyirdhlisngw\",\"clientId\":\"qqmpizruwnpqx\"},\"sdp\":{\"principalId\":\"ngjsaasi\",\"clientId\":\"tmkzjvkviirhgfgr\"},\"tctbrxkjzwrgxffm\":{\"principalId\":\"atzv\",\"clientId\":\"glbyvi\"}}},\"location\":\"kwfbkgo\",\"tags\":{\"napxbiygnug\":\"opdbydpizqac\",\"lq\":\"knfsmfcttuxuuyil\",\"njhvsujztc\":\"iquvrehm\"},\"id\":\"ytqj\",\"name\":\"w\",\"type\":\"auunfprnjletlx\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Pipeline response = manager.pipelines() + .getByResourceGroupWithResponse("zgakgacyrcmj", "mspofapvuhryl", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("kwfbkgo", response.location()); + Assertions.assertEquals("opdbydpizqac", response.tags().get("napxbiygnug")); + Assertions.assertEquals("ofrzgb", response.properties().remoteCloud()); + Assertions.assertEquals("edm", response.properties().displayName()); + Assertions.assertEquals("nbtgfebwl", response.properties().subscribers().get(0).email()); + Assertions.assertEquals(434990106020614048L, response.properties().subscribers().get(0).notifications()); + Assertions.assertEquals("rusnk", response.properties().policies().get(0)); + Assertions.assertEquals(FlowType.MESSAGING, response.properties().flowTypes().get(0)); + Assertions.assertEquals(FlowType.BASIC_FILES, response.properties().disabledFlowTypes().get(0)); + Assertions.assertEquals(DataClass.SERVICE_BUS, response.properties().disabledDataClass().get(0)); + Assertions.assertEquals("enx", response.properties().quarantineDownloadStorageAccount()); + Assertions.assertEquals("l", response.properties().quarantineDownloadStorageContainer()); + Assertions.assertEquals(PipelineStatus.DISABLED, response.properties().status()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, response.identity().type()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListByResourceGroupMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListByResourceGroupMockTests.java new file mode 100644 index 0000000000000..04c1cd721eba0 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListByResourceGroupMockTests.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.DataClass; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.Pipeline; +import com.azure.resourcemanager.datatransfer.models.PipelineStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PipelinesListByResourceGroupMockTests { + @Test + public void testListByResourceGroup() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"remoteCloud\":\"yogtieyujtvczkcn\",\"displayName\":\"rxmunjdxvgln\",\"connections\":[{\"id\":\"lxpaglqivbgkcv\",\"name\":\"pzvuqdflvo\",\"type\":\"yp\",\"location\":\"ubcpzgpxti\",\"etag\":\"j\",\"properties\":{\"internalMetadata\":{},\"kqmhhaowjr\":\"\\\"datagqjxgpnrhgovfgp\\\"\",\"kfvxcnq\":\"\\\"datazvuporqzdfuydz\\\"\",\"vkhlggdhbemz\":\"\\\"dataxqpswok\\\"\"},\"wiwtglxxhl\":\"\\\"datasz\\\"\",\"gjsxv\":\"\\\"datafpgpicrmnzhrgm\\\"\",\"qgvriibakcla\":\"\\\"dataqcbfrmbodths\\\"\"}],\"subscribers\":[{\"email\":\"nxo\",\"notifications\":9034313658501892955}],\"provisioningState\":\"Accepted\",\"policies\":[\"vsg\",\"wohqfzizvu\",\"mmkjsvthnwpztek\",\"vmribiat\"],\"flowTypes\":[\"StreamingVideo\",\"StreamingVideo\",\"Opaque\",\"DiskImages\"],\"disabledFlowTypes\":[\"API\",\"DiskImages\",\"API\",\"Standard\"],\"disabledDataClass\":[\"ServiceBus\",\"Blob\"],\"quarantineDownloadStorageAccount\":\"zcugswvxwlmzqw\",\"quarantineDownloadStorageContainer\":\"tx\",\"status\":\"Disabled\"},\"identity\":{\"principalId\":\"cuqudtcvclxy\",\"tenantId\":\"dkvgfabuiyjibuzp\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"qw\":{\"principalId\":\"eiknpgo\",\"clientId\":\"jiuqhibtozi\"},\"lkm\":{\"principalId\":\"d\",\"clientId\":\"rrxxgewpktvq\"}}},\"location\":\"zoyhlfbcgwg\",\"tags\":{\"qinjipnwjf\":\"xoe\",\"foiyjwpfilk\":\"jqlafcbahhpzp\"},\"id\":\"kkholvdndvia\",\"name\":\"ogphuartvtiu\",\"type\":\"yefchnm\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.pipelines().listByResourceGroup("df", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("zoyhlfbcgwg", response.iterator().next().location()); + Assertions.assertEquals("xoe", response.iterator().next().tags().get("qinjipnwjf")); + Assertions.assertEquals("yogtieyujtvczkcn", response.iterator().next().properties().remoteCloud()); + Assertions.assertEquals("rxmunjdxvgln", response.iterator().next().properties().displayName()); + Assertions.assertEquals("nxo", response.iterator().next().properties().subscribers().get(0).email()); + Assertions.assertEquals(9034313658501892955L, + response.iterator().next().properties().subscribers().get(0).notifications()); + Assertions.assertEquals("vsg", response.iterator().next().properties().policies().get(0)); + Assertions.assertEquals(FlowType.STREAMING_VIDEO, response.iterator().next().properties().flowTypes().get(0)); + Assertions.assertEquals(FlowType.API, response.iterator().next().properties().disabledFlowTypes().get(0)); + Assertions.assertEquals(DataClass.SERVICE_BUS, + response.iterator().next().properties().disabledDataClass().get(0)); + Assertions.assertEquals("zcugswvxwlmzqw", + response.iterator().next().properties().quarantineDownloadStorageAccount()); + Assertions.assertEquals("tx", response.iterator().next().properties().quarantineDownloadStorageContainer()); + Assertions.assertEquals(PipelineStatus.DISABLED, response.iterator().next().properties().status()); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListBySubscriptionMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListBySubscriptionMockTests.java new file mode 100644 index 0000000000000..33e69d3628b41 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListBySubscriptionMockTests.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.DataClass; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.Pipeline; +import com.azure.resourcemanager.datatransfer.models.PipelineStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PipelinesListBySubscriptionMockTests { + @Test + public void testListBySubscription() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"remoteCloud\":\"hmnxhkxjqi\",\"displayName\":\"rweooxffifhx\",\"connections\":[{\"id\":\"newmozqvb\",\"name\":\"qmamhsycxhxzga\",\"type\":\"taboidvmf\",\"location\":\"ppu\",\"etag\":\"w\",\"properties\":{\"internalMetadata\":{},\"gb\":\"\\\"datakmtdher\\\"\"},\"obkauxofsh\":\"\\\"datauahokq\\\"\",\"whslwkoj\":\"\\\"dataphwpnulaiywzej\\\"\",\"rpqaf\":\"\\\"datallndnpd\\\"\"},{\"id\":\"fugsnnfhyetefy\",\"name\":\"coc\",\"type\":\"jgtixr\",\"location\":\"zuyt\",\"etag\":\"mlmuowol\",\"properties\":{\"internalMetadata\":{},\"ons\":\"\\\"datap\\\"\",\"innixjawrtmjfj\":\"\\\"dataonwpnga\\\"\",\"vnekhenlusfnrdtj\":\"\\\"datayccxlzhcox\\\"\"},\"cq\":\"\\\"datar\\\"\",\"uslvyjtcvuwkasi\":\"\\\"datajvidttge\\\"\"},{\"id\":\"iesfuug\",\"name\":\"uqfecj\",\"type\":\"ygtuhx\",\"location\":\"cbuewmrswnjlxuz\",\"etag\":\"wpusxjbaqehg\",\"properties\":{\"internalMetadata\":{},\"wfepbnwgfmx\":\"\\\"dataqatucoigebxnc\\\"\",\"dlfgtdysnaq\":\"\\\"datagcgbjb\\\"\",\"ctqhamzjrwdk\":\"\\\"dataflq\\\"\",\"xdfzantkw\":\"\\\"datazeqyjleziun\\\"\"},\"ac\":\"\\\"datayamlbnse\\\"\",\"m\":\"\\\"datajvpilguooqja\\\"\",\"hrtdtpdelq\":\"\\\"dataitgueiookjbs\\\"\",\"vcjkgd\":\"\\\"datacslmotoebnfxo\\\"\"}],\"subscribers\":[{\"email\":\"f\",\"notifications\":5876258781351504960},{\"email\":\"ab\",\"notifications\":8316099328304132304},{\"email\":\"mvcopexcmjurbuhh\",\"notifications\":8606633803296294188},{\"email\":\"tqsrogtuwkff\",\"notifications\":7729705463242282877}],\"provisioningState\":\"Canceled\",\"policies\":[\"dfvclglxnfu\"],\"flowTypes\":[\"MicrosoftInternal\"],\"disabledFlowTypes\":[\"Mission\",\"BasicFiles\",\"Mission\",\"DiskImages\"],\"disabledDataClass\":[\"Table\",\"Video\",\"Blob\",\"ApiSDK\"],\"quarantineDownloadStorageAccount\":\"ansharujtjiqxfz\",\"quarantineDownloadStorageContainer\":\"qttv\",\"status\":\"Disabled\"},\"identity\":{\"principalId\":\"j\",\"tenantId\":\"nuygbqeqqekewvnq\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"jqi\":{\"principalId\":\"uaucmf\",\"clientId\":\"wnlaxpu\"},\"hlwntsjgq\":{\"principalId\":\"zvvitacgxmfcs\",\"clientId\":\"rxhtvso\"}}},\"location\":\"xypruuuy\",\"tags\":{\"oyuelyetn\":\"hrszi\",\"qyggagfl\":\"nb\"},\"id\":\"lgmtrwahzjmucf\",\"name\":\"byrplrohkpig\",\"type\":\"fusuckzmkwklsno\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.pipelines().listBySubscription(com.azure.core.util.Context.NONE); + + Assertions.assertEquals("xypruuuy", response.iterator().next().location()); + Assertions.assertEquals("hrszi", response.iterator().next().tags().get("oyuelyetn")); + Assertions.assertEquals("hmnxhkxjqi", response.iterator().next().properties().remoteCloud()); + Assertions.assertEquals("rweooxffifhx", response.iterator().next().properties().displayName()); + Assertions.assertEquals("f", response.iterator().next().properties().subscribers().get(0).email()); + Assertions.assertEquals(5876258781351504960L, + response.iterator().next().properties().subscribers().get(0).notifications()); + Assertions.assertEquals("dfvclglxnfu", response.iterator().next().properties().policies().get(0)); + Assertions.assertEquals(FlowType.MICROSOFT_INTERNAL, + response.iterator().next().properties().flowTypes().get(0)); + Assertions.assertEquals(FlowType.MISSION, response.iterator().next().properties().disabledFlowTypes().get(0)); + Assertions.assertEquals(DataClass.TABLE, response.iterator().next().properties().disabledDataClass().get(0)); + Assertions.assertEquals("ansharujtjiqxfz", + response.iterator().next().properties().quarantineDownloadStorageAccount()); + Assertions.assertEquals("qttv", response.iterator().next().properties().quarantineDownloadStorageContainer()); + Assertions.assertEquals(PipelineStatus.DISABLED, response.iterator().next().properties().status()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, + response.iterator().next().identity().type()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListSchemasListWithResponseMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListSchemasListWithResponseMockTests.java new file mode 100644 index 0000000000000..0ebd9377d168e --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListSchemasListWithResponseMockTests.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.Direction; +import com.azure.resourcemanager.datatransfer.models.Schema; +import com.azure.resourcemanager.datatransfer.models.SchemaStatus; +import com.azure.resourcemanager.datatransfer.models.SchemaType; +import com.azure.resourcemanager.datatransfer.models.SchemasListResult; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PipelinesListSchemasListWithResponseMockTests { + @Test + public void testListSchemasListWithResponse() throws Exception { + String responseStr + = "{\"value\":[{\"id\":\"gdhg\",\"connectionId\":\"i\",\"status\":\"Approved\",\"name\":\"iwrqofulopmjnl\",\"content\":\"whc\",\"direction\":\"Receive\",\"schemaUri\":\"bke\",\"schemaType\":\"Xsd\"},{\"id\":\"uerct\",\"connectionId\":\"oyin\",\"status\":\"Approved\",\"name\":\"rlcyrduc\",\"content\":\"go\",\"direction\":\"Send\",\"schemaUri\":\"srucvcrrpcjtt\",\"schemaType\":\"Xsd\"},{\"id\":\"jeaq\",\"connectionId\":\"mvvfko\",\"status\":\"Approved\",\"name\":\"hktuidvrma\",\"content\":\"pdwwexymzvlazi\",\"direction\":\"Receive\",\"schemaUri\":\"wvqsgny\",\"schemaType\":\"Zip\"},{\"id\":\"ivensrpmeyyvpk\",\"connectionId\":\"tlbijpzg\",\"status\":\"New\",\"name\":\"fhfv\",\"content\":\"mknbnxwcdommpv\",\"direction\":\"Send\",\"schemaUri\":\"zfgbrttuiaclkie\",\"schemaType\":\"Zip\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + SchemasListResult response = manager.pipelines() + .listSchemasListWithResponse("yvk", "kmrocxne", + new Schema().withId("sm") + .withConnectionId("dlfp") + .withStatus(SchemaStatus.APPROVED) + .withName("cygvoavyunssx") + .withContent("hi") + .withDirection(Direction.RECEIVE) + .withSchemaUri("lgvvpaseksgbu") + .withSchemaType(SchemaType.ZIP), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("gdhg", response.value().get(0).id()); + Assertions.assertEquals("i", response.value().get(0).connectionId()); + Assertions.assertEquals(SchemaStatus.APPROVED, response.value().get(0).status()); + Assertions.assertEquals("iwrqofulopmjnl", response.value().get(0).name()); + Assertions.assertEquals("whc", response.value().get(0).content()); + Assertions.assertEquals(Direction.RECEIVE, response.value().get(0).direction()); + Assertions.assertEquals("bke", response.value().get(0).schemaUri()); + Assertions.assertEquals(SchemaType.XSD, response.value().get(0).schemaType()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListWithResponseMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListWithResponseMockTests.java new file mode 100644 index 0000000000000..070cda6b98a80 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesListWithResponseMockTests.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.ConnectionIdList; +import com.azure.resourcemanager.datatransfer.models.ListFlowsByPipelineResult; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PipelinesListWithResponseMockTests { + @Test + public void testListWithResponse() throws Exception { + String responseStr + = "{\"value\":[{\"id\":\"cfxhikkflrmy\",\"flows\":[{\"properties\":{},\"plan\":{\"name\":\"qlhris\",\"publisher\":\"sl\",\"product\":\"iiiovgqcgxuugq\"},\"identity\":{\"type\":\"SystemAssigned,UserAssigned\"},\"location\":\"tiowlx\",\"tags\":{\"wphqlkccuzgygqw\":\"dptjgwdtgukranb\"},\"id\":\"hoi\",\"name\":\"lwgniiprglvawu\",\"type\":\"z\"},{\"properties\":{},\"plan\":{\"name\":\"ypivlsbb\",\"publisher\":\"pmcubkmifoxxkub\",\"product\":\"phavpmhbrb\"},\"identity\":{\"type\":\"SystemAssigned,UserAssigned\"},\"location\":\"ovpbbttefjoknssq\",\"tags\":{\"rjgeih\":\"edikdfrdbiq\",\"zcxmjpbyep\":\"qlggwfi\",\"rc\":\"mgtvlj\"},\"id\":\"yfqi\",\"name\":\"gxhnpomyqwcabv\",\"type\":\"ui\"},{\"properties\":{},\"plan\":{\"name\":\"yaswlpaugmr\",\"publisher\":\"fjlrxwtoauk\",\"product\":\"fkvcisi\"},\"identity\":{\"type\":\"SystemAssigned,UserAssigned\"},\"location\":\"eds\",\"tags\":{\"psmgo\":\"uivedwcgyeewxeiq\",\"l\":\"guamlj\"},\"id\":\"gmsplzgaufcshhv\",\"name\":\"ewgnxkympqanxrj\",\"type\":\"ixt\"}]},{\"id\":\"taoypnyghshxc\",\"flows\":[{\"properties\":{},\"plan\":{\"name\":\"mnsghpxycphdr\",\"publisher\":\"jjkhvyomaclu\",\"product\":\"vxnqmhrpqpd\"},\"identity\":{\"type\":\"UserAssigned\"},\"location\":\"oi\",\"tags\":{\"ypobkdqzr\":\"ssffxuifmc\"},\"id\":\"zsylollgt\",\"name\":\"czzydmxzjij\",\"type\":\"vuaurk\"},{\"properties\":{},\"plan\":{\"name\":\"irldefxr\",\"publisher\":\"c\",\"product\":\"xnbkkj\"},\"identity\":{\"type\":\"UserAssigned\"},\"location\":\"nnqbnqbp\",\"tags\":{\"gypxrxvbfihwuhvc\":\"qltgrd\",\"s\":\"a\"},\"id\":\"bxrblmliowxihspn\",\"name\":\"wqagnepzwa\",\"type\":\"lsbs\"}]},{\"id\":\"qqagwwr\",\"flows\":[{\"properties\":{},\"plan\":{\"name\":\"isglrrc\",\"publisher\":\"ezkhhltnjadhqo\",\"product\":\"wjqo\"},\"identity\":{\"type\":\"UserAssigned\"},\"location\":\"yfbpcmsplb\",\"tags\":{\"hwmgnmbscbbxig\":\"ueq\",\"dpyqyybxubmd\":\"hxiidlopedb\"},\"id\":\"afcbqw\",\"name\":\"e\",\"type\":\"jelaqacigele\"},{\"properties\":{},\"plan\":{\"name\":\"bvqvwzkjopwbeo\",\"publisher\":\"r\",\"product\":\"kwzdqybxcea\"},\"identity\":{\"type\":\"UserAssigned\"},\"location\":\"tsoqfyiaseqchk\",\"tags\":{\"uem\":\"zrazisgyk\",\"klinhmdptysprq\":\"anbwzohmnrxxbso\",\"pli\":\"gnzxojpslsvj\"},\"id\":\"fiqwoy\",\"name\":\"qvapcohhoucq\",\"type\":\"q\"},{\"properties\":{},\"plan\":{\"name\":\"cxzrzdcgdzben\",\"publisher\":\"ibcawetzqddtjw\",\"product\":\"ljhznamtuatmzwcj\"},\"identity\":{\"type\":\"SystemAssigned\"},\"location\":\"tjzmi\",\"tags\":{\"vbxngr\":\"bgatzu\",\"lswva\":\"bwggahtt\",\"zasunwqrjzfrgq\":\"qfutlxjo\"},\"id\":\"aohcmbuocn\",\"name\":\"r\",\"type\":\"hmbpyryxamebly\"}]}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ListFlowsByPipelineResult response = manager.pipelines() + .listWithResponse("fykhvuhxepmru", "znabaobns", + new ConnectionIdList().withValue(Arrays.asList("djltymkm", "guihywar", "spphk", "xkykxdssjp")), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("cfxhikkflrmy", response.value().get(0).id()); + Assertions.assertEquals("tiowlx", response.value().get(0).flows().get(0).location()); + Assertions.assertEquals("dptjgwdtgukranb", + response.value().get(0).flows().get(0).tags().get("wphqlkccuzgygqw")); + Assertions.assertEquals("qlhris", response.value().get(0).flows().get(0).plan().name()); + Assertions.assertEquals("sl", response.value().get(0).flows().get(0).plan().publisher()); + Assertions.assertEquals("iiiovgqcgxuugq", response.value().get(0).flows().get(0).plan().product()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, + response.value().get(0).flows().get(0).identity().type()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesPatchPropertiesTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesPatchPropertiesTests.java new file mode 100644 index 0000000000000..573ef91c7c376 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesPatchPropertiesTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.PipelinesPatchProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class PipelinesPatchPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PipelinesPatchProperties model + = BinaryData.fromString("{\"flowTypes\":[\"Unknown\",\"BasicFiles\",\"Complex\",\"Messaging\"]}") + .toObject(PipelinesPatchProperties.class); + Assertions.assertEquals(FlowType.UNKNOWN, model.flowTypes().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PipelinesPatchProperties model = new PipelinesPatchProperties() + .withFlowTypes(Arrays.asList(FlowType.UNKNOWN, FlowType.BASIC_FILES, FlowType.COMPLEX, FlowType.MESSAGING)); + model = BinaryData.fromObject(model).toObject(PipelinesPatchProperties.class); + Assertions.assertEquals(FlowType.UNKNOWN, model.flowTypes().get(0)); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesPatchTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesPatchTests.java new file mode 100644 index 0000000000000..1df4fea90c7c6 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesPatchTests.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.PipelinesPatch; +import com.azure.resourcemanager.datatransfer.models.PipelinesPatchProperties; +import com.azure.resourcemanager.datatransfer.models.UserAssignedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class PipelinesPatchTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PipelinesPatch model = BinaryData.fromString( + "{\"properties\":{\"flowTypes\":[\"StreamingVideo\"]},\"tags\":{\"mcbxvwvxysl\":\"qtdo\",\"ytkblmpew\":\"bhsfxob\",\"shqjohxcrsbf\":\"wfbkrvrns\"},\"identity\":{\"principalId\":\"srruvwbhsqfsubcg\",\"tenantId\":\"irx\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"sotftpvj\":{\"principalId\":\"rfbjf\",\"clientId\":\"w\"},\"jhwqytjrybnw\":{\"principalId\":\"exilzznfqqnvwpmq\",\"clientId\":\"ruoujmk\"}}}}") + .toObject(PipelinesPatch.class); + Assertions.assertEquals(FlowType.STREAMING_VIDEO, model.properties().flowTypes().get(0)); + Assertions.assertEquals("qtdo", model.tags().get("mcbxvwvxysl")); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PipelinesPatch model = new PipelinesPatch() + .withProperties(new PipelinesPatchProperties().withFlowTypes(Arrays.asList(FlowType.STREAMING_VIDEO))) + .withTags(mapOf("mcbxvwvxysl", "qtdo", "ytkblmpew", "bhsfxob", "shqjohxcrsbf", "wfbkrvrns")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf("sotftpvj", new UserAssignedIdentity(), "jhwqytjrybnw", new UserAssignedIdentity()))); + model = BinaryData.fromObject(model).toObject(PipelinesPatch.class); + Assertions.assertEquals(FlowType.STREAMING_VIDEO, model.properties().flowTypes().get(0)); + Assertions.assertEquals("qtdo", model.tags().get("mcbxvwvxysl")); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesRejectConnectionMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesRejectConnectionMockTests.java new file mode 100644 index 0000000000000..7a60d9e74dc99 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesRejectConnectionMockTests.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.Connection; +import com.azure.resourcemanager.datatransfer.models.DataClassType; +import com.azure.resourcemanager.datatransfer.models.Direction; +import com.azure.resourcemanager.datatransfer.models.FlowProfileStatus; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.ResourceBody; +import com.azure.resourcemanager.datatransfer.models.SchemaStatus; +import com.azure.resourcemanager.datatransfer.models.SchemaType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PipelinesRejectConnectionMockTests { + @Test + public void testRejectConnection() throws Exception { + String responseStr + = "{\"properties\":{\"pipeline\":\"gh\",\"direction\":\"Send\",\"justification\":\"qtlffhzbk\",\"status\":\"Rejected\",\"forceDisabledStatus\":[\"FlowProfileForceDisabled\",\"FlowProfileForceDisabled\"],\"statusReason\":\"qnvhnqoe\",\"linkStatus\":\"Linked\",\"linkedConnectionId\":\"iyet\",\"flowTypes\":[\"Opaque\",\"MissionOpaqueXML\"],\"flowProfileList\":[{\"pipeline\":\"bztjhqtfbovnynkb\",\"name\":\"etnjuhpsprkz\",\"replicationScenario\":\"Messaging\",\"flowProfileId\":\"upia\",\"status\":\"Enabled\",\"description\":\"xnafbw\"},{\"pipeline\":\"ro\",\"name\":\"htuov\",\"replicationScenario\":\"Stream\",\"flowProfileId\":\"onurjtumghihpv\",\"status\":\"Enabled\",\"description\":\"mslclblyjxlt\"},{\"pipeline\":\"sjuscvsfxigctmg\",\"name\":\"uupb\",\"replicationScenario\":\"Stream\",\"flowProfileId\":\"qccydrtceukdq\",\"status\":\"Obsolete\",\"description\":\"yihztgeqmg\"}],\"requirementId\":\"gwldo\",\"remoteSubscriptionId\":\"hillce\",\"approver\":\"ehuwaoa\",\"pin\":\"h\",\"dateSubmitted\":\"2021-01-29T13:01:32Z\",\"primaryContact\":\"lizst\",\"secondaryContacts\":[\"jvhrweft\"],\"provisioningState\":\"Succeeded\",\"policies\":[\"pmvssehaep\"],\"schemas\":[{\"id\":\"xtczhupeuknijd\",\"connectionId\":\"yespydjfbocyv\",\"status\":\"Approved\",\"name\":\"rtywi\",\"content\":\"mhlaku\",\"direction\":\"Send\",\"schemaUri\":\"hgauacdixmxufrs\",\"schemaType\":\"Zip\"},{\"id\":\"gdkfnoz\",\"connectionId\":\"oqbvjhvefgwbmqj\",\"status\":\"Approved\",\"name\":\"asfaymxbulpze\",\"content\":\"b\",\"direction\":\"Receive\",\"schemaUri\":\"ojwyvf\",\"schemaType\":\"Xsd\"}],\"schemaUris\":[\"uahxs\"],\"apiHostname\":\"jcmmzrrscub\"},\"identity\":{\"principalId\":\"drnpxqwodiff\",\"tenantId\":\"cjrmmua\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"fkak\":{\"principalId\":\"jogjonmc\",\"clientId\":\"foyzbamwineof\"}}},\"location\":\"ldtve\",\"tags\":{\"hzjkn\":\"cl\",\"pzaamrdixtreki\":\"uxgvttxpnr\"},\"id\":\"swyskbruffg\",\"name\":\"lukkutvlxhrpqhvm\",\"type\":\"lcouqehbhbcdszir\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Connection response = manager.pipelines() + .rejectConnection("jlfnthiq", "yuttdiygbpvnwswm", + new ResourceBody().withId("xkyctwwgzwx").withStatusReason("mecvogygzyvneeza"), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("ldtve", response.location()); + Assertions.assertEquals("cl", response.tags().get("hzjkn")); + Assertions.assertEquals("gh", response.properties().pipeline()); + Assertions.assertEquals(Direction.SEND, response.properties().direction()); + Assertions.assertEquals("qtlffhzbk", response.properties().justification()); + Assertions.assertEquals(FlowType.OPAQUE, response.properties().flowTypes().get(0)); + Assertions.assertEquals("bztjhqtfbovnynkb", response.properties().flowProfileList().get(0).pipeline()); + Assertions.assertEquals("etnjuhpsprkz", response.properties().flowProfileList().get(0).name()); + Assertions.assertEquals(DataClassType.MESSAGING, + response.properties().flowProfileList().get(0).replicationScenario()); + Assertions.assertEquals("upia", response.properties().flowProfileList().get(0).flowProfileId()); + Assertions.assertEquals(FlowProfileStatus.ENABLED, response.properties().flowProfileList().get(0).status()); + Assertions.assertEquals("xnafbw", response.properties().flowProfileList().get(0).description()); + Assertions.assertEquals("gwldo", response.properties().requirementId()); + Assertions.assertEquals("hillce", response.properties().remoteSubscriptionId()); + Assertions.assertEquals("h", response.properties().pin()); + Assertions.assertEquals("lizst", response.properties().primaryContact()); + Assertions.assertEquals("jvhrweft", response.properties().secondaryContacts().get(0)); + Assertions.assertEquals("pmvssehaep", response.properties().policies().get(0)); + Assertions.assertEquals("xtczhupeuknijd", response.properties().schemas().get(0).id()); + Assertions.assertEquals("yespydjfbocyv", response.properties().schemas().get(0).connectionId()); + Assertions.assertEquals(SchemaStatus.APPROVED, response.properties().schemas().get(0).status()); + Assertions.assertEquals("rtywi", response.properties().schemas().get(0).name()); + Assertions.assertEquals("mhlaku", response.properties().schemas().get(0).content()); + Assertions.assertEquals(Direction.SEND, response.properties().schemas().get(0).direction()); + Assertions.assertEquals("hgauacdixmxufrs", response.properties().schemas().get(0).schemaUri()); + Assertions.assertEquals(SchemaType.ZIP, response.properties().schemas().get(0).schemaType()); + Assertions.assertEquals("uahxs", response.properties().schemaUris().get(0)); + Assertions.assertEquals("jcmmzrrscub", response.properties().apiHostname()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesUpdateMockTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesUpdateMockTests.java new file mode 100644 index 0000000000000..7ea46d1317d9b --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/PipelinesUpdateMockTests.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.datatransfer.DataTransferManager; +import com.azure.resourcemanager.datatransfer.models.FlowType; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.datatransfer.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datatransfer.models.PipelinesPatch; +import com.azure.resourcemanager.datatransfer.models.PipelinesPatchProperties; +import com.azure.resourcemanager.datatransfer.models.UserAssignedIdentity; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PipelinesUpdateMockTests { + @Test + public void testUpdate() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DataTransferManager manager = DataTransferManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.pipelines() + .update("mr", "ddoui", + new PipelinesPatch() + .withProperties(new PipelinesPatchProperties().withFlowTypes(Arrays.asList(FlowType.MISSION))) + .withTags(mapOf("zdvpiw", "iynknlq")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("kyjpmspbps", new UserAssignedIdentity()))), + com.azure.core.util.Context.NONE); + + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ReadPipelineConnectionTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ReadPipelineConnectionTests.java new file mode 100644 index 0000000000000..55eb4feb336be --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ReadPipelineConnectionTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.ReadPipelineConnection; +import org.junit.jupiter.api.Assertions; + +public final class ReadPipelineConnectionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ReadPipelineConnection model = BinaryData.fromString( + "{\"id\":\"xobbcswsrt\",\"name\":\"iplrbpbewtghfgb\",\"type\":\"gw\",\"location\":\"vlvqhjkbegi\",\"etag\":\"nmxiebwwaloayqc\",\"properties\":{\"internalMetadata\":{\"operationStatus\":{\"status\":\"Succeeded\",\"id\":\"gwyzm\",\"message\":\"xongmtsavjcbpwxq\"},\"statusSetBy\":\"rknftguvriuhprwm\",\"qbex\":\"\\\"dataxqtayriwwro\\\"\",\"nmefqsgzvahapj\":\"\\\"datamcqibycnojv\\\"\",\"zlmwlxkvugfhz\":\"\\\"datazhpvgqzcjrvxd\\\"\",\"hnnpr\":\"\\\"datavawjvzunlu\\\"\"},\"tskzbbtdzumveek\":\"\\\"datapeilpjzuaejxdu\\\"\"},\"sjyofdx\":\"\\\"dataozuhkfp\\\"\",\"oekqvk\":\"\\\"datauusdttouwa\\\"\"}") + .toObject(ReadPipelineConnection.class); + Assertions.assertEquals("xobbcswsrt", model.id()); + Assertions.assertEquals("iplrbpbewtghfgb", model.name()); + Assertions.assertEquals("gw", model.type()); + Assertions.assertEquals("vlvqhjkbegi", model.location()); + Assertions.assertEquals("nmxiebwwaloayqc", model.etag()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/RemoteEndpointSettingsTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/RemoteEndpointSettingsTests.java new file mode 100644 index 0000000000000..385346514aed5 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/RemoteEndpointSettingsTests.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.Authentication; +import com.azure.resourcemanager.datatransfer.models.AuthenticationType; +import com.azure.resourcemanager.datatransfer.models.IdentityTranslation; +import com.azure.resourcemanager.datatransfer.models.RemoteEndpointSettings; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class RemoteEndpointSettingsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RemoteEndpointSettings model = BinaryData.fromString( + "{\"endpoint\":\"uaibrebqaaysj\",\"authentication\":[{\"type\":\"None\",\"instance\":\"qttezlwfffiakpjp\",\"tenantId\":\"m\",\"authority\":\"d\",\"applicationIds\":[\"mjihyeozphv\"],\"audience\":\"uyqncygupkvipmd\",\"clientIdOverride\":\"wx\",\"identityTranslation\":\"UserIdentity\"},{\"type\":\"None\",\"instance\":\"hfstotxhojujbyp\",\"tenantId\":\"mc\",\"authority\":\"hixbjxyfwnyl\",\"applicationIds\":[\"o\"],\"audience\":\"ttpkiwkkbnujrywv\",\"clientIdOverride\":\"lbfpncurd\",\"identityTranslation\":\"ServiceIdentity\"}]}") + .toObject(RemoteEndpointSettings.class); + Assertions.assertEquals("uaibrebqaaysj", model.endpoint()); + Assertions.assertEquals(AuthenticationType.NONE, model.authentication().get(0).type()); + Assertions.assertEquals("qttezlwfffiakpjp", model.authentication().get(0).instance()); + Assertions.assertEquals("m", model.authentication().get(0).tenantId()); + Assertions.assertEquals("d", model.authentication().get(0).authority()); + Assertions.assertEquals("mjihyeozphv", model.authentication().get(0).applicationIds().get(0)); + Assertions.assertEquals("uyqncygupkvipmd", model.authentication().get(0).audience()); + Assertions.assertEquals("wx", model.authentication().get(0).clientIdOverride()); + Assertions.assertEquals(IdentityTranslation.USER_IDENTITY, model.authentication().get(0).identityTranslation()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RemoteEndpointSettings model = new RemoteEndpointSettings().withEndpoint("uaibrebqaaysj") + .withAuthentication(Arrays.asList( + new Authentication().withType(AuthenticationType.NONE) + .withInstance("qttezlwfffiakpjp") + .withTenantId("m") + .withAuthority("d") + .withApplicationIds(Arrays.asList("mjihyeozphv")) + .withAudience("uyqncygupkvipmd") + .withClientIdOverride("wx") + .withIdentityTranslation(IdentityTranslation.USER_IDENTITY), + new Authentication().withType(AuthenticationType.NONE) + .withInstance("hfstotxhojujbyp") + .withTenantId("mc") + .withAuthority("hixbjxyfwnyl") + .withApplicationIds(Arrays.asList("o")) + .withAudience("ttpkiwkkbnujrywv") + .withClientIdOverride("lbfpncurd") + .withIdentityTranslation(IdentityTranslation.SERVICE_IDENTITY))); + model = BinaryData.fromObject(model).toObject(RemoteEndpointSettings.class); + Assertions.assertEquals("uaibrebqaaysj", model.endpoint()); + Assertions.assertEquals(AuthenticationType.NONE, model.authentication().get(0).type()); + Assertions.assertEquals("qttezlwfffiakpjp", model.authentication().get(0).instance()); + Assertions.assertEquals("m", model.authentication().get(0).tenantId()); + Assertions.assertEquals("d", model.authentication().get(0).authority()); + Assertions.assertEquals("mjihyeozphv", model.authentication().get(0).applicationIds().get(0)); + Assertions.assertEquals("uyqncygupkvipmd", model.authentication().get(0).audience()); + Assertions.assertEquals("wx", model.authentication().get(0).clientIdOverride()); + Assertions.assertEquals(IdentityTranslation.USER_IDENTITY, model.authentication().get(0).identityTranslation()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ResourceBodyTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ResourceBodyTests.java new file mode 100644 index 0000000000000..090e985ef72c0 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ResourceBodyTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.ResourceBody; +import org.junit.jupiter.api.Assertions; + +public final class ResourceBodyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceBody model = BinaryData.fromString("{\"id\":\"eqidbqfatpx\",\"statusReason\":\"rxcyjmoad\"}") + .toObject(ResourceBody.class); + Assertions.assertEquals("eqidbqfatpx", model.id()); + Assertions.assertEquals("rxcyjmoad", model.statusReason()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ResourceBody model = new ResourceBody().withId("eqidbqfatpx").withStatusReason("rxcyjmoad"); + model = BinaryData.fromObject(model).toObject(ResourceBody.class); + Assertions.assertEquals("eqidbqfatpx", model.id()); + Assertions.assertEquals("rxcyjmoad", model.statusReason()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SchemaTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SchemaTests.java new file mode 100644 index 0000000000000..49cb81cc1fcce --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SchemaTests.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.Direction; +import com.azure.resourcemanager.datatransfer.models.Schema; +import com.azure.resourcemanager.datatransfer.models.SchemaStatus; +import com.azure.resourcemanager.datatransfer.models.SchemaType; +import org.junit.jupiter.api.Assertions; + +public final class SchemaTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Schema model = BinaryData.fromString( + "{\"id\":\"klff\",\"connectionId\":\"ouw\",\"status\":\"New\",\"name\":\"rfzeey\",\"content\":\"izikayuhq\",\"direction\":\"Send\",\"schemaUri\":\"sybbqwr\",\"schemaType\":\"Zip\"}") + .toObject(Schema.class); + Assertions.assertEquals("klff", model.id()); + Assertions.assertEquals("ouw", model.connectionId()); + Assertions.assertEquals(SchemaStatus.NEW, model.status()); + Assertions.assertEquals("rfzeey", model.name()); + Assertions.assertEquals("izikayuhq", model.content()); + Assertions.assertEquals(Direction.SEND, model.direction()); + Assertions.assertEquals("sybbqwr", model.schemaUri()); + Assertions.assertEquals(SchemaType.ZIP, model.schemaType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Schema model = new Schema().withId("klff") + .withConnectionId("ouw") + .withStatus(SchemaStatus.NEW) + .withName("rfzeey") + .withContent("izikayuhq") + .withDirection(Direction.SEND) + .withSchemaUri("sybbqwr") + .withSchemaType(SchemaType.ZIP); + model = BinaryData.fromObject(model).toObject(Schema.class); + Assertions.assertEquals("klff", model.id()); + Assertions.assertEquals("ouw", model.connectionId()); + Assertions.assertEquals(SchemaStatus.NEW, model.status()); + Assertions.assertEquals("rfzeey", model.name()); + Assertions.assertEquals("izikayuhq", model.content()); + Assertions.assertEquals(Direction.SEND, model.direction()); + Assertions.assertEquals("sybbqwr", model.schemaUri()); + Assertions.assertEquals(SchemaType.ZIP, model.schemaType()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SchemasListResultInnerTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SchemasListResultInnerTests.java new file mode 100644 index 0000000000000..07ff710ec6cce --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SchemasListResultInnerTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.fluent.models.SchemasListResultInner; +import com.azure.resourcemanager.datatransfer.models.Direction; +import com.azure.resourcemanager.datatransfer.models.SchemaStatus; +import com.azure.resourcemanager.datatransfer.models.SchemaType; +import org.junit.jupiter.api.Assertions; + +public final class SchemasListResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SchemasListResultInner model = BinaryData.fromString( + "{\"value\":[{\"id\":\"npirgnepttw\",\"connectionId\":\"sniffc\",\"status\":\"Approved\",\"name\":\"r\",\"content\":\"lpijnkrxfrd\",\"direction\":\"Send\",\"schemaUri\":\"atiz\",\"schemaType\":\"Zip\"}]}") + .toObject(SchemasListResultInner.class); + Assertions.assertEquals("npirgnepttw", model.value().get(0).id()); + Assertions.assertEquals("sniffc", model.value().get(0).connectionId()); + Assertions.assertEquals(SchemaStatus.APPROVED, model.value().get(0).status()); + Assertions.assertEquals("r", model.value().get(0).name()); + Assertions.assertEquals("lpijnkrxfrd", model.value().get(0).content()); + Assertions.assertEquals(Direction.SEND, model.value().get(0).direction()); + Assertions.assertEquals("atiz", model.value().get(0).schemaUri()); + Assertions.assertEquals(SchemaType.ZIP, model.value().get(0).schemaType()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SelectedResourceTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SelectedResourceTests.java new file mode 100644 index 0000000000000..619614d1670b5 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SelectedResourceTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.SelectedResource; +import org.junit.jupiter.api.Assertions; + +public final class SelectedResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SelectedResource model = BinaryData.fromString( + "{\"name\":\"hmtnvy\",\"id\":\"iatkzwpcnp\",\"location\":\"cjaesgvvs\",\"subscriptionName\":\"yajguqfhwygzlv\"}") + .toObject(SelectedResource.class); + Assertions.assertEquals("hmtnvy", model.name()); + Assertions.assertEquals("iatkzwpcnp", model.id()); + Assertions.assertEquals("cjaesgvvs", model.location()); + Assertions.assertEquals("yajguqfhwygzlv", model.subscriptionName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SelectedResource model = new SelectedResource().withName("hmtnvy") + .withId("iatkzwpcnp") + .withLocation("cjaesgvvs") + .withSubscriptionName("yajguqfhwygzlv"); + model = BinaryData.fromObject(model).toObject(SelectedResource.class); + Assertions.assertEquals("hmtnvy", model.name()); + Assertions.assertEquals("iatkzwpcnp", model.id()); + Assertions.assertEquals("cjaesgvvs", model.location()); + Assertions.assertEquals("yajguqfhwygzlv", model.subscriptionName()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SetDestinationEndpointPortsTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SetDestinationEndpointPortsTests.java new file mode 100644 index 0000000000000..7c6548ce192a8 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SetDestinationEndpointPortsTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.SetDestinationEndpointPorts; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class SetDestinationEndpointPortsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SetDestinationEndpointPorts model + = BinaryData.fromString("{\"ports\":[2795060636198959975,2464411057052311846]}") + .toObject(SetDestinationEndpointPorts.class); + Assertions.assertEquals(2795060636198959975L, model.ports().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SetDestinationEndpointPorts model + = new SetDestinationEndpointPorts().withPorts(Arrays.asList(2795060636198959975L, 2464411057052311846L)); + model = BinaryData.fromObject(model).toObject(SetDestinationEndpointPorts.class); + Assertions.assertEquals(2795060636198959975L, model.ports().get(0)); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SetDestinationEndpointsTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SetDestinationEndpointsTests.java new file mode 100644 index 0000000000000..562f19c715a77 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SetDestinationEndpointsTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.SetDestinationEndpoints; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class SetDestinationEndpointsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SetDestinationEndpoints model + = BinaryData.fromString("{\"endpoints\":[\"tffyaqit\",\"hheioqaqhvseuf\",\"qyrxp\"]}") + .toObject(SetDestinationEndpoints.class); + Assertions.assertEquals("tffyaqit", model.endpoints().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SetDestinationEndpoints model + = new SetDestinationEndpoints().withEndpoints(Arrays.asList("tffyaqit", "hheioqaqhvseuf", "qyrxp")); + model = BinaryData.fromObject(model).toObject(SetDestinationEndpoints.class); + Assertions.assertEquals("tffyaqit", model.endpoints().get(0)); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SetSourceAddressesTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SetSourceAddressesTests.java new file mode 100644 index 0000000000000..c3f885799f0a7 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SetSourceAddressesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.SetSourceAddresses; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class SetSourceAddressesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SetSourceAddresses model + = BinaryData.fromString("{\"values\":[\"smjqfrddgam\",\"uhiosrsju\",\"vfcdisyirn\",\"zhczexrxzbujrtrh\"]}") + .toObject(SetSourceAddresses.class); + Assertions.assertEquals("smjqfrddgam", model.values().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SetSourceAddresses model = new SetSourceAddresses() + .withValues(Arrays.asList("smjqfrddgam", "uhiosrsju", "vfcdisyirn", "zhczexrxzbujrtrh")); + model = BinaryData.fromObject(model).toObject(SetSourceAddresses.class); + Assertions.assertEquals("smjqfrddgam", model.values().get(0)); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SetStreamPassphraseTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SetStreamPassphraseTests.java new file mode 100644 index 0000000000000..4022cf273f555 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SetStreamPassphraseTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.SetStreamPassphrase; +import org.junit.jupiter.api.Assertions; + +public final class SetStreamPassphraseTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SetStreamPassphrase model = BinaryData.fromString("{\"value\":\"cgq\"}").toObject(SetStreamPassphrase.class); + Assertions.assertEquals("cgq", model.value()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SetStreamPassphrase model = new SetStreamPassphrase().withValue("cgq"); + model = BinaryData.fromObject(model).toObject(SetStreamPassphrase.class); + Assertions.assertEquals("cgq", model.value()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/StreamSourceAddressesInnerTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/StreamSourceAddressesInnerTests.java new file mode 100644 index 0000000000000..7137761c6d259 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/StreamSourceAddressesInnerTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.fluent.models.StreamSourceAddressesInner; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class StreamSourceAddressesInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + StreamSourceAddressesInner model = BinaryData.fromString("{\"sourceAddresses\":[\"thtywub\",\"cbihwqk\"]}") + .toObject(StreamSourceAddressesInner.class); + Assertions.assertEquals("thtywub", model.sourceAddresses().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + StreamSourceAddressesInner model + = new StreamSourceAddressesInner().withSourceAddresses(Arrays.asList("thtywub", "cbihwqk")); + model = BinaryData.fromObject(model).toObject(StreamSourceAddressesInner.class); + Assertions.assertEquals("thtywub", model.sourceAddresses().get(0)); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SubscriberTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SubscriberTests.java new file mode 100644 index 0000000000000..e4a73e0e30e44 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/SubscriberTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.Subscriber; +import org.junit.jupiter.api.Assertions; + +public final class SubscriberTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Subscriber model = BinaryData.fromString("{\"email\":\"vjfdx\",\"notifications\":4916987927565414718}") + .toObject(Subscriber.class); + Assertions.assertEquals("vjfdx", model.email()); + Assertions.assertEquals(4916987927565414718L, model.notifications()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Subscriber model = new Subscriber().withEmail("vjfdx").withNotifications(4916987927565414718L); + model = BinaryData.fromObject(model).toObject(Subscriber.class); + Assertions.assertEquals("vjfdx", model.email()); + Assertions.assertEquals(4916987927565414718L, model.notifications()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/TextMatchingRulesetDenyTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/TextMatchingRulesetDenyTests.java new file mode 100644 index 0000000000000..b8493af6b2e21 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/TextMatchingRulesetDenyTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.Casing; +import com.azure.resourcemanager.datatransfer.models.MatchType; +import com.azure.resourcemanager.datatransfer.models.TextMatchingRulesetDeny; +import org.junit.jupiter.api.Assertions; + +public final class TextMatchingRulesetDenyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TextMatchingRulesetDeny model + = BinaryData.fromString("{\"text\":\"x\",\"matchType\":\"Partial\",\"caseSensitivity\":\"Sensitive\"}") + .toObject(TextMatchingRulesetDeny.class); + Assertions.assertEquals("x", model.text()); + Assertions.assertEquals(MatchType.PARTIAL, model.matchType()); + Assertions.assertEquals(Casing.SENSITIVE, model.caseSensitivity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TextMatchingRulesetDeny model = new TextMatchingRulesetDeny().withText("x") + .withMatchType(MatchType.PARTIAL) + .withCaseSensitivity(Casing.SENSITIVE); + model = BinaryData.fromObject(model).toObject(TextMatchingRulesetDeny.class); + Assertions.assertEquals("x", model.text()); + Assertions.assertEquals(MatchType.PARTIAL, model.matchType()); + Assertions.assertEquals(Casing.SENSITIVE, model.caseSensitivity()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/TextMatchingRulesetTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/TextMatchingRulesetTests.java new file mode 100644 index 0000000000000..c0c2b990017d7 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/TextMatchingRulesetTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.Casing; +import com.azure.resourcemanager.datatransfer.models.MatchType; +import com.azure.resourcemanager.datatransfer.models.TextMatchingRuleset; +import com.azure.resourcemanager.datatransfer.models.TextMatchingRulesetDeny; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class TextMatchingRulesetTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TextMatchingRuleset model = BinaryData.fromString( + "{\"deny\":[{\"text\":\"wbxgjvt\",\"matchType\":\"Partial\",\"caseSensitivity\":\"Insensitive\"},{\"text\":\"ysszdnrujqguh\",\"matchType\":\"Partial\",\"caseSensitivity\":\"Insensitive\"},{\"text\":\"uqfprwzw\",\"matchType\":\"Complete\",\"caseSensitivity\":\"Insensitive\"},{\"text\":\"uitnwuiz\",\"matchType\":\"Partial\",\"caseSensitivity\":\"Insensitive\"}]}") + .toObject(TextMatchingRuleset.class); + Assertions.assertEquals("wbxgjvt", model.deny().get(0).text()); + Assertions.assertEquals(MatchType.PARTIAL, model.deny().get(0).matchType()); + Assertions.assertEquals(Casing.INSENSITIVE, model.deny().get(0).caseSensitivity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TextMatchingRuleset model = new TextMatchingRuleset().withDeny(Arrays.asList( + new TextMatchingRulesetDeny().withText("wbxgjvt") + .withMatchType(MatchType.PARTIAL) + .withCaseSensitivity(Casing.INSENSITIVE), + new TextMatchingRulesetDeny().withText("ysszdnrujqguh") + .withMatchType(MatchType.PARTIAL) + .withCaseSensitivity(Casing.INSENSITIVE), + new TextMatchingRulesetDeny().withText("uqfprwzw") + .withMatchType(MatchType.COMPLETE) + .withCaseSensitivity(Casing.INSENSITIVE), + new TextMatchingRulesetDeny().withText("uitnwuiz") + .withMatchType(MatchType.PARTIAL) + .withCaseSensitivity(Casing.INSENSITIVE))); + model = BinaryData.fromObject(model).toObject(TextMatchingRuleset.class); + Assertions.assertEquals("wbxgjvt", model.deny().get(0).text()); + Assertions.assertEquals(MatchType.PARTIAL, model.deny().get(0).matchType()); + Assertions.assertEquals(Casing.INSENSITIVE, model.deny().get(0).caseSensitivity()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/UserAssignedIdentityTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/UserAssignedIdentityTests.java new file mode 100644 index 0000000000000..b299a9b9ecd6f --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/UserAssignedIdentityTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.UserAssignedIdentity; + +public final class UserAssignedIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UserAssignedIdentity model = BinaryData.fromString("{\"principalId\":\"dwzjeiach\",\"clientId\":\"osfln\"}") + .toObject(UserAssignedIdentity.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UserAssignedIdentity model = new UserAssignedIdentity(); + model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ValidateSchemaResultInnerTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ValidateSchemaResultInnerTests.java new file mode 100644 index 0000000000000..882d6328b33de --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/ValidateSchemaResultInnerTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.fluent.models.ValidateSchemaResultInner; +import com.azure.resourcemanager.datatransfer.models.ValidateSchemaStatus; +import org.junit.jupiter.api.Assertions; + +public final class ValidateSchemaResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ValidateSchemaResultInner model + = BinaryData.fromString("{\"status\":\"Succeeded\",\"message\":\"tuodxeszabbelaw\"}") + .toObject(ValidateSchemaResultInner.class); + Assertions.assertEquals(ValidateSchemaStatus.SUCCEEDED, model.status()); + Assertions.assertEquals("tuodxeszabbelaw", model.message()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/XmlFilterRulesetTests.java b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/XmlFilterRulesetTests.java new file mode 100644 index 0000000000000..567e96b322678 --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/src/test/java/com/azure/resourcemanager/datatransfer/generated/XmlFilterRulesetTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.datatransfer.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datatransfer.models.XmlFilterRuleset; +import com.azure.resourcemanager.datatransfer.models.XmlReferenceType; +import org.junit.jupiter.api.Assertions; + +public final class XmlFilterRulesetTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + XmlFilterRuleset model = BinaryData + .fromString("{\"defaultNamespace\":\"kujysvlejuvfq\",\"reference\":\"Inline\",\"schema\":\"yxwjkcp\"}") + .toObject(XmlFilterRuleset.class); + Assertions.assertEquals("kujysvlejuvfq", model.defaultNamespace()); + Assertions.assertEquals(XmlReferenceType.INLINE, model.reference()); + Assertions.assertEquals("yxwjkcp", model.schema()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + XmlFilterRuleset model = new XmlFilterRuleset().withDefaultNamespace("kujysvlejuvfq") + .withReference(XmlReferenceType.INLINE) + .withSchema("yxwjkcp"); + model = BinaryData.fromObject(model).toObject(XmlFilterRuleset.class); + Assertions.assertEquals("kujysvlejuvfq", model.defaultNamespace()); + Assertions.assertEquals(XmlReferenceType.INLINE, model.reference()); + Assertions.assertEquals("yxwjkcp", model.schema()); + } +} diff --git a/sdk/datatransfer/azure-resourcemanager-datatransfer/tsp-location.yaml b/sdk/datatransfer/azure-resourcemanager-datatransfer/tsp-location.yaml new file mode 100644 index 0000000000000..a2da30335053b --- /dev/null +++ b/sdk/datatransfer/azure-resourcemanager-datatransfer/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/AzureDataTransfer +commit: d6eac2e8bb935a79916212236bfcb76572287c09 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/datatransfer/ci.yml b/sdk/datatransfer/ci.yml new file mode 100644 index 0000000000000..e41be0c06daed --- /dev/null +++ b/sdk/datatransfer/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/datatransfer/ci.yml + - sdk/datatransfer/azure-resourcemanager-datatransfer/ + exclude: + - sdk/datatransfer/pom.xml + - sdk/datatransfer/azure-resourcemanager-datatransfer/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datatransfer/ci.yml + - sdk/datatransfer/azure-resourcemanager-datatransfer/ + exclude: + - sdk/datatransfer/pom.xml + - sdk/datatransfer/azure-resourcemanager-datatransfer/pom.xml + +parameters: + - name: release_azureresourcemanagerdatatransfer + displayName: azure-resourcemanager-datatransfer + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: datatransfer + Artifacts: + - name: azure-resourcemanager-datatransfer + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerdatatransfer + releaseInBatch: ${{ parameters.release_azureresourcemanagerdatatransfer }} diff --git a/sdk/datatransfer/pom.xml b/sdk/datatransfer/pom.xml new file mode 100644 index 0000000000000..8a32267096635 --- /dev/null +++ b/sdk/datatransfer/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-datatransfer-service + pom + 1.0.0 + + + azure-resourcemanager-datatransfer + +