diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 5148f0cfa27e..2ed29c5fa033 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -437,6 +437,7 @@ com.azure.resourcemanager:azure-resourcemanager-apicenter;1.0.0-beta.1;1.0.0-bet com.azure.resourcemanager:azure-resourcemanager-hybridconnectivity;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-playwrighttesting;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-recoveryservicesdatareplication;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-networkanalytics;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 diff --git a/pom.xml b/pom.xml index 48806d3b8a00..538d965a8d76 100644 --- a/pom.xml +++ b/pom.xml @@ -132,6 +132,7 @@ sdk/mysql sdk/mysqlflexibleserver sdk/netapp + sdk/networkanalytics sdk/networkcloud sdk/networkfunction sdk/newrelicobservability diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/CHANGELOG.md b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/CHANGELOG.md new file mode 100644 index 000000000000..4fa4be0b2381 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2023-11-27) + +- Azure Resource Manager Network Analytics client library for Java. This package contains Microsoft Azure SDK for Network Analytics Management SDK. Package tag package-2023-11-15. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/README.md b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/README.md new file mode 100644 index 000000000000..537cb241a924 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/README.md @@ -0,0 +1,107 @@ +# Azure Resource Manager Network Analytics client library for Java + +Azure Resource Manager Network Analytics client library for Java. + +This package contains Microsoft Azure SDK for Network Analytics Management SDK. Package tag package-2023-11-15. 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-networkanalytics;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-networkanalytics + 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 + +By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +With above configuration, `azure` client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +NetworkAnalyticsManager manager = NetworkAnalyticsManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/networkanalytics/azure-resourcemanager-networkanalytics/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_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/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fnetworkanalytics%2Fazure-resourcemanager-networkanalytics%2FREADME.png) diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/SAMPLE.md b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/SAMPLE.md new file mode 100644 index 000000000000..af1ed130bff4 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/SAMPLE.md @@ -0,0 +1,852 @@ +# Code snippets and samples + + +## DataProducts + +- [AddUserRole](#dataproducts_adduserrole) +- [Create](#dataproducts_create) +- [Delete](#dataproducts_delete) +- [GenerateStorageAccountSasToken](#dataproducts_generatestorageaccountsastoken) +- [GetByResourceGroup](#dataproducts_getbyresourcegroup) +- [List](#dataproducts_list) +- [ListByResourceGroup](#dataproducts_listbyresourcegroup) +- [ListRolesAssignments](#dataproducts_listrolesassignments) +- [RemoveUserRole](#dataproducts_removeuserrole) +- [RotateKey](#dataproducts_rotatekey) +- [Update](#dataproducts_update) + +## DataProductsCatalogs + +- [GetByResourceGroup](#dataproductscatalogs_getbyresourcegroup) +- [List](#dataproductscatalogs_list) +- [ListByResourceGroup](#dataproductscatalogs_listbyresourcegroup) + +## DataTypes + +- [Create](#datatypes_create) +- [Delete](#datatypes_delete) +- [DeleteData](#datatypes_deletedata) +- [GenerateStorageContainerSasToken](#datatypes_generatestoragecontainersastoken) +- [Get](#datatypes_get) +- [ListByDataProduct](#datatypes_listbydataproduct) +- [Update](#datatypes_update) + +## Operations + +- [List](#operations_list) +### DataProducts_AddUserRole + +```java +import com.azure.resourcemanager.networkanalytics.models.DataProductUserRole; +import com.azure.resourcemanager.networkanalytics.models.RoleAssignmentCommonProperties; +import java.util.Arrays; +import java.util.stream.Collectors; + +/** + * Samples for DataProducts AddUserRole. + */ +public final class DataProductsAddUserRoleSamples { + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_AddUserRole_MinimumSet_Gen.json + */ + /** + * Sample code: DataProducts_AddUserRole_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsAddUserRoleMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().addUserRoleWithResponse("aoiresourceGroupName", "dataproduct01", new RoleAssignmentCommonProperties().withRoleId("00000000-0000-0000-0000-00000000000").withPrincipalId("00000000-0000-0000-0000-00000000000").withUsername("userName").withDataTypeScope(Arrays.asList("scope")).withPrincipalType("User").withRole(DataProductUserRole.READER), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_AddUserRole_MaximumSet_Gen.json + */ + /** + * Sample code: DataProducts_AddUserRole_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsAddUserRoleMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().addUserRoleWithResponse("aoiresourceGroupName", "dataproduct01", new RoleAssignmentCommonProperties().withRoleId("00000000-0000-0000-0000-00000000000").withPrincipalId("00000000-0000-0000-0000-00000000000").withUsername("UserName").withDataTypeScope(Arrays.asList("scope")).withPrincipalType("User").withRole(DataProductUserRole.READER), com.azure.core.util.Context.NONE); + } +} +``` + +### DataProducts_Create + +```java +import com.azure.resourcemanager.networkanalytics.models.ControlState; +import com.azure.resourcemanager.networkanalytics.models.DataProductNetworkAcls; +import com.azure.resourcemanager.networkanalytics.models.DataProductProperties; +import com.azure.resourcemanager.networkanalytics.models.DefaultAction; +import com.azure.resourcemanager.networkanalytics.models.EncryptionKeyDetails; +import com.azure.resourcemanager.networkanalytics.models.IpRules; +import com.azure.resourcemanager.networkanalytics.models.ManagedResourceGroupConfiguration; +import com.azure.resourcemanager.networkanalytics.models.ManagedServiceIdentity; +import com.azure.resourcemanager.networkanalytics.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.networkanalytics.models.UserAssignedIdentity; +import com.azure.resourcemanager.networkanalytics.models.VirtualNetworkRule; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * Samples for DataProducts Create. + */ +public final class DataProductsCreateSamples { + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Create_MaximumSet_Gen.json + */ + /** + * Sample code: DataProducts_Create_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsCreateMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().define("dataproduct01").withRegion("eastus").withExistingResourceGroup("aoiresourceGroupName").withTags(mapOf("userSpecifiedKeyName", "fakeTokenPlaceholder")).withProperties(new DataProductProperties().withPublisher("Microsoft").withProduct("MCC").withMajorVersion("1.0.0").withOwners(Arrays.asList("abc@micros.com")).withRedundancy(ControlState.DISABLED).withPurviewAccount("testpurview").withPurviewCollection("134567890").withPrivateLinksEnabled(ControlState.DISABLED).withPublicNetworkAccess(ControlState.ENABLED).withCustomerManagedKeyEncryptionEnabled(ControlState.ENABLED).withCustomerEncryptionKey(new EncryptionKeyDetails().withKeyVaultUri("fakeTokenPlaceholder").withKeyName("fakeTokenPlaceholder").withKeyVersion("fakeTokenPlaceholder")).withNetworkacls(new DataProductNetworkAcls().withVirtualNetworkRule(Arrays.asList(new VirtualNetworkRule().withId("/subscriptions/subscriptionId/resourcegroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/virtualNetworkName/subnets/subnetName").withAction("Allow").withState(""))).withIpRules(Arrays.asList(new IpRules().withValue("1.1.1.1").withAction("Allow"))).withAllowedQueryIpRangeList(Arrays.asList("1.1.1.1")).withDefaultAction(DefaultAction.ALLOW)).withManagedResourceGroupConfiguration(new ManagedResourceGroupConfiguration().withName("managedResourceGroupName").withLocation("eastus")).withCurrentMinorVersion("1.0.1")).withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED).withUserAssignedIdentities(mapOf("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", new UserAssignedIdentity()))).create(); + } + + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Create_MinimumSet_Gen.json + */ + /** + * Sample code: DataProducts_Create_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsCreateMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().define("dataproduct01").withRegion("eastus").withExistingResourceGroup("aoiresourceGroupName").withTags(mapOf("userSpecifiedKeyName", "fakeTokenPlaceholder")).withProperties(new DataProductProperties().withPublisher("Microsoft").withProduct("MCC").withMajorVersion("1.0.0")).create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### DataProducts_Delete + +```java +/** + * Samples for DataProducts Delete. + */ +public final class DataProductsDeleteSamples { + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: DataProducts_Delete_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsDeleteMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().delete("aoiresourceGroupName", "dataproduct01", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: DataProducts_Delete_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsDeleteMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().delete("aoiresourceGroupName", "dataproduct01", com.azure.core.util.Context.NONE); + } +} +``` + +### DataProducts_GenerateStorageAccountSasToken + +```java +import com.azure.resourcemanager.networkanalytics.models.AccountSas; +import java.time.OffsetDateTime; + +/** + * Samples for DataProducts GenerateStorageAccountSasToken. + */ +public final class DataProductsGenerateStorageAccountSasTokenSamples { + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_GenerateStorageAccountSasToken_MinimumSet_Gen.json + */ + /** + * Sample code: DataProducts_GenerateStorageAccountSasToken_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsGenerateStorageAccountSasTokenMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().generateStorageAccountSasTokenWithResponse("aoiresourceGroupName", "dataproduct01", new AccountSas().withStartTimestamp(OffsetDateTime.parse("2023-08-24T05:35:17.051Z")).withExpiryTimestamp(OffsetDateTime.parse("2023-08-24T05:35:17.051Z")).withIpAddress("1.1.1.1"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_GenerateStorageAccountSasToken_MaximumSet_Gen.json + */ + /** + * Sample code: DataProducts_GenerateStorageAccountSasToken_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsGenerateStorageAccountSasTokenMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().generateStorageAccountSasTokenWithResponse("aoiresourceGroupName", "dataproduct01", new AccountSas().withStartTimestamp(OffsetDateTime.parse("2023-08-24T05:34:58.151Z")).withExpiryTimestamp(OffsetDateTime.parse("2023-08-24T05:34:58.151Z")).withIpAddress("1.1.1.1"), com.azure.core.util.Context.NONE); + } +} +``` + +### DataProducts_GetByResourceGroup + +```java +/** + * Samples for DataProducts GetByResourceGroup. + */ +public final class DataProductsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Get_MaximumSet_Gen.json + */ + /** + * Sample code: DataProducts_Get_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsGetMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().getByResourceGroupWithResponse("aoiresourceGroupName", "dataproduct01", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Get_MinimumSet_Gen.json + */ + /** + * Sample code: DataProducts_Get_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsGetMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().getByResourceGroupWithResponse("aoiresourceGroupName", "dataproduct01", com.azure.core.util.Context.NONE); + } +} +``` + +### DataProducts_List + +```java +/** + * Samples for DataProducts List. + */ +public final class DataProductsListSamples { + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: DataProducts_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsListBySubscriptionMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: DataProducts_ListBySubscription_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsListBySubscriptionMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().list(com.azure.core.util.Context.NONE); + } +} +``` + +### DataProducts_ListByResourceGroup + +```java +/** + * Samples for DataProducts ListByResourceGroup. + */ +public final class DataProductsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: DataProducts_ListByResourceGroup_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsListByResourceGroupMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().listByResourceGroup("aoiresourceGroupName", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: DataProducts_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsListByResourceGroupMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().listByResourceGroup("aoiresourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### DataProducts_ListRolesAssignments + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** + * Samples for DataProducts ListRolesAssignments. + */ +public final class DataProductsListRolesAssignmentsSamples { + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_ListRolesAssignments_MinimumSet_Gen.json + */ + /** + * Sample code: DataProducts_ListRolesAssignments_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsListRolesAssignmentsMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) throws IOException { + manager.dataProducts().listRolesAssignmentsWithResponse("aoiresourceGroupName", "dataproduct01", SerializerFactory.createDefaultManagementSerializerAdapter().deserialize("{}", Object.class, SerializerEncoding.JSON), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_ListRolesAssignments_MaximumSet_Gen.json + */ + /** + * Sample code: DataProducts_ListRolesAssignments_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsListRolesAssignmentsMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) throws IOException { + manager.dataProducts().listRolesAssignmentsWithResponse("aoiresourceGroupName", "dataproduct01", SerializerFactory.createDefaultManagementSerializerAdapter().deserialize("{}", Object.class, SerializerEncoding.JSON), com.azure.core.util.Context.NONE); + } +} +``` + +### DataProducts_RemoveUserRole + +```java +import com.azure.resourcemanager.networkanalytics.fluent.models.RoleAssignmentDetailInner; +import com.azure.resourcemanager.networkanalytics.models.DataProductUserRole; +import java.util.Arrays; +import java.util.stream.Collectors; + +/** + * Samples for DataProducts RemoveUserRole. + */ +public final class DataProductsRemoveUserRoleSamples { + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_RemoveUserRole_MaximumSet_Gen.json + */ + /** + * Sample code: DataProducts_RemoveUserRole_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsRemoveUserRoleMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().removeUserRoleWithResponse("aoiresourceGroupName", "dataproduct01", new RoleAssignmentDetailInner().withRoleId("00000000-0000-0000-0000-00000000000").withPrincipalId("00000000-0000-0000-0000-00000000000").withUsername("UserName").withDataTypeScope(Arrays.asList("scope")).withPrincipalType("User").withRole(DataProductUserRole.READER).withRoleAssignmentId("00000000-0000-0000-0000-00000000000"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_RemoveUserRole_MinimumSet_Gen.json + */ + /** + * Sample code: DataProducts_RemoveUserRole_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsRemoveUserRoleMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().removeUserRoleWithResponse("aoiresourceGroupName", "dataproduct01", new RoleAssignmentDetailInner().withRoleId("00000000-0000-0000-0000-00000000000").withPrincipalId("00000000-0000-0000-0000-00000000000").withUsername("UserName").withDataTypeScope(Arrays.asList("scope")).withPrincipalType("User").withRole(DataProductUserRole.READER).withRoleAssignmentId("00000000-0000-0000-0000-00000000000"), com.azure.core.util.Context.NONE); + } +} +``` + +### DataProducts_RotateKey + +```java +import com.azure.resourcemanager.networkanalytics.models.KeyVaultInfo; + +/** + * Samples for DataProducts RotateKey. + */ +public final class DataProductsRotateKeySamples { + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_RotateKey_MaximumSet_Gen.json + */ + /** + * Sample code: DataProducts_RotateKey_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsRotateKeyMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().rotateKeyWithResponse("aoiresourceGroupName", "dataproduct01", new KeyVaultInfo().withKeyVaultUrl("fakeTokenPlaceholder"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_RotateKey_MinimumSet_Gen.json + */ + /** + * Sample code: DataProducts_RotateKey_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsRotateKeyMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().rotateKeyWithResponse("aoiresourceGroupName", "dataproduct01", new KeyVaultInfo().withKeyVaultUrl("fakeTokenPlaceholder"), com.azure.core.util.Context.NONE); + } +} +``` + +### DataProducts_Update + +```java +import com.azure.resourcemanager.networkanalytics.models.ControlState; +import com.azure.resourcemanager.networkanalytics.models.DataProduct; +import com.azure.resourcemanager.networkanalytics.models.DataProductUpdateProperties; +import com.azure.resourcemanager.networkanalytics.models.ManagedServiceIdentity; +import com.azure.resourcemanager.networkanalytics.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.networkanalytics.models.UserAssignedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * Samples for DataProducts Update. + */ +public final class DataProductsUpdateSamples { + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Update_MaximumSet_Gen.json + */ + /** + * Sample code: DataProducts_Update_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsUpdateMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + DataProduct resource = manager.dataProducts().getByResourceGroupWithResponse("aoiresourceGroupName", "dataproduct01", com.azure.core.util.Context.NONE).getValue(); + resource.update().withTags(mapOf("userSpecifiedKeyName", "fakeTokenPlaceholder")).withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED).withUserAssignedIdentities(mapOf("/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", new UserAssignedIdentity()))).withProperties(new DataProductUpdateProperties().withOwners(Arrays.asList("abc@micros.com", "def@micros.com")).withPurviewAccount("testpurview").withPurviewCollection("134567890").withPrivateLinksEnabled(ControlState.DISABLED).withCurrentMinorVersion("1.0.1")).apply(); + } + + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Update_MinimumSet_Gen.json + */ + /** + * Sample code: DataProducts_Update_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsUpdateMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + DataProduct resource = manager.dataProducts().getByResourceGroupWithResponse("aoiresourceGroupName", "dataproduct01", com.azure.core.util.Context.NONE).getValue(); + resource.update().apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### DataProductsCatalogs_GetByResourceGroup + +```java +/** + * Samples for DataProductsCatalogs GetByResourceGroup. + */ +public final class DataProductsCatalogsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProductsCatalogs_Get_MinimumSet_Gen.json + */ + /** + * Sample code: DataProductsCatalogs_Get_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsCatalogsGetMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProductsCatalogs().getByResourceGroupWithResponse("aoiresourceGroupName", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProductsCatalogs_Get_MaximumSet_Gen.json + */ + /** + * Sample code: DataProductsCatalogs_Get_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsCatalogsGetMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProductsCatalogs().getByResourceGroupWithResponse("aoiresourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### DataProductsCatalogs_List + +```java +/** + * Samples for DataProductsCatalogs List. + */ +public final class DataProductsCatalogsListSamples { + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProductsCatalogs_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: DataProductsCatalogs_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsCatalogsListBySubscriptionMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProductsCatalogs().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProductsCatalogs_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: DataProductsCatalogs_ListBySubscription_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsCatalogsListBySubscriptionMinimumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProductsCatalogs().list(com.azure.core.util.Context.NONE); + } +} +``` + +### DataProductsCatalogs_ListByResourceGroup + +```java +/** + * Samples for DataProductsCatalogs ListByResourceGroup. + */ +public final class DataProductsCatalogsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProductsCatalogs_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: DataProductsCatalogs_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsCatalogsListByResourceGroupMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProductsCatalogs().listByResourceGroup("aoiresourceGroupName", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProductsCatalogs_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: DataProductsCatalogs_ListByResourceGroup_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsCatalogsListByResourceGroupMinimumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProductsCatalogs().listByResourceGroup("aoiresourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### DataTypes_Create + +```java +import com.azure.resourcemanager.networkanalytics.models.DataTypeProperties; +import com.azure.resourcemanager.networkanalytics.models.DataTypeState; +import java.util.stream.Collectors; + +/** + * Samples for DataTypes Create. + */ +public final class DataTypesCreateSamples { + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Create_MaximumSet_Gen.json + */ + /** + * Sample code: DataTypes_Create_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesCreateMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes().define("datatypename").withExistingDataProduct("aoiresourceGroupName", "dataproduct01").withProperties(new DataTypeProperties().withState(DataTypeState.fromString("STARTED")).withStorageOutputRetention(27).withDatabaseCacheRetention(23).withDatabaseRetention(6)).create(); + } + + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Create_MinimumSet_Gen.json + */ + /** + * Sample code: DataTypes_Create_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesCreateMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes().define("datatypename").withExistingDataProduct("aoiresourceGroupName", "dataproduct01").create(); + } +} +``` + +### DataTypes_Delete + +```java +/** + * Samples for DataTypes Delete. + */ +public final class DataTypesDeleteSamples { + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: DataTypes_Delete_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesDeleteMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes().delete("aoiresourceGroupName", "dataproduct01", "datatypename", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: DataTypes_Delete_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesDeleteMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes().delete("aoiresourceGroupName", "dataproduct01", "datatypename", com.azure.core.util.Context.NONE); + } +} +``` + +### DataTypes_DeleteData + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** + * Samples for DataTypes DeleteData. + */ +public final class DataTypesDeleteDataSamples { + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_DeleteData_MinimumSet_Gen.json + */ + /** + * Sample code: DataTypes_DeleteData_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesDeleteDataMinimumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) throws IOException { + manager.dataTypes().deleteData("aoiresourceGroupName", "dataproduct01", "datatypename", SerializerFactory.createDefaultManagementSerializerAdapter().deserialize("{}", Object.class, SerializerEncoding.JSON), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_DeleteData_MaximumSet_Gen.json + */ + /** + * Sample code: DataTypes_DeleteData_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesDeleteDataMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) throws IOException { + manager.dataTypes().deleteData("aoiresourceGroupName", "dataproduct01", "datatypename", SerializerFactory.createDefaultManagementSerializerAdapter().deserialize("{}", Object.class, SerializerEncoding.JSON), com.azure.core.util.Context.NONE); + } +} +``` + +### DataTypes_GenerateStorageContainerSasToken + +```java +import com.azure.resourcemanager.networkanalytics.models.ContainerSaS; +import java.time.OffsetDateTime; + +/** + * Samples for DataTypes GenerateStorageContainerSasToken. + */ +public final class DataTypesGenerateStorageContainerSasTokenSamples { + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_GenerateStorageContainerSasToken_MaximumSet_Gen.json + */ + /** + * Sample code: DataTypes_GenerateStorageContainerSasToken_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesGenerateStorageContainerSasTokenMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes().generateStorageContainerSasTokenWithResponse("aoiresourceGroupName", "dataproduct01", "datatypename", new ContainerSaS().withStartTimestamp(OffsetDateTime.parse("2023-08-24T05:34:58.039Z")).withExpiryTimestamp(OffsetDateTime.parse("2023-08-24T05:34:58.039Z")).withIpAddress("1.1.1.1"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_GenerateStorageContainerSasToken_MinimumSet_Gen.json + */ + /** + * Sample code: DataTypes_GenerateStorageContainerSasToken_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesGenerateStorageContainerSasTokenMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes().generateStorageContainerSasTokenWithResponse("aoiresourceGroupName", "dataproduct01", "datatypename", new ContainerSaS().withStartTimestamp(OffsetDateTime.parse("2023-08-24T05:35:16.887Z")).withExpiryTimestamp(OffsetDateTime.parse("2023-08-24T05:35:16.887Z")).withIpAddress("1.1.1.1"), com.azure.core.util.Context.NONE); + } +} +``` + +### DataTypes_Get + +```java +/** + * Samples for DataTypes Get. + */ +public final class DataTypesGetSamples { + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Get_MinimumSet_Gen.json + */ + /** + * Sample code: DataTypes_Get_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesGetMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes().getWithResponse("aoiresourceGroupName", "dataproduct01", "datatypename", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Get_MaximumSet_Gen.json + */ + /** + * Sample code: DataTypes_Get_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesGetMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes().getWithResponse("aoiresourceGroupName", "dataproduct01", "datatypename", com.azure.core.util.Context.NONE); + } +} +``` + +### DataTypes_ListByDataProduct + +```java +/** + * Samples for DataTypes ListByDataProduct. + */ +public final class DataTypesListByDataProductSamples { + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_ListByDataProduct_MaximumSet_Gen.json + */ + /** + * Sample code: DataTypes_ListByDataProduct_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesListByDataProductMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes().listByDataProduct("aoiresourceGroupName", "dataproduct01", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_ListByDataProduct_MinimumSet_Gen.json + */ + /** + * Sample code: DataTypes_ListByDataProduct_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesListByDataProductMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes().listByDataProduct("aoiresourceGroupName", "dataproduct01", com.azure.core.util.Context.NONE); + } +} +``` + +### DataTypes_Update + +```java +import com.azure.resourcemanager.networkanalytics.models.DataType; +import com.azure.resourcemanager.networkanalytics.models.DataTypeState; +import com.azure.resourcemanager.networkanalytics.models.DataTypeUpdateProperties; +import java.util.stream.Collectors; + +/** + * Samples for DataTypes Update. + */ +public final class DataTypesUpdateSamples { + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Update_MinimumSet_Gen.json + */ + /** + * Sample code: DataTypes_Update_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesUpdateMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + DataType resource = manager.dataTypes().getWithResponse("aoiresourceGroupName", "dataproduct01", "datatypename", com.azure.core.util.Context.NONE).getValue(); + resource.update().apply(); + } + + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Update_MaximumSet_Gen.json + */ + /** + * Sample code: DataTypes_Update_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesUpdateMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + DataType resource = manager.dataTypes().getWithResponse("aoiresourceGroupName", "dataproduct01", "datatypename", com.azure.core.util.Context.NONE).getValue(); + resource.update().withProperties(new DataTypeUpdateProperties().withState(DataTypeState.fromString("STARTED")).withStorageOutputRetention(30).withDatabaseCacheRetention(16).withDatabaseRetention(9)).apply(); + } +} +``` + +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void operationsListMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void operationsListMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/pom.xml b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/pom.xml new file mode 100644 index 000000000000..0604287e8e7b --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-networkanalytics + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Network Analytics Management + This package contains Microsoft Azure SDK for Network Analytics Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2023-11-15. + 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.45.0 + + + com.azure + azure-core-management + 1.11.8 + + + diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/NetworkAnalyticsManager.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/NetworkAnalyticsManager.java new file mode 100644 index 000000000000..64c69032bfe1 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/NetworkAnalyticsManager.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkanalytics.fluent.NetworkAnalyticsMgmtClient; +import com.azure.resourcemanager.networkanalytics.implementation.DataProductsCatalogsImpl; +import com.azure.resourcemanager.networkanalytics.implementation.DataProductsImpl; +import com.azure.resourcemanager.networkanalytics.implementation.DataTypesImpl; +import com.azure.resourcemanager.networkanalytics.implementation.NetworkAnalyticsMgmtClientBuilder; +import com.azure.resourcemanager.networkanalytics.implementation.OperationsImpl; +import com.azure.resourcemanager.networkanalytics.models.DataProducts; +import com.azure.resourcemanager.networkanalytics.models.DataProductsCatalogs; +import com.azure.resourcemanager.networkanalytics.models.DataTypes; +import com.azure.resourcemanager.networkanalytics.models.Operations; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to NetworkAnalyticsManager. + */ +public final class NetworkAnalyticsManager { + private Operations operations; + + private DataProducts dataProducts; + + private DataProductsCatalogs dataProductsCatalogs; + + private DataTypes dataTypes; + + private final NetworkAnalyticsMgmtClient clientObject; + + private NetworkAnalyticsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new NetworkAnalyticsMgmtClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()).subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval).buildClient(); + } + + /** + * Creates an instance of Network Analytics service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Network Analytics service API instance. + */ + public static NetworkAnalyticsManager 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 Network Analytics service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Network Analytics service API instance. + */ + public static NetworkAnalyticsManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new NetworkAnalyticsManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create NetworkAnalyticsManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new NetworkAnalyticsManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Network Analytics service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Network Analytics service API instance. + */ + public NetworkAnalyticsManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder.append("azsdk-java").append("-").append("com.azure.resourcemanager.networkanalytics") + .append("/").append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder.append(" (").append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ").append(Configuration.getGlobalConfiguration().get("os.name")).append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")).append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies.addAll(this.policies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY).collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])).build(); + return new NetworkAnalyticsManager(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 DataProducts. It manages DataProduct. + * + * @return Resource collection API of DataProducts. + */ + public DataProducts dataProducts() { + if (this.dataProducts == null) { + this.dataProducts = new DataProductsImpl(clientObject.getDataProducts(), this); + } + return dataProducts; + } + + /** + * Gets the resource collection API of DataProductsCatalogs. + * + * @return Resource collection API of DataProductsCatalogs. + */ + public DataProductsCatalogs dataProductsCatalogs() { + if (this.dataProductsCatalogs == null) { + this.dataProductsCatalogs = new DataProductsCatalogsImpl(clientObject.getDataProductsCatalogs(), this); + } + return dataProductsCatalogs; + } + + /** + * Gets the resource collection API of DataTypes. It manages DataType. + * + * @return Resource collection API of DataTypes. + */ + public DataTypes dataTypes() { + if (this.dataTypes == null) { + this.dataTypes = new DataTypesImpl(clientObject.getDataTypes(), this); + } + return dataTypes; + } + + /** + * Gets wrapped service client NetworkAnalyticsMgmtClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + * + * @return Wrapped service client NetworkAnalyticsMgmtClient. + */ + public NetworkAnalyticsMgmtClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/DataProductsCatalogsClient.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/DataProductsCatalogsClient.java new file mode 100644 index 000000000000..85fbcd14fac2 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/DataProductsCatalogsClient.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkanalytics.fluent.models.DataProductsCatalogInner; + +/** + * An instance of this class provides access to all the operations defined in DataProductsCatalogsClient. + */ +public interface DataProductsCatalogsClient { + /** + * List data catalog by 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 DataProductsCatalog list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List data catalog by 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 DataProductsCatalog list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List data catalog by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataProductsCatalog list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List data catalog by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataProductsCatalog list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve data type resource. + * + * @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 data catalog resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, Context context); + + /** + * Retrieve data type resource. + * + * @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 data catalog resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataProductsCatalogInner getByResourceGroup(String resourceGroupName); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/DataProductsClient.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/DataProductsClient.java new file mode 100644 index 000000000000..36d0fea6c0e4 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/DataProductsClient.java @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.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.networkanalytics.fluent.models.AccountSasTokenInner; +import com.azure.resourcemanager.networkanalytics.fluent.models.DataProductInner; +import com.azure.resourcemanager.networkanalytics.fluent.models.ListRoleAssignmentsInner; +import com.azure.resourcemanager.networkanalytics.fluent.models.RoleAssignmentDetailInner; +import com.azure.resourcemanager.networkanalytics.models.AccountSas; +import com.azure.resourcemanager.networkanalytics.models.DataProductUpdate; +import com.azure.resourcemanager.networkanalytics.models.KeyVaultInfo; +import com.azure.resourcemanager.networkanalytics.models.RoleAssignmentCommonProperties; + +/** + * An instance of this class provides access to all the operations defined in DataProductsClient. + */ +public interface DataProductsClient { + /** + * List data products by 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 DataProduct list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List data products by 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 DataProduct list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List data products by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataProduct list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List data products by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataProduct list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String dataProductName, + Context context); + + /** + * Retrieve data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataProductInner getByResourceGroup(String resourceGroupName, String dataProductName); + + /** + * Create data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the data product resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DataProductInner> beginCreate(String resourceGroupName, + String dataProductName, DataProductInner resource); + + /** + * Create data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the data product resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DataProductInner> beginCreate(String resourceGroupName, + String dataProductName, DataProductInner resource, Context context); + + /** + * Create data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataProductInner create(String resourceGroupName, String dataProductName, DataProductInner resource); + + /** + * Create data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataProductInner create(String resourceGroupName, String dataProductName, DataProductInner resource, + Context context); + + /** + * Update data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the data product resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DataProductInner> beginUpdate(String resourceGroupName, + String dataProductName, DataProductUpdate properties); + + /** + * Update data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the data product resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DataProductInner> beginUpdate(String resourceGroupName, + String dataProductName, DataProductUpdate properties, Context context); + + /** + * Update data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataProductInner update(String resourceGroupName, String dataProductName, DataProductUpdate properties); + + /** + * Update data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataProductInner update(String resourceGroupName, String dataProductName, DataProductUpdate properties, + Context context); + + /** + * Delete data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String dataProductName); + + /** + * Delete data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String dataProductName, Context context); + + /** + * Delete data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String dataProductName); + + /** + * Delete data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String dataProductName, Context context); + + /** + * Assign role to the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details for role assignment response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response addUserRoleWithResponse(String resourceGroupName, String dataProductName, + RoleAssignmentCommonProperties body, Context context); + + /** + * Assign role to the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details for role assignment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleAssignmentDetailInner addUserRole(String resourceGroupName, String dataProductName, + RoleAssignmentCommonProperties body); + + /** + * Generate sas token for storage account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of storage account sas token along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response generateStorageAccountSasTokenWithResponse(String resourceGroupName, + String dataProductName, AccountSas body, Context context); + + /** + * Generate sas token for storage account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of storage account sas token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccountSasTokenInner generateStorageAccountSasToken(String resourceGroupName, String dataProductName, + AccountSas body); + + /** + * List user roles associated with the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list role assignments along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listRolesAssignmentsWithResponse(String resourceGroupName, + String dataProductName, Object body, Context context); + + /** + * List user roles associated with the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list role assignments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ListRoleAssignmentsInner listRolesAssignments(String resourceGroupName, String dataProductName, Object body); + + /** + * Remove role from the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response removeUserRoleWithResponse(String resourceGroupName, String dataProductName, + RoleAssignmentDetailInner body, Context context); + + /** + * Remove role from the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void removeUserRole(String resourceGroupName, String dataProductName, RoleAssignmentDetailInner body); + + /** + * Initiate key rotation on Data Product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response rotateKeyWithResponse(String resourceGroupName, String dataProductName, KeyVaultInfo body, + Context context); + + /** + * Initiate key rotation on Data Product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void rotateKey(String resourceGroupName, String dataProductName, KeyVaultInfo body); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/DataTypesClient.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/DataTypesClient.java new file mode 100644 index 000000000000..11b92d53bb2d --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/DataTypesClient.java @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.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.networkanalytics.fluent.models.ContainerSasTokenInner; +import com.azure.resourcemanager.networkanalytics.fluent.models.DataTypeInner; +import com.azure.resourcemanager.networkanalytics.models.ContainerSaS; +import com.azure.resourcemanager.networkanalytics.models.DataTypeUpdate; + +/** + * An instance of this class provides access to all the operations defined in DataTypesClient. + */ +public interface DataTypesClient { + /** + * List data type by parent resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataType list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataProduct(String resourceGroupName, String dataProductName); + + /** + * List data type by parent resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataType list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataProduct(String resourceGroupName, String dataProductName, Context context); + + /** + * Retrieve data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String dataProductName, String dataTypeName, + Context context); + + /** + * Retrieve data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataTypeInner get(String resourceGroupName, String dataProductName, String dataTypeName); + + /** + * Create data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the data type resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DataTypeInner> beginCreate(String resourceGroupName, String dataProductName, + String dataTypeName, DataTypeInner resource); + + /** + * Create data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the data type resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DataTypeInner> beginCreate(String resourceGroupName, String dataProductName, + String dataTypeName, DataTypeInner resource, Context context); + + /** + * Create data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataTypeInner create(String resourceGroupName, String dataProductName, String dataTypeName, DataTypeInner resource); + + /** + * Create data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataTypeInner create(String resourceGroupName, String dataProductName, String dataTypeName, DataTypeInner resource, + Context context); + + /** + * Update data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the data type resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DataTypeInner> beginUpdate(String resourceGroupName, String dataProductName, + String dataTypeName, DataTypeUpdate properties); + + /** + * Update data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the data type resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DataTypeInner> beginUpdate(String resourceGroupName, String dataProductName, + String dataTypeName, DataTypeUpdate properties, Context context); + + /** + * Update data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataTypeInner update(String resourceGroupName, String dataProductName, String dataTypeName, + DataTypeUpdate properties); + + /** + * Update data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataTypeInner update(String resourceGroupName, String dataProductName, String dataTypeName, + DataTypeUpdate properties, Context context); + + /** + * Delete data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String dataProductName, + String dataTypeName); + + /** + * Delete data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String dataProductName, + String dataTypeName, Context context); + + /** + * Delete data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String dataProductName, String dataTypeName); + + /** + * Delete data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String dataProductName, String dataTypeName, Context context); + + /** + * Delete data for data type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteData(String resourceGroupName, String dataProductName, + String dataTypeName, Object body); + + /** + * Delete data for data type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteData(String resourceGroupName, String dataProductName, + String dataTypeName, Object body, Context context); + + /** + * Delete data for data type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteData(String resourceGroupName, String dataProductName, String dataTypeName, Object body); + + /** + * Delete data for data type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteData(String resourceGroupName, String dataProductName, String dataTypeName, Object body, + Context context); + + /** + * Generate sas token for storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of storage container account sas token along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response generateStorageContainerSasTokenWithResponse(String resourceGroupName, + String dataProductName, String dataTypeName, ContainerSaS body, Context context); + + /** + * Generate sas token for storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of storage container account sas token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerSasTokenInner generateStorageContainerSasToken(String resourceGroupName, String dataProductName, + String dataTypeName, ContainerSaS body); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/NetworkAnalyticsMgmtClient.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/NetworkAnalyticsMgmtClient.java new file mode 100644 index 000000000000..4346afd2cfc2 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/NetworkAnalyticsMgmtClient.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for NetworkAnalyticsMgmtClient class. + */ +public interface NetworkAnalyticsMgmtClient { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the DataProductsClient object to access its operations. + * + * @return the DataProductsClient object. + */ + DataProductsClient getDataProducts(); + + /** + * Gets the DataProductsCatalogsClient object to access its operations. + * + * @return the DataProductsCatalogsClient object. + */ + DataProductsCatalogsClient getDataProductsCatalogs(); + + /** + * Gets the DataTypesClient object to access its operations. + * + * @return the DataTypesClient object. + */ + DataTypesClient getDataTypes(); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/OperationsClient.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/OperationsClient.java new file mode 100644 index 000000000000..16e81341f5da --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/OperationsClient.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.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.networkanalytics.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/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/AccountSasTokenInner.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/AccountSasTokenInner.java new file mode 100644 index 000000000000..0f1de881cd87 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/AccountSasTokenInner.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of storage account sas token . + */ +@Fluent +public final class AccountSasTokenInner { + /* + * Field to specify storage account sas token. + */ + @JsonProperty(value = "storageAccountSasToken") + private String storageAccountSasToken; + + /** + * Creates an instance of AccountSasTokenInner class. + */ + public AccountSasTokenInner() { + } + + /** + * Get the storageAccountSasToken property: Field to specify storage account sas token. + * + * @return the storageAccountSasToken value. + */ + public String storageAccountSasToken() { + return this.storageAccountSasToken; + } + + /** + * Set the storageAccountSasToken property: Field to specify storage account sas token. + * + * @param storageAccountSasToken the storageAccountSasToken value to set. + * @return the AccountSasTokenInner object itself. + */ + public AccountSasTokenInner withStorageAccountSasToken(String storageAccountSasToken) { + this.storageAccountSasToken = storageAccountSasToken; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageAccountSasToken() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property storageAccountSasToken in model AccountSasTokenInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AccountSasTokenInner.class); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/ContainerSasTokenInner.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/ContainerSasTokenInner.java new file mode 100644 index 000000000000..2605e2bdeb8f --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/ContainerSasTokenInner.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of storage container account sas token . + */ +@Fluent +public final class ContainerSasTokenInner { + /* + * Field to specify storage container sas token. + */ + @JsonProperty(value = "storageContainerSasToken") + private String storageContainerSasToken; + + /** + * Creates an instance of ContainerSasTokenInner class. + */ + public ContainerSasTokenInner() { + } + + /** + * Get the storageContainerSasToken property: Field to specify storage container sas token. + * + * @return the storageContainerSasToken value. + */ + public String storageContainerSasToken() { + return this.storageContainerSasToken; + } + + /** + * Set the storageContainerSasToken property: Field to specify storage container sas token. + * + * @param storageContainerSasToken the storageContainerSasToken value to set. + * @return the ContainerSasTokenInner object itself. + */ + public ContainerSasTokenInner withStorageContainerSasToken(String storageContainerSasToken) { + this.storageContainerSasToken = storageContainerSasToken; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageContainerSasToken() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property storageContainerSasToken in model ContainerSasTokenInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerSasTokenInner.class); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/DataProductInner.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/DataProductInner.java new file mode 100644 index 000000000000..638b2cd83b66 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/DataProductInner.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.networkanalytics.models.DataProductProperties; +import com.azure.resourcemanager.networkanalytics.models.ManagedServiceIdentity; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * The data product resource. + */ +@Fluent +public final class DataProductInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + @JsonProperty(value = "properties") + private DataProductProperties properties; + + /* + * The managed service identities assigned to this resource. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Creates an instance of DataProductInner class. + */ + public DataProductInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public DataProductProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the DataProductInner object itself. + */ + public DataProductInner withProperties(DataProductProperties 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 DataProductInner object itself. + */ + public DataProductInner 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; + } + + /** + * {@inheritDoc} + */ + @Override + public DataProductInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DataProductInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/DataProductsCatalogInner.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/DataProductsCatalogInner.java new file mode 100644 index 000000000000..b4e3467554dd --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/DataProductsCatalogInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.networkanalytics.models.DataProductsCatalogProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The data catalog resource. + */ +@Fluent +public final class DataProductsCatalogInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + @JsonProperty(value = "properties") + private DataProductsCatalogProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Creates an instance of DataProductsCatalogInner class. + */ + public DataProductsCatalogInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public DataProductsCatalogProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the DataProductsCatalogInner object itself. + */ + public DataProductsCatalogInner withProperties(DataProductsCatalogProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/DataTypeInner.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/DataTypeInner.java new file mode 100644 index 000000000000..414722f2786f --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/DataTypeInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.networkanalytics.models.DataTypeProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The data type resource. + */ +@Fluent +public final class DataTypeInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + @JsonProperty(value = "properties") + private DataTypeProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Creates an instance of DataTypeInner class. + */ + public DataTypeInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public DataTypeProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the DataTypeInner object itself. + */ + public DataTypeInner withProperties(DataTypeProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/ListRoleAssignmentsInner.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/ListRoleAssignmentsInner.java new file mode 100644 index 000000000000..869b0e05bd1c --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/ListRoleAssignmentsInner.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * list role assignments. + */ +@Fluent +public final class ListRoleAssignmentsInner { + /* + * Count of role assignments. + */ + @JsonProperty(value = "count", required = true) + private int count; + + /* + * list of role assignments + */ + @JsonProperty(value = "roleAssignmentResponse", required = true) + private List roleAssignmentResponse; + + /** + * Creates an instance of ListRoleAssignmentsInner class. + */ + public ListRoleAssignmentsInner() { + } + + /** + * Get the count property: Count of role assignments. + * + * @return the count value. + */ + public int count() { + return this.count; + } + + /** + * Set the count property: Count of role assignments. + * + * @param count the count value to set. + * @return the ListRoleAssignmentsInner object itself. + */ + public ListRoleAssignmentsInner withCount(int count) { + this.count = count; + return this; + } + + /** + * Get the roleAssignmentResponse property: list of role assignments. + * + * @return the roleAssignmentResponse value. + */ + public List roleAssignmentResponse() { + return this.roleAssignmentResponse; + } + + /** + * Set the roleAssignmentResponse property: list of role assignments. + * + * @param roleAssignmentResponse the roleAssignmentResponse value to set. + * @return the ListRoleAssignmentsInner object itself. + */ + public ListRoleAssignmentsInner withRoleAssignmentResponse(List roleAssignmentResponse) { + this.roleAssignmentResponse = roleAssignmentResponse; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (roleAssignmentResponse() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property roleAssignmentResponse in model ListRoleAssignmentsInner")); + } else { + roleAssignmentResponse().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ListRoleAssignmentsInner.class); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/OperationInner.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/OperationInner.java new file mode 100644 index 000000000000..a5190e2372fc --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/OperationInner.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkanalytics.models.ActionType; +import com.azure.resourcemanager.networkanalytics.models.OperationDisplay; +import com.azure.resourcemanager.networkanalytics.models.Origin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Fluent +public final class OperationInner { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for + * ARM/control-plane operations. + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + @JsonProperty(value = "display") + 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" + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) + private ActionType actionType; + + /** + * Creates an instance of OperationInner class. + */ + public OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/RoleAssignmentDetailInner.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/RoleAssignmentDetailInner.java new file mode 100644 index 000000000000..f434d38ef789 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/RoleAssignmentDetailInner.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkanalytics.models.DataProductUserRole; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The details for role assignment response. + */ +@Fluent +public final class RoleAssignmentDetailInner { + /* + * Role Id of the Built-In Role + */ + @JsonProperty(value = "roleId", required = true) + private String roleId; + + /* + * Object ID of the AAD principal or security-group. + */ + @JsonProperty(value = "principalId", required = true) + private String principalId; + + /* + * User name. + */ + @JsonProperty(value = "userName", required = true) + private String username; + + /* + * Data Type Scope at which the role assignment is created. + */ + @JsonProperty(value = "dataTypeScope", required = true) + private List dataTypeScope; + + /* + * Type of the principal Id: User, Group or ServicePrincipal + */ + @JsonProperty(value = "principalType", required = true) + private String principalType; + + /* + * Data Product role to be assigned to a user. + */ + @JsonProperty(value = "role", required = true) + private DataProductUserRole role; + + /* + * Id of role assignment request + */ + @JsonProperty(value = "roleAssignmentId", required = true) + private String roleAssignmentId; + + /** + * Creates an instance of RoleAssignmentDetailInner class. + */ + public RoleAssignmentDetailInner() { + } + + /** + * Get the roleId property: Role Id of the Built-In Role. + * + * @return the roleId value. + */ + public String roleId() { + return this.roleId; + } + + /** + * Set the roleId property: Role Id of the Built-In Role. + * + * @param roleId the roleId value to set. + * @return the RoleAssignmentDetailInner object itself. + */ + public RoleAssignmentDetailInner withRoleId(String roleId) { + this.roleId = roleId; + return this; + } + + /** + * Get the principalId property: Object ID of the AAD principal or security-group. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: Object ID of the AAD principal or security-group. + * + * @param principalId the principalId value to set. + * @return the RoleAssignmentDetailInner object itself. + */ + public RoleAssignmentDetailInner withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the username property: User name. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: User name. + * + * @param username the username value to set. + * @return the RoleAssignmentDetailInner object itself. + */ + public RoleAssignmentDetailInner withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the dataTypeScope property: Data Type Scope at which the role assignment is created. + * + * @return the dataTypeScope value. + */ + public List dataTypeScope() { + return this.dataTypeScope; + } + + /** + * Set the dataTypeScope property: Data Type Scope at which the role assignment is created. + * + * @param dataTypeScope the dataTypeScope value to set. + * @return the RoleAssignmentDetailInner object itself. + */ + public RoleAssignmentDetailInner withDataTypeScope(List dataTypeScope) { + this.dataTypeScope = dataTypeScope; + return this; + } + + /** + * Get the principalType property: Type of the principal Id: User, Group or ServicePrincipal. + * + * @return the principalType value. + */ + public String principalType() { + return this.principalType; + } + + /** + * Set the principalType property: Type of the principal Id: User, Group or ServicePrincipal. + * + * @param principalType the principalType value to set. + * @return the RoleAssignmentDetailInner object itself. + */ + public RoleAssignmentDetailInner withPrincipalType(String principalType) { + this.principalType = principalType; + return this; + } + + /** + * Get the role property: Data Product role to be assigned to a user. + * + * @return the role value. + */ + public DataProductUserRole role() { + return this.role; + } + + /** + * Set the role property: Data Product role to be assigned to a user. + * + * @param role the role value to set. + * @return the RoleAssignmentDetailInner object itself. + */ + public RoleAssignmentDetailInner withRole(DataProductUserRole role) { + this.role = role; + return this; + } + + /** + * Get the roleAssignmentId property: Id of role assignment request. + * + * @return the roleAssignmentId value. + */ + public String roleAssignmentId() { + return this.roleAssignmentId; + } + + /** + * Set the roleAssignmentId property: Id of role assignment request. + * + * @param roleAssignmentId the roleAssignmentId value to set. + * @return the RoleAssignmentDetailInner object itself. + */ + public RoleAssignmentDetailInner withRoleAssignmentId(String roleAssignmentId) { + this.roleAssignmentId = roleAssignmentId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (roleId() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property roleId in model RoleAssignmentDetailInner")); + } + if (principalId() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property principalId in model RoleAssignmentDetailInner")); + } + if (username() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property username in model RoleAssignmentDetailInner")); + } + if (dataTypeScope() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property dataTypeScope in model RoleAssignmentDetailInner")); + } + if (principalType() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property principalType in model RoleAssignmentDetailInner")); + } + if (role() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property role in model RoleAssignmentDetailInner")); + } + if (roleAssignmentId() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property roleAssignmentId in model RoleAssignmentDetailInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RoleAssignmentDetailInner.class); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/package-info.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/package-info.java new file mode 100644 index 000000000000..e1f6bff75f08 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for NetworkAnalyticsMgmtClient. + * null. + */ +package com.azure.resourcemanager.networkanalytics.fluent.models; diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/package-info.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/package-info.java new file mode 100644 index 000000000000..50e85cb1a400 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for NetworkAnalyticsMgmtClient. + * null. + */ +package com.azure.resourcemanager.networkanalytics.fluent; diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/AccountSasTokenImpl.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/AccountSasTokenImpl.java new file mode 100644 index 000000000000..58ff79c1ce03 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/AccountSasTokenImpl.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.implementation; + +import com.azure.resourcemanager.networkanalytics.fluent.models.AccountSasTokenInner; +import com.azure.resourcemanager.networkanalytics.models.AccountSasToken; + +public final class AccountSasTokenImpl implements AccountSasToken { + private AccountSasTokenInner innerObject; + + private final com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager serviceManager; + + AccountSasTokenImpl(AccountSasTokenInner innerObject, + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String storageAccountSasToken() { + return this.innerModel().storageAccountSasToken(); + } + + public AccountSasTokenInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/ContainerSasTokenImpl.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/ContainerSasTokenImpl.java new file mode 100644 index 000000000000..cacf8488a1e0 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/ContainerSasTokenImpl.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.implementation; + +import com.azure.resourcemanager.networkanalytics.fluent.models.ContainerSasTokenInner; +import com.azure.resourcemanager.networkanalytics.models.ContainerSasToken; + +public final class ContainerSasTokenImpl implements ContainerSasToken { + private ContainerSasTokenInner innerObject; + + private final com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager serviceManager; + + ContainerSasTokenImpl(ContainerSasTokenInner innerObject, + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String storageContainerSasToken() { + return this.innerModel().storageContainerSasToken(); + } + + public ContainerSasTokenInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataProductImpl.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataProductImpl.java new file mode 100644 index 000000000000..090206e5b4e2 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataProductImpl.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.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.networkanalytics.fluent.models.DataProductInner; +import com.azure.resourcemanager.networkanalytics.fluent.models.RoleAssignmentDetailInner; +import com.azure.resourcemanager.networkanalytics.models.AccountSas; +import com.azure.resourcemanager.networkanalytics.models.AccountSasToken; +import com.azure.resourcemanager.networkanalytics.models.DataProduct; +import com.azure.resourcemanager.networkanalytics.models.DataProductProperties; +import com.azure.resourcemanager.networkanalytics.models.DataProductUpdate; +import com.azure.resourcemanager.networkanalytics.models.DataProductUpdateProperties; +import com.azure.resourcemanager.networkanalytics.models.KeyVaultInfo; +import com.azure.resourcemanager.networkanalytics.models.ListRoleAssignments; +import com.azure.resourcemanager.networkanalytics.models.ManagedServiceIdentity; +import com.azure.resourcemanager.networkanalytics.models.RoleAssignmentCommonProperties; +import com.azure.resourcemanager.networkanalytics.models.RoleAssignmentDetail; +import java.util.Collections; +import java.util.Map; + +public final class DataProductImpl implements DataProduct, DataProduct.Definition, DataProduct.Update { + private DataProductInner innerObject; + + private final com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager 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 DataProductProperties 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 DataProductInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String dataProductName; + + private DataProductUpdate updateProperties; + + public DataProductImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DataProduct create() { + this.innerObject = serviceManager.serviceClient().getDataProducts().create(resourceGroupName, dataProductName, + this.innerModel(), Context.NONE); + return this; + } + + public DataProduct create(Context context) { + this.innerObject = serviceManager.serviceClient().getDataProducts().create(resourceGroupName, dataProductName, + this.innerModel(), context); + return this; + } + + DataProductImpl(String name, com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager serviceManager) { + this.innerObject = new DataProductInner(); + this.serviceManager = serviceManager; + this.dataProductName = name; + } + + public DataProductImpl update() { + this.updateProperties = new DataProductUpdate(); + return this; + } + + public DataProduct apply() { + this.innerObject = serviceManager.serviceClient().getDataProducts().update(resourceGroupName, dataProductName, + updateProperties, Context.NONE); + return this; + } + + public DataProduct apply(Context context) { + this.innerObject = serviceManager.serviceClient().getDataProducts().update(resourceGroupName, dataProductName, + updateProperties, context); + return this; + } + + DataProductImpl(DataProductInner innerObject, + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.dataProductName = Utils.getValueFromIdByName(innerObject.id(), "dataProducts"); + } + + public DataProduct refresh() { + this.innerObject = serviceManager.serviceClient().getDataProducts() + .getByResourceGroupWithResponse(resourceGroupName, dataProductName, Context.NONE).getValue(); + return this; + } + + public DataProduct refresh(Context context) { + this.innerObject = serviceManager.serviceClient().getDataProducts() + .getByResourceGroupWithResponse(resourceGroupName, dataProductName, context).getValue(); + return this; + } + + public Response addUserRoleWithResponse(RoleAssignmentCommonProperties body, + Context context) { + return serviceManager.dataProducts().addUserRoleWithResponse(resourceGroupName, dataProductName, body, context); + } + + public RoleAssignmentDetail addUserRole(RoleAssignmentCommonProperties body) { + return serviceManager.dataProducts().addUserRole(resourceGroupName, dataProductName, body); + } + + public Response generateStorageAccountSasTokenWithResponse(AccountSas body, Context context) { + return serviceManager.dataProducts().generateStorageAccountSasTokenWithResponse(resourceGroupName, + dataProductName, body, context); + } + + public AccountSasToken generateStorageAccountSasToken(AccountSas body) { + return serviceManager.dataProducts().generateStorageAccountSasToken(resourceGroupName, dataProductName, body); + } + + public Response listRolesAssignmentsWithResponse(Object body, Context context) { + return serviceManager.dataProducts().listRolesAssignmentsWithResponse(resourceGroupName, dataProductName, body, + context); + } + + public ListRoleAssignments listRolesAssignments(Object body) { + return serviceManager.dataProducts().listRolesAssignments(resourceGroupName, dataProductName, body); + } + + public Response removeUserRoleWithResponse(RoleAssignmentDetailInner body, Context context) { + return serviceManager.dataProducts().removeUserRoleWithResponse(resourceGroupName, dataProductName, body, + context); + } + + public void removeUserRole(RoleAssignmentDetailInner body) { + serviceManager.dataProducts().removeUserRole(resourceGroupName, dataProductName, body); + } + + public Response rotateKeyWithResponse(KeyVaultInfo body, Context context) { + return serviceManager.dataProducts().rotateKeyWithResponse(resourceGroupName, dataProductName, body, context); + } + + public void rotateKey(KeyVaultInfo body) { + serviceManager.dataProducts().rotateKey(resourceGroupName, dataProductName, body); + } + + public DataProductImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DataProductImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DataProductImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public DataProductImpl withProperties(DataProductProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public DataProductImpl withIdentity(ManagedServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateProperties.withIdentity(identity); + return this; + } + } + + public DataProductImpl withProperties(DataProductUpdateProperties properties) { + this.updateProperties.withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataProductsCatalogImpl.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataProductsCatalogImpl.java new file mode 100644 index 000000000000..22546497f6bd --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataProductsCatalogImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.networkanalytics.fluent.models.DataProductsCatalogInner; +import com.azure.resourcemanager.networkanalytics.models.DataProductsCatalog; +import com.azure.resourcemanager.networkanalytics.models.DataProductsCatalogProperties; + +public final class DataProductsCatalogImpl implements DataProductsCatalog { + private DataProductsCatalogInner innerObject; + + private final com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager serviceManager; + + DataProductsCatalogImpl(DataProductsCatalogInner innerObject, + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public DataProductsCatalogProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DataProductsCatalogInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataProductsCatalogsClientImpl.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataProductsCatalogsClientImpl.java new file mode 100644 index 000000000000..3afa90e3fb9f --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataProductsCatalogsClientImpl.java @@ -0,0 +1,570 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.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.networkanalytics.fluent.DataProductsCatalogsClient; +import com.azure.resourcemanager.networkanalytics.fluent.models.DataProductsCatalogInner; +import com.azure.resourcemanager.networkanalytics.models.DataProductsCatalogListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DataProductsCatalogsClient. + */ +public final class DataProductsCatalogsClientImpl implements DataProductsCatalogsClient { + /** + * The proxy service used to perform REST calls. + */ + private final DataProductsCatalogsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkAnalyticsMgmtClientImpl client; + + /** + * Initializes an instance of DataProductsCatalogsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataProductsCatalogsClientImpl(NetworkAnalyticsMgmtClientImpl client) { + this.service = RestProxy.create(DataProductsCatalogsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkAnalyticsMgmtClientDataProductsCatalogs to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkAnalyticsMgmt") + public interface DataProductsCatalogsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.NetworkAnalytics/dataProductsCatalogs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkAnalytics/dataProductsCatalogs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkAnalytics/dataProductsCatalogs/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List data catalog by 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 DataProductsCatalog list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List data catalog by 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 DataProductsCatalog list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List data catalog by 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 DataProductsCatalog list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List data catalog by 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 DataProductsCatalog list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List data catalog by 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 DataProductsCatalog list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List data catalog by 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 DataProductsCatalog list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List data catalog by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataProductsCatalog list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List data catalog by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataProductsCatalog list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List data catalog by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataProductsCatalog 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)); + } + + /** + * List data catalog by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataProductsCatalog list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List data catalog by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataProductsCatalog list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List data catalog by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataProductsCatalog list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieve data type resource. + * + * @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 data catalog resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve data type resource. + * + * @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 data catalog resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context); + } + + /** + * Retrieve data type resource. + * + * @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 data catalog resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName) { + return getByResourceGroupWithResponseAsync(resourceGroupName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve data type resource. + * + * @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 data catalog resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, context).block(); + } + + /** + * Retrieve data type resource. + * + * @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 data catalog resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataProductsCatalogInner getByResourceGroup(String resourceGroupName) { + return getByResourceGroupWithResponse(resourceGroupName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 DataProductsCatalog list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 DataProductsCatalog list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> 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 + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 DataProductsCatalog list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 DataProductsCatalog list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataProductsCatalogsImpl.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataProductsCatalogsImpl.java new file mode 100644 index 000000000000..0942703a3e8c --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataProductsCatalogsImpl.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.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.networkanalytics.fluent.DataProductsCatalogsClient; +import com.azure.resourcemanager.networkanalytics.fluent.models.DataProductsCatalogInner; +import com.azure.resourcemanager.networkanalytics.models.DataProductsCatalog; +import com.azure.resourcemanager.networkanalytics.models.DataProductsCatalogs; + +public final class DataProductsCatalogsImpl implements DataProductsCatalogs { + private static final ClientLogger LOGGER = new ClientLogger(DataProductsCatalogsImpl.class); + + private final DataProductsCatalogsClient innerClient; + + private final com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager serviceManager; + + public DataProductsCatalogsImpl(DataProductsCatalogsClient innerClient, + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new DataProductsCatalogImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new DataProductsCatalogImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new DataProductsCatalogImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new DataProductsCatalogImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DataProductsCatalogImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DataProductsCatalog getByResourceGroup(String resourceGroupName) { + DataProductsCatalogInner inner = this.serviceClient().getByResourceGroup(resourceGroupName); + if (inner != null) { + return new DataProductsCatalogImpl(inner, this.manager()); + } else { + return null; + } + } + + private DataProductsCatalogsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataProductsClientImpl.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataProductsClientImpl.java new file mode 100644 index 000000000000..58bdfc22321f --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataProductsClientImpl.java @@ -0,0 +1,2033 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.networkanalytics.fluent.DataProductsClient; +import com.azure.resourcemanager.networkanalytics.fluent.models.AccountSasTokenInner; +import com.azure.resourcemanager.networkanalytics.fluent.models.DataProductInner; +import com.azure.resourcemanager.networkanalytics.fluent.models.ListRoleAssignmentsInner; +import com.azure.resourcemanager.networkanalytics.fluent.models.RoleAssignmentDetailInner; +import com.azure.resourcemanager.networkanalytics.models.AccountSas; +import com.azure.resourcemanager.networkanalytics.models.DataProductListResult; +import com.azure.resourcemanager.networkanalytics.models.DataProductUpdate; +import com.azure.resourcemanager.networkanalytics.models.KeyVaultInfo; +import com.azure.resourcemanager.networkanalytics.models.RoleAssignmentCommonProperties; +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 DataProductsClient. + */ +public final class DataProductsClientImpl implements DataProductsClient { + /** + * The proxy service used to perform REST calls. + */ + private final DataProductsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkAnalyticsMgmtClientImpl client; + + /** + * Initializes an instance of DataProductsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataProductsClientImpl(NetworkAnalyticsMgmtClientImpl client) { + this.service + = RestProxy.create(DataProductsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkAnalyticsMgmtClientDataProducts to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkAnalyticsMgmt") + public interface DataProductsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.NetworkAnalytics/dataProducts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkAnalytics/dataProducts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkAnalytics/dataProducts/{dataProductName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataProductName") String dataProductName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkAnalytics/dataProducts/{dataProductName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataProductName") String dataProductName, + @BodyParam("application/json") DataProductInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkAnalytics/dataProducts/{dataProductName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataProductName") String dataProductName, + @BodyParam("application/json") DataProductUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkAnalytics/dataProducts/{dataProductName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataProductName") String dataProductName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkAnalytics/dataProducts/{dataProductName}/addUserRole") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> addUserRole(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataProductName") String dataProductName, + @BodyParam("application/json") RoleAssignmentCommonProperties body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkAnalytics/dataProducts/{dataProductName}/generateStorageAccountSasToken") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> generateStorageAccountSasToken(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataProductName") String dataProductName, @BodyParam("application/json") AccountSas body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkAnalytics/dataProducts/{dataProductName}/listRolesAssignments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listRolesAssignments(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataProductName") String dataProductName, @BodyParam("application/json") Object body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkAnalytics/dataProducts/{dataProductName}/removeUserRole") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> removeUserRole(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataProductName") String dataProductName, + @BodyParam("application/json") RoleAssignmentDetailInner body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkAnalytics/dataProducts/{dataProductName}/rotateKey") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> rotateKey(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataProductName") String dataProductName, @BodyParam("application/json") KeyVaultInfo body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List data products by 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 DataProduct list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List data products by 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 DataProduct list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List data products by 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 DataProduct list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List data products by 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 DataProduct list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List data products by 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 DataProduct list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List data products by 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 DataProduct list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List data products by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataProduct list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List data products by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataProduct list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List data products by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataProduct 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)); + } + + /** + * List data products by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataProduct list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List data products by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataProduct list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List data products by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataProduct list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieve data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String dataProductName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dataProductName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String dataProductName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dataProductName, accept, context); + } + + /** + * Retrieve data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String dataProductName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, dataProductName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String dataProductName, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, dataProductName, context).block(); + } + + /** + * Retrieve data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataProductInner getByResourceGroup(String resourceGroupName, String dataProductName) { + return getByResourceGroupWithResponse(resourceGroupName, dataProductName, Context.NONE).getValue(); + } + + /** + * Create data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String dataProductName, + DataProductInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dataProductName, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String dataProductName, + DataProductInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, dataProductName, resource, accept, context); + } + + /** + * Create data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the data product resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DataProductInner> beginCreateAsync(String resourceGroupName, + String dataProductName, DataProductInner resource) { + Mono>> mono = createWithResponseAsync(resourceGroupName, dataProductName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DataProductInner.class, DataProductInner.class, this.client.getContext()); + } + + /** + * Create data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the data product resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DataProductInner> beginCreateAsync(String resourceGroupName, + String dataProductName, DataProductInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, dataProductName, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DataProductInner.class, DataProductInner.class, context); + } + + /** + * Create data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the data product resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DataProductInner> beginCreate(String resourceGroupName, + String dataProductName, DataProductInner resource) { + return this.beginCreateAsync(resourceGroupName, dataProductName, resource).getSyncPoller(); + } + + /** + * Create data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the data product resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DataProductInner> beginCreate(String resourceGroupName, + String dataProductName, DataProductInner resource, Context context) { + return this.beginCreateAsync(resourceGroupName, dataProductName, resource, context).getSyncPoller(); + } + + /** + * Create data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String dataProductName, + DataProductInner resource) { + return beginCreateAsync(resourceGroupName, dataProductName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String dataProductName, + DataProductInner resource, Context context) { + return beginCreateAsync(resourceGroupName, dataProductName, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataProductInner create(String resourceGroupName, String dataProductName, DataProductInner resource) { + return createAsync(resourceGroupName, dataProductName, resource).block(); + } + + /** + * Create data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataProductInner create(String resourceGroupName, String dataProductName, DataProductInner resource, + Context context) { + return createAsync(resourceGroupName, dataProductName, resource, context).block(); + } + + /** + * Update data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String dataProductName, + DataProductUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dataProductName, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String dataProductName, + DataProductUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, dataProductName, properties, accept, context); + } + + /** + * Update data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the data product resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DataProductInner> beginUpdateAsync(String resourceGroupName, + String dataProductName, DataProductUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, dataProductName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DataProductInner.class, DataProductInner.class, this.client.getContext()); + } + + /** + * Update data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the data product resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DataProductInner> beginUpdateAsync(String resourceGroupName, + String dataProductName, DataProductUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, dataProductName, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DataProductInner.class, DataProductInner.class, context); + } + + /** + * Update data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the data product resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DataProductInner> beginUpdate(String resourceGroupName, + String dataProductName, DataProductUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, dataProductName, properties).getSyncPoller(); + } + + /** + * Update data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the data product resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DataProductInner> beginUpdate(String resourceGroupName, + String dataProductName, DataProductUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, dataProductName, properties, context).getSyncPoller(); + } + + /** + * Update data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String dataProductName, + DataProductUpdate properties) { + return beginUpdateAsync(resourceGroupName, dataProductName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String dataProductName, + DataProductUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, dataProductName, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataProductInner update(String resourceGroupName, String dataProductName, DataProductUpdate properties) { + return updateAsync(resourceGroupName, dataProductName, properties).block(); + } + + /** + * Update data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataProductInner update(String resourceGroupName, String dataProductName, DataProductUpdate properties, + Context context) { + return updateAsync(resourceGroupName, dataProductName, properties, context).block(); + } + + /** + * Delete data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String dataProductName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dataProductName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String dataProductName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, dataProductName, accept, context); + } + + /** + * Delete data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String dataProductName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, dataProductName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String dataProductName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, dataProductName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String dataProductName) { + return this.beginDeleteAsync(resourceGroupName, dataProductName).getSyncPoller(); + } + + /** + * Delete data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String dataProductName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, dataProductName, context).getSyncPoller(); + } + + /** + * Delete data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String dataProductName) { + return beginDeleteAsync(resourceGroupName, dataProductName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String dataProductName, Context context) { + return beginDeleteAsync(resourceGroupName, dataProductName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String dataProductName) { + deleteAsync(resourceGroupName, dataProductName).block(); + } + + /** + * Delete data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String dataProductName, Context context) { + deleteAsync(resourceGroupName, dataProductName, context).block(); + } + + /** + * Assign role to the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details for role assignment response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> addUserRoleWithResponseAsync(String resourceGroupName, + String dataProductName, RoleAssignmentCommonProperties body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.addUserRole(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dataProductName, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Assign role to the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details for role assignment response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> addUserRoleWithResponseAsync(String resourceGroupName, + String dataProductName, RoleAssignmentCommonProperties body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.addUserRole(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dataProductName, body, accept, context); + } + + /** + * Assign role to the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details for role assignment response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono addUserRoleAsync(String resourceGroupName, String dataProductName, + RoleAssignmentCommonProperties body) { + return addUserRoleWithResponseAsync(resourceGroupName, dataProductName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Assign role to the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details for role assignment response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addUserRoleWithResponse(String resourceGroupName, String dataProductName, + RoleAssignmentCommonProperties body, Context context) { + return addUserRoleWithResponseAsync(resourceGroupName, dataProductName, body, context).block(); + } + + /** + * Assign role to the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details for role assignment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleAssignmentDetailInner addUserRole(String resourceGroupName, String dataProductName, + RoleAssignmentCommonProperties body) { + return addUserRoleWithResponse(resourceGroupName, dataProductName, body, Context.NONE).getValue(); + } + + /** + * Generate sas token for storage account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of storage account sas token along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateStorageAccountSasTokenWithResponseAsync( + String resourceGroupName, String dataProductName, AccountSas body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.generateStorageAccountSasToken(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, dataProductName, body, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate sas token for storage account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of storage account sas token along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateStorageAccountSasTokenWithResponseAsync( + String resourceGroupName, String dataProductName, AccountSas body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.generateStorageAccountSasToken(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dataProductName, body, accept, context); + } + + /** + * Generate sas token for storage account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of storage account sas token on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateStorageAccountSasTokenAsync(String resourceGroupName, + String dataProductName, AccountSas body) { + return generateStorageAccountSasTokenWithResponseAsync(resourceGroupName, dataProductName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Generate sas token for storage account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of storage account sas token along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response generateStorageAccountSasTokenWithResponse(String resourceGroupName, + String dataProductName, AccountSas body, Context context) { + return generateStorageAccountSasTokenWithResponseAsync(resourceGroupName, dataProductName, body, context) + .block(); + } + + /** + * Generate sas token for storage account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of storage account sas token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccountSasTokenInner generateStorageAccountSasToken(String resourceGroupName, String dataProductName, + AccountSas body) { + return generateStorageAccountSasTokenWithResponse(resourceGroupName, dataProductName, body, Context.NONE) + .getValue(); + } + + /** + * List user roles associated with the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list role assignments along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRolesAssignmentsWithResponseAsync(String resourceGroupName, + String dataProductName, Object body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listRolesAssignments(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dataProductName, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List user roles associated with the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list role assignments along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRolesAssignmentsWithResponseAsync(String resourceGroupName, + String dataProductName, Object body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listRolesAssignments(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dataProductName, body, accept, context); + } + + /** + * List user roles associated with the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list role assignments on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listRolesAssignmentsAsync(String resourceGroupName, String dataProductName, + Object body) { + return listRolesAssignmentsWithResponseAsync(resourceGroupName, dataProductName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List user roles associated with the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list role assignments along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listRolesAssignmentsWithResponse(String resourceGroupName, + String dataProductName, Object body, Context context) { + return listRolesAssignmentsWithResponseAsync(resourceGroupName, dataProductName, body, context).block(); + } + + /** + * List user roles associated with the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list role assignments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ListRoleAssignmentsInner listRolesAssignments(String resourceGroupName, String dataProductName, + Object body) { + return listRolesAssignmentsWithResponse(resourceGroupName, dataProductName, body, Context.NONE).getValue(); + } + + /** + * Remove role from the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> removeUserRoleWithResponseAsync(String resourceGroupName, String dataProductName, + RoleAssignmentDetailInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.removeUserRole(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dataProductName, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Remove role from the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> removeUserRoleWithResponseAsync(String resourceGroupName, String dataProductName, + RoleAssignmentDetailInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.removeUserRole(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dataProductName, body, accept, context); + } + + /** + * Remove role from the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono removeUserRoleAsync(String resourceGroupName, String dataProductName, + RoleAssignmentDetailInner body) { + return removeUserRoleWithResponseAsync(resourceGroupName, dataProductName, body) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Remove role from the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response removeUserRoleWithResponse(String resourceGroupName, String dataProductName, + RoleAssignmentDetailInner body, Context context) { + return removeUserRoleWithResponseAsync(resourceGroupName, dataProductName, body, context).block(); + } + + /** + * Remove role from the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void removeUserRole(String resourceGroupName, String dataProductName, RoleAssignmentDetailInner body) { + removeUserRoleWithResponse(resourceGroupName, dataProductName, body, Context.NONE); + } + + /** + * Initiate key rotation on Data Product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> rotateKeyWithResponseAsync(String resourceGroupName, String dataProductName, + KeyVaultInfo body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.rotateKey(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dataProductName, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Initiate key rotation on Data Product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> rotateKeyWithResponseAsync(String resourceGroupName, String dataProductName, + KeyVaultInfo body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.rotateKey(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dataProductName, body, accept, context); + } + + /** + * Initiate key rotation on Data Product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rotateKeyAsync(String resourceGroupName, String dataProductName, KeyVaultInfo body) { + return rotateKeyWithResponseAsync(resourceGroupName, dataProductName, body).flatMap(ignored -> Mono.empty()); + } + + /** + * Initiate key rotation on Data Product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response rotateKeyWithResponse(String resourceGroupName, String dataProductName, KeyVaultInfo body, + Context context) { + return rotateKeyWithResponseAsync(resourceGroupName, dataProductName, body, context).block(); + } + + /** + * Initiate key rotation on Data Product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void rotateKey(String resourceGroupName, String dataProductName, KeyVaultInfo body) { + rotateKeyWithResponse(resourceGroupName, dataProductName, body, Context.NONE); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 DataProduct list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 DataProduct list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> 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 + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 DataProduct list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 DataProduct list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataProductsImpl.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataProductsImpl.java new file mode 100644 index 000000000000..42ff2e765e6d --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataProductsImpl.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.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.networkanalytics.fluent.DataProductsClient; +import com.azure.resourcemanager.networkanalytics.fluent.models.AccountSasTokenInner; +import com.azure.resourcemanager.networkanalytics.fluent.models.DataProductInner; +import com.azure.resourcemanager.networkanalytics.fluent.models.ListRoleAssignmentsInner; +import com.azure.resourcemanager.networkanalytics.fluent.models.RoleAssignmentDetailInner; +import com.azure.resourcemanager.networkanalytics.models.AccountSas; +import com.azure.resourcemanager.networkanalytics.models.AccountSasToken; +import com.azure.resourcemanager.networkanalytics.models.DataProduct; +import com.azure.resourcemanager.networkanalytics.models.DataProducts; +import com.azure.resourcemanager.networkanalytics.models.KeyVaultInfo; +import com.azure.resourcemanager.networkanalytics.models.ListRoleAssignments; +import com.azure.resourcemanager.networkanalytics.models.RoleAssignmentCommonProperties; +import com.azure.resourcemanager.networkanalytics.models.RoleAssignmentDetail; + +public final class DataProductsImpl implements DataProducts { + private static final ClientLogger LOGGER = new ClientLogger(DataProductsImpl.class); + + private final DataProductsClient innerClient; + + private final com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager serviceManager; + + public DataProductsImpl(DataProductsClient innerClient, + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new DataProductImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new DataProductImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new DataProductImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new DataProductImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String dataProductName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, dataProductName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DataProductImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DataProduct getByResourceGroup(String resourceGroupName, String dataProductName) { + DataProductInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, dataProductName); + if (inner != null) { + return new DataProductImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String dataProductName) { + this.serviceClient().delete(resourceGroupName, dataProductName); + } + + public void delete(String resourceGroupName, String dataProductName, Context context) { + this.serviceClient().delete(resourceGroupName, dataProductName, context); + } + + public Response addUserRoleWithResponse(String resourceGroupName, String dataProductName, + RoleAssignmentCommonProperties body, Context context) { + Response inner + = this.serviceClient().addUserRoleWithResponse(resourceGroupName, dataProductName, body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RoleAssignmentDetailImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoleAssignmentDetail addUserRole(String resourceGroupName, String dataProductName, + RoleAssignmentCommonProperties body) { + RoleAssignmentDetailInner inner = this.serviceClient().addUserRole(resourceGroupName, dataProductName, body); + if (inner != null) { + return new RoleAssignmentDetailImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response generateStorageAccountSasTokenWithResponse(String resourceGroupName, + String dataProductName, AccountSas body, Context context) { + Response inner = this.serviceClient() + .generateStorageAccountSasTokenWithResponse(resourceGroupName, dataProductName, body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AccountSasTokenImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccountSasToken generateStorageAccountSasToken(String resourceGroupName, String dataProductName, + AccountSas body) { + AccountSasTokenInner inner + = this.serviceClient().generateStorageAccountSasToken(resourceGroupName, dataProductName, body); + if (inner != null) { + return new AccountSasTokenImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listRolesAssignmentsWithResponse(String resourceGroupName, + String dataProductName, Object body, Context context) { + Response inner + = this.serviceClient().listRolesAssignmentsWithResponse(resourceGroupName, dataProductName, body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ListRoleAssignmentsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ListRoleAssignments listRolesAssignments(String resourceGroupName, String dataProductName, Object body) { + ListRoleAssignmentsInner inner + = this.serviceClient().listRolesAssignments(resourceGroupName, dataProductName, body); + if (inner != null) { + return new ListRoleAssignmentsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response removeUserRoleWithResponse(String resourceGroupName, String dataProductName, + RoleAssignmentDetailInner body, Context context) { + return this.serviceClient().removeUserRoleWithResponse(resourceGroupName, dataProductName, body, context); + } + + public void removeUserRole(String resourceGroupName, String dataProductName, RoleAssignmentDetailInner body) { + this.serviceClient().removeUserRole(resourceGroupName, dataProductName, body); + } + + public Response rotateKeyWithResponse(String resourceGroupName, String dataProductName, KeyVaultInfo body, + Context context) { + return this.serviceClient().rotateKeyWithResponse(resourceGroupName, dataProductName, body, context); + } + + public void rotateKey(String resourceGroupName, String dataProductName, KeyVaultInfo body) { + this.serviceClient().rotateKey(resourceGroupName, dataProductName, body); + } + + public DataProduct getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataProductName = Utils.getValueFromIdByName(id, "dataProducts"); + if (dataProductName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataProducts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, dataProductName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataProductName = Utils.getValueFromIdByName(id, "dataProducts"); + if (dataProductName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataProducts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, dataProductName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataProductName = Utils.getValueFromIdByName(id, "dataProducts"); + if (dataProductName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataProducts'.", id))); + } + this.delete(resourceGroupName, dataProductName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataProductName = Utils.getValueFromIdByName(id, "dataProducts"); + if (dataProductName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataProducts'.", id))); + } + this.delete(resourceGroupName, dataProductName, context); + } + + private DataProductsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager() { + return this.serviceManager; + } + + public DataProductImpl define(String name) { + return new DataProductImpl(name, this.manager()); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataTypeImpl.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataTypeImpl.java new file mode 100644 index 000000000000..041e067571cc --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataTypeImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkanalytics.fluent.models.DataTypeInner; +import com.azure.resourcemanager.networkanalytics.models.ContainerSaS; +import com.azure.resourcemanager.networkanalytics.models.ContainerSasToken; +import com.azure.resourcemanager.networkanalytics.models.DataType; +import com.azure.resourcemanager.networkanalytics.models.DataTypeProperties; +import com.azure.resourcemanager.networkanalytics.models.DataTypeUpdate; +import com.azure.resourcemanager.networkanalytics.models.DataTypeUpdateProperties; + +public final class DataTypeImpl implements DataType, DataType.Definition, DataType.Update { + private DataTypeInner innerObject; + + private final com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public DataTypeProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public DataTypeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String dataProductName; + + private String dataTypeName; + + private DataTypeUpdate updateProperties; + + public DataTypeImpl withExistingDataProduct(String resourceGroupName, String dataProductName) { + this.resourceGroupName = resourceGroupName; + this.dataProductName = dataProductName; + return this; + } + + public DataType create() { + this.innerObject = serviceManager.serviceClient().getDataTypes().create(resourceGroupName, dataProductName, + dataTypeName, this.innerModel(), Context.NONE); + return this; + } + + public DataType create(Context context) { + this.innerObject = serviceManager.serviceClient().getDataTypes().create(resourceGroupName, dataProductName, + dataTypeName, this.innerModel(), context); + return this; + } + + DataTypeImpl(String name, com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager serviceManager) { + this.innerObject = new DataTypeInner(); + this.serviceManager = serviceManager; + this.dataTypeName = name; + } + + public DataTypeImpl update() { + this.updateProperties = new DataTypeUpdate(); + return this; + } + + public DataType apply() { + this.innerObject = serviceManager.serviceClient().getDataTypes().update(resourceGroupName, dataProductName, + dataTypeName, updateProperties, Context.NONE); + return this; + } + + public DataType apply(Context context) { + this.innerObject = serviceManager.serviceClient().getDataTypes().update(resourceGroupName, dataProductName, + dataTypeName, updateProperties, context); + return this; + } + + DataTypeImpl(DataTypeInner innerObject, + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.dataProductName = Utils.getValueFromIdByName(innerObject.id(), "dataProducts"); + this.dataTypeName = Utils.getValueFromIdByName(innerObject.id(), "dataTypes"); + } + + public DataType refresh() { + this.innerObject = serviceManager.serviceClient().getDataTypes() + .getWithResponse(resourceGroupName, dataProductName, dataTypeName, Context.NONE).getValue(); + return this; + } + + public DataType refresh(Context context) { + this.innerObject = serviceManager.serviceClient().getDataTypes() + .getWithResponse(resourceGroupName, dataProductName, dataTypeName, context).getValue(); + return this; + } + + public void deleteData(Object body) { + serviceManager.dataTypes().deleteData(resourceGroupName, dataProductName, dataTypeName, body); + } + + public void deleteData(Object body, Context context) { + serviceManager.dataTypes().deleteData(resourceGroupName, dataProductName, dataTypeName, body, context); + } + + public Response generateStorageContainerSasTokenWithResponse(ContainerSaS body, + Context context) { + return serviceManager.dataTypes().generateStorageContainerSasTokenWithResponse(resourceGroupName, + dataProductName, dataTypeName, body, context); + } + + public ContainerSasToken generateStorageContainerSasToken(ContainerSaS body) { + return serviceManager.dataTypes().generateStorageContainerSasToken(resourceGroupName, dataProductName, + dataTypeName, body); + } + + public DataTypeImpl withProperties(DataTypeProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public DataTypeImpl withProperties(DataTypeUpdateProperties properties) { + this.updateProperties.withProperties(properties); + return this; + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataTypesClientImpl.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataTypesClientImpl.java new file mode 100644 index 000000000000..bd23cfdcc76b --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataTypesClientImpl.java @@ -0,0 +1,1615 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.networkanalytics.fluent.DataTypesClient; +import com.azure.resourcemanager.networkanalytics.fluent.models.ContainerSasTokenInner; +import com.azure.resourcemanager.networkanalytics.fluent.models.DataTypeInner; +import com.azure.resourcemanager.networkanalytics.models.ContainerSaS; +import com.azure.resourcemanager.networkanalytics.models.DataTypeListResult; +import com.azure.resourcemanager.networkanalytics.models.DataTypeUpdate; +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 DataTypesClient. + */ +public final class DataTypesClientImpl implements DataTypesClient { + /** + * The proxy service used to perform REST calls. + */ + private final DataTypesService service; + + /** + * The service client containing this operation class. + */ + private final NetworkAnalyticsMgmtClientImpl client; + + /** + * Initializes an instance of DataTypesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataTypesClientImpl(NetworkAnalyticsMgmtClientImpl client) { + this.service + = RestProxy.create(DataTypesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkAnalyticsMgmtClientDataTypes to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkAnalyticsMgmt") + public interface DataTypesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkAnalytics/dataProducts/{dataProductName}/dataTypes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataProduct(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataProductName") String dataProductName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkAnalytics/dataProducts/{dataProductName}/dataTypes/{dataTypeName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataProductName") String dataProductName, @PathParam("dataTypeName") String dataTypeName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkAnalytics/dataProducts/{dataProductName}/dataTypes/{dataTypeName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataProductName") String dataProductName, @PathParam("dataTypeName") String dataTypeName, + @BodyParam("application/json") DataTypeInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkAnalytics/dataProducts/{dataProductName}/dataTypes/{dataTypeName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataProductName") String dataProductName, @PathParam("dataTypeName") String dataTypeName, + @BodyParam("application/json") DataTypeUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkAnalytics/dataProducts/{dataProductName}/dataTypes/{dataTypeName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataProductName") String dataProductName, @PathParam("dataTypeName") String dataTypeName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkAnalytics/dataProducts/{dataProductName}/dataTypes/{dataTypeName}/deleteData") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteData(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataProductName") String dataProductName, @PathParam("dataTypeName") String dataTypeName, + @BodyParam("application/json") Object body, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkAnalytics/dataProducts/{dataProductName}/dataTypes/{dataTypeName}/generateStorageContainerSasToken") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> generateStorageContainerSasToken(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("dataProductName") String dataProductName, @PathParam("dataTypeName") String dataTypeName, + @BodyParam("application/json") ContainerSaS body, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataProductNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List data type by parent resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataType list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataProductSinglePageAsync(String resourceGroupName, + String dataProductName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByDataProduct(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dataProductName, 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 data type by parent resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataType list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataProductSinglePageAsync(String resourceGroupName, + String dataProductName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDataProduct(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, dataProductName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List data type by parent resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataType list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataProductAsync(String resourceGroupName, String dataProductName) { + return new PagedFlux<>(() -> listByDataProductSinglePageAsync(resourceGroupName, dataProductName), + nextLink -> listByDataProductNextSinglePageAsync(nextLink)); + } + + /** + * List data type by parent resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataType list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataProductAsync(String resourceGroupName, String dataProductName, + Context context) { + return new PagedFlux<>(() -> listByDataProductSinglePageAsync(resourceGroupName, dataProductName, context), + nextLink -> listByDataProductNextSinglePageAsync(nextLink, context)); + } + + /** + * List data type by parent resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataType list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataProduct(String resourceGroupName, String dataProductName) { + return new PagedIterable<>(listByDataProductAsync(resourceGroupName, dataProductName)); + } + + /** + * List data type by parent resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataType list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataProduct(String resourceGroupName, String dataProductName, + Context context) { + return new PagedIterable<>(listByDataProductAsync(resourceGroupName, dataProductName, context)); + } + + /** + * Retrieve data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String dataProductName, + String dataTypeName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (dataTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter dataTypeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dataProductName, dataTypeName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String dataProductName, + String dataTypeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (dataTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter dataTypeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, dataProductName, dataTypeName, accept, context); + } + + /** + * Retrieve data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String dataProductName, String dataTypeName) { + return getWithResponseAsync(resourceGroupName, dataProductName, dataTypeName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String dataProductName, + String dataTypeName, Context context) { + return getWithResponseAsync(resourceGroupName, dataProductName, dataTypeName, context).block(); + } + + /** + * Retrieve data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataTypeInner get(String resourceGroupName, String dataProductName, String dataTypeName) { + return getWithResponse(resourceGroupName, dataProductName, dataTypeName, Context.NONE).getValue(); + } + + /** + * Create data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String dataProductName, + String dataTypeName, DataTypeInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (dataTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter dataTypeName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dataProductName, dataTypeName, resource, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String dataProductName, + String dataTypeName, DataTypeInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (dataTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter dataTypeName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, dataProductName, dataTypeName, resource, accept, context); + } + + /** + * Create data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the data type resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DataTypeInner> beginCreateAsync(String resourceGroupName, + String dataProductName, String dataTypeName, DataTypeInner resource) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, dataProductName, dataTypeName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DataTypeInner.class, DataTypeInner.class, this.client.getContext()); + } + + /** + * Create data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the data type resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DataTypeInner> beginCreateAsync(String resourceGroupName, + String dataProductName, String dataTypeName, DataTypeInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, dataProductName, dataTypeName, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DataTypeInner.class, DataTypeInner.class, context); + } + + /** + * Create data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the data type resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DataTypeInner> beginCreate(String resourceGroupName, + String dataProductName, String dataTypeName, DataTypeInner resource) { + return this.beginCreateAsync(resourceGroupName, dataProductName, dataTypeName, resource).getSyncPoller(); + } + + /** + * Create data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the data type resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DataTypeInner> beginCreate(String resourceGroupName, + String dataProductName, String dataTypeName, DataTypeInner resource, Context context) { + return this.beginCreateAsync(resourceGroupName, dataProductName, dataTypeName, resource, context) + .getSyncPoller(); + } + + /** + * Create data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String dataProductName, String dataTypeName, + DataTypeInner resource) { + return beginCreateAsync(resourceGroupName, dataProductName, dataTypeName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String dataProductName, String dataTypeName, + DataTypeInner resource, Context context) { + return beginCreateAsync(resourceGroupName, dataProductName, dataTypeName, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataTypeInner create(String resourceGroupName, String dataProductName, String dataTypeName, + DataTypeInner resource) { + return createAsync(resourceGroupName, dataProductName, dataTypeName, resource).block(); + } + + /** + * Create data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataTypeInner create(String resourceGroupName, String dataProductName, String dataTypeName, + DataTypeInner resource, Context context) { + return createAsync(resourceGroupName, dataProductName, dataTypeName, resource, context).block(); + } + + /** + * Update data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String dataProductName, + String dataTypeName, DataTypeUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (dataTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter dataTypeName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dataProductName, dataTypeName, properties, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String dataProductName, + String dataTypeName, DataTypeUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (dataTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter dataTypeName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, dataProductName, dataTypeName, properties, accept, context); + } + + /** + * Update data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the data type resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DataTypeInner> beginUpdateAsync(String resourceGroupName, + String dataProductName, String dataTypeName, DataTypeUpdate properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, dataProductName, dataTypeName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DataTypeInner.class, DataTypeInner.class, this.client.getContext()); + } + + /** + * Update data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the data type resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DataTypeInner> beginUpdateAsync(String resourceGroupName, + String dataProductName, String dataTypeName, DataTypeUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, dataProductName, dataTypeName, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DataTypeInner.class, DataTypeInner.class, context); + } + + /** + * Update data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the data type resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DataTypeInner> beginUpdate(String resourceGroupName, + String dataProductName, String dataTypeName, DataTypeUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, dataProductName, dataTypeName, properties).getSyncPoller(); + } + + /** + * Update data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the data type resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DataTypeInner> beginUpdate(String resourceGroupName, + String dataProductName, String dataTypeName, DataTypeUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, dataProductName, dataTypeName, properties, context) + .getSyncPoller(); + } + + /** + * Update data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String dataProductName, String dataTypeName, + DataTypeUpdate properties) { + return beginUpdateAsync(resourceGroupName, dataProductName, dataTypeName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String dataProductName, String dataTypeName, + DataTypeUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, dataProductName, dataTypeName, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataTypeInner update(String resourceGroupName, String dataProductName, String dataTypeName, + DataTypeUpdate properties) { + return updateAsync(resourceGroupName, dataProductName, dataTypeName, properties).block(); + } + + /** + * Update data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataTypeInner update(String resourceGroupName, String dataProductName, String dataTypeName, + DataTypeUpdate properties, Context context) { + return updateAsync(resourceGroupName, dataProductName, dataTypeName, properties, context).block(); + } + + /** + * Delete data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String dataProductName, + String dataTypeName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (dataTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter dataTypeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dataProductName, dataTypeName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String dataProductName, + String dataTypeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (dataTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter dataTypeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, dataProductName, dataTypeName, accept, context); + } + + /** + * Delete data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String dataProductName, + String dataTypeName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, dataProductName, dataTypeName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String dataProductName, + String dataTypeName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, dataProductName, dataTypeName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String dataProductName, + String dataTypeName) { + return this.beginDeleteAsync(resourceGroupName, dataProductName, dataTypeName).getSyncPoller(); + } + + /** + * Delete data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String dataProductName, + String dataTypeName, Context context) { + return this.beginDeleteAsync(resourceGroupName, dataProductName, dataTypeName, context).getSyncPoller(); + } + + /** + * Delete data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String dataProductName, String dataTypeName) { + return beginDeleteAsync(resourceGroupName, dataProductName, dataTypeName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String dataProductName, String dataTypeName, + Context context) { + return beginDeleteAsync(resourceGroupName, dataProductName, dataTypeName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String dataProductName, String dataTypeName) { + deleteAsync(resourceGroupName, dataProductName, dataTypeName).block(); + } + + /** + * Delete data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String dataProductName, String dataTypeName, Context context) { + deleteAsync(resourceGroupName, dataProductName, dataTypeName, context).block(); + } + + /** + * Delete data for data type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteDataWithResponseAsync(String resourceGroupName, + String dataProductName, String dataTypeName, Object body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (dataTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter dataTypeName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.deleteData(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dataProductName, dataTypeName, body, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete data for data type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteDataWithResponseAsync(String resourceGroupName, + String dataProductName, String dataTypeName, Object body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (dataTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter dataTypeName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.deleteData(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dataProductName, dataTypeName, body, accept, context); + } + + /** + * Delete data for data type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteDataAsync(String resourceGroupName, String dataProductName, + String dataTypeName, Object body) { + Mono>> mono + = deleteDataWithResponseAsync(resourceGroupName, dataProductName, dataTypeName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete data for data type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteDataAsync(String resourceGroupName, String dataProductName, + String dataTypeName, Object body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteDataWithResponseAsync(resourceGroupName, dataProductName, dataTypeName, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete data for data type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteData(String resourceGroupName, String dataProductName, + String dataTypeName, Object body) { + return this.beginDeleteDataAsync(resourceGroupName, dataProductName, dataTypeName, body).getSyncPoller(); + } + + /** + * Delete data for data type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteData(String resourceGroupName, String dataProductName, + String dataTypeName, Object body, Context context) { + return this.beginDeleteDataAsync(resourceGroupName, dataProductName, dataTypeName, body, context) + .getSyncPoller(); + } + + /** + * Delete data for data type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteDataAsync(String resourceGroupName, String dataProductName, String dataTypeName, + Object body) { + return beginDeleteDataAsync(resourceGroupName, dataProductName, dataTypeName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete data for data type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteDataAsync(String resourceGroupName, String dataProductName, String dataTypeName, + Object body, Context context) { + return beginDeleteDataAsync(resourceGroupName, dataProductName, dataTypeName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete data for data type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteData(String resourceGroupName, String dataProductName, String dataTypeName, Object body) { + deleteDataAsync(resourceGroupName, dataProductName, dataTypeName, body).block(); + } + + /** + * Delete data for data type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteData(String resourceGroupName, String dataProductName, String dataTypeName, Object body, + Context context) { + deleteDataAsync(resourceGroupName, dataProductName, dataTypeName, body, context).block(); + } + + /** + * Generate sas token for storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of storage container account sas token along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateStorageContainerSasTokenWithResponseAsync( + String resourceGroupName, String dataProductName, String dataTypeName, ContainerSaS body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (dataTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter dataTypeName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.generateStorageContainerSasToken(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, dataProductName, + dataTypeName, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate sas token for storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of storage container account sas token along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateStorageContainerSasTokenWithResponseAsync( + String resourceGroupName, String dataProductName, String dataTypeName, ContainerSaS body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dataProductName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataProductName is required and cannot be null.")); + } + if (dataTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter dataTypeName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.generateStorageContainerSasToken(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, dataProductName, dataTypeName, body, accept, context); + } + + /** + * Generate sas token for storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of storage container account sas token on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateStorageContainerSasTokenAsync(String resourceGroupName, + String dataProductName, String dataTypeName, ContainerSaS body) { + return generateStorageContainerSasTokenWithResponseAsync(resourceGroupName, dataProductName, dataTypeName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Generate sas token for storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of storage container account sas token along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response generateStorageContainerSasTokenWithResponse(String resourceGroupName, + String dataProductName, String dataTypeName, ContainerSaS body, Context context) { + return generateStorageContainerSasTokenWithResponseAsync(resourceGroupName, dataProductName, dataTypeName, body, + context).block(); + } + + /** + * Generate sas token for storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of storage container account sas token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerSasTokenInner generateStorageContainerSasToken(String resourceGroupName, String dataProductName, + String dataTypeName, ContainerSaS body) { + return generateStorageContainerSasTokenWithResponse(resourceGroupName, dataProductName, dataTypeName, body, + Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 DataType list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataProductNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByDataProductNext(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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 DataType list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataProductNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByDataProductNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataTypesImpl.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataTypesImpl.java new file mode 100644 index 000000000000..dbf6252dd38b --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/DataTypesImpl.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.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.networkanalytics.fluent.DataTypesClient; +import com.azure.resourcemanager.networkanalytics.fluent.models.ContainerSasTokenInner; +import com.azure.resourcemanager.networkanalytics.fluent.models.DataTypeInner; +import com.azure.resourcemanager.networkanalytics.models.ContainerSaS; +import com.azure.resourcemanager.networkanalytics.models.ContainerSasToken; +import com.azure.resourcemanager.networkanalytics.models.DataType; +import com.azure.resourcemanager.networkanalytics.models.DataTypes; + +public final class DataTypesImpl implements DataTypes { + private static final ClientLogger LOGGER = new ClientLogger(DataTypesImpl.class); + + private final DataTypesClient innerClient; + + private final com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager serviceManager; + + public DataTypesImpl(DataTypesClient innerClient, + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByDataProduct(String resourceGroupName, String dataProductName) { + PagedIterable inner = this.serviceClient().listByDataProduct(resourceGroupName, dataProductName); + return Utils.mapPage(inner, inner1 -> new DataTypeImpl(inner1, this.manager())); + } + + public PagedIterable listByDataProduct(String resourceGroupName, String dataProductName, + Context context) { + PagedIterable inner + = this.serviceClient().listByDataProduct(resourceGroupName, dataProductName, context); + return Utils.mapPage(inner, inner1 -> new DataTypeImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String dataProductName, String dataTypeName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, dataProductName, dataTypeName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DataTypeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DataType get(String resourceGroupName, String dataProductName, String dataTypeName) { + DataTypeInner inner = this.serviceClient().get(resourceGroupName, dataProductName, dataTypeName); + if (inner != null) { + return new DataTypeImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String dataProductName, String dataTypeName) { + this.serviceClient().delete(resourceGroupName, dataProductName, dataTypeName); + } + + public void delete(String resourceGroupName, String dataProductName, String dataTypeName, Context context) { + this.serviceClient().delete(resourceGroupName, dataProductName, dataTypeName, context); + } + + public void deleteData(String resourceGroupName, String dataProductName, String dataTypeName, Object body) { + this.serviceClient().deleteData(resourceGroupName, dataProductName, dataTypeName, body); + } + + public void deleteData(String resourceGroupName, String dataProductName, String dataTypeName, Object body, + Context context) { + this.serviceClient().deleteData(resourceGroupName, dataProductName, dataTypeName, body, context); + } + + public Response generateStorageContainerSasTokenWithResponse(String resourceGroupName, + String dataProductName, String dataTypeName, ContainerSaS body, Context context) { + Response inner = this.serviceClient().generateStorageContainerSasTokenWithResponse( + resourceGroupName, dataProductName, dataTypeName, body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ContainerSasTokenImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContainerSasToken generateStorageContainerSasToken(String resourceGroupName, String dataProductName, + String dataTypeName, ContainerSaS body) { + ContainerSasTokenInner inner = this.serviceClient().generateStorageContainerSasToken(resourceGroupName, + dataProductName, dataTypeName, body); + if (inner != null) { + return new ContainerSasTokenImpl(inner, this.manager()); + } else { + return null; + } + } + + public DataType getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataProductName = Utils.getValueFromIdByName(id, "dataProducts"); + if (dataProductName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataProducts'.", id))); + } + String dataTypeName = Utils.getValueFromIdByName(id, "dataTypes"); + if (dataTypeName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataTypes'.", id))); + } + return this.getWithResponse(resourceGroupName, dataProductName, dataTypeName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataProductName = Utils.getValueFromIdByName(id, "dataProducts"); + if (dataProductName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataProducts'.", id))); + } + String dataTypeName = Utils.getValueFromIdByName(id, "dataTypes"); + if (dataTypeName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataTypes'.", id))); + } + return this.getWithResponse(resourceGroupName, dataProductName, dataTypeName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataProductName = Utils.getValueFromIdByName(id, "dataProducts"); + if (dataProductName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataProducts'.", id))); + } + String dataTypeName = Utils.getValueFromIdByName(id, "dataTypes"); + if (dataTypeName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataTypes'.", id))); + } + this.delete(resourceGroupName, dataProductName, dataTypeName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dataProductName = Utils.getValueFromIdByName(id, "dataProducts"); + if (dataProductName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataProducts'.", id))); + } + String dataTypeName = Utils.getValueFromIdByName(id, "dataTypes"); + if (dataTypeName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dataTypes'.", id))); + } + this.delete(resourceGroupName, dataProductName, dataTypeName, context); + } + + private DataTypesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager() { + return this.serviceManager; + } + + public DataTypeImpl define(String name) { + return new DataTypeImpl(name, this.manager()); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/ListRoleAssignmentsImpl.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/ListRoleAssignmentsImpl.java new file mode 100644 index 000000000000..ecb40bcabba6 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/ListRoleAssignmentsImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.implementation; + +import com.azure.resourcemanager.networkanalytics.fluent.models.ListRoleAssignmentsInner; +import com.azure.resourcemanager.networkanalytics.fluent.models.RoleAssignmentDetailInner; +import com.azure.resourcemanager.networkanalytics.models.ListRoleAssignments; +import com.azure.resourcemanager.networkanalytics.models.RoleAssignmentDetail; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ListRoleAssignmentsImpl implements ListRoleAssignments { + private ListRoleAssignmentsInner innerObject; + + private final com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager serviceManager; + + ListRoleAssignmentsImpl(ListRoleAssignmentsInner innerObject, + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public int count() { + return this.innerModel().count(); + } + + public List roleAssignmentResponse() { + List inner = this.innerModel().roleAssignmentResponse(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new RoleAssignmentDetailImpl(inner1, this.manager())).collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ListRoleAssignmentsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/NetworkAnalyticsMgmtClientBuilder.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/NetworkAnalyticsMgmtClientBuilder.java new file mode 100644 index 000000000000..1fbc4a03501d --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/NetworkAnalyticsMgmtClientBuilder.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.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 NetworkAnalyticsMgmtClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { NetworkAnalyticsMgmtClientImpl.class }) +public final class NetworkAnalyticsMgmtClientBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the NetworkAnalyticsMgmtClientBuilder. + */ + public NetworkAnalyticsMgmtClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the NetworkAnalyticsMgmtClientBuilder. + */ + public NetworkAnalyticsMgmtClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the NetworkAnalyticsMgmtClientBuilder. + */ + public NetworkAnalyticsMgmtClientBuilder 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 NetworkAnalyticsMgmtClientBuilder. + */ + public NetworkAnalyticsMgmtClientBuilder 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 NetworkAnalyticsMgmtClientBuilder. + */ + public NetworkAnalyticsMgmtClientBuilder 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 NetworkAnalyticsMgmtClientBuilder. + */ + public NetworkAnalyticsMgmtClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of NetworkAnalyticsMgmtClientImpl with the provided parameters. + * + * @return an instance of NetworkAnalyticsMgmtClientImpl. + */ + public NetworkAnalyticsMgmtClientImpl 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(); + NetworkAnalyticsMgmtClientImpl client = new NetworkAnalyticsMgmtClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + return client; + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/NetworkAnalyticsMgmtClientImpl.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/NetworkAnalyticsMgmtClientImpl.java new file mode 100644 index 000000000000..c4eba671bf76 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/NetworkAnalyticsMgmtClientImpl.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.networkanalytics.fluent.DataProductsCatalogsClient; +import com.azure.resourcemanager.networkanalytics.fluent.DataProductsClient; +import com.azure.resourcemanager.networkanalytics.fluent.DataTypesClient; +import com.azure.resourcemanager.networkanalytics.fluent.NetworkAnalyticsMgmtClient; +import com.azure.resourcemanager.networkanalytics.fluent.OperationsClient; +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 NetworkAnalyticsMgmtClientImpl type. + */ +@ServiceClient(builder = NetworkAnalyticsMgmtClientBuilder.class) +public final class NetworkAnalyticsMgmtClientImpl implements NetworkAnalyticsMgmtClient { + /** + * The ID of the target subscription. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * server parameter. + */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Api Version. + */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The default poll interval for long-running operation. + */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** + * The OperationsClient object to access its operations. + */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * The DataProductsClient object to access its operations. + */ + private final DataProductsClient dataProducts; + + /** + * Gets the DataProductsClient object to access its operations. + * + * @return the DataProductsClient object. + */ + public DataProductsClient getDataProducts() { + return this.dataProducts; + } + + /** + * The DataProductsCatalogsClient object to access its operations. + */ + private final DataProductsCatalogsClient dataProductsCatalogs; + + /** + * Gets the DataProductsCatalogsClient object to access its operations. + * + * @return the DataProductsCatalogsClient object. + */ + public DataProductsCatalogsClient getDataProductsCatalogs() { + return this.dataProductsCatalogs; + } + + /** + * The DataTypesClient object to access its operations. + */ + private final DataTypesClient dataTypes; + + /** + * Gets the DataTypesClient object to access its operations. + * + * @return the DataTypesClient object. + */ + public DataTypesClient getDataTypes() { + return this.dataTypes; + } + + /** + * Initializes an instance of NetworkAnalyticsMgmtClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. + * @param endpoint server parameter. + */ + NetworkAnalyticsMgmtClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2023-11-15"; + this.operations = new OperationsClientImpl(this); + this.dataProducts = new DataProductsClientImpl(this); + this.dataProductsCatalogs = new DataProductsCatalogsClientImpl(this); + this.dataTypes = new DataTypesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = this.getSerializerAdapter().deserialize(errorBody, ManagementError.class, + SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkAnalyticsMgmtClientImpl.class); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/OperationImpl.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/OperationImpl.java new file mode 100644 index 000000000000..4c12d87f681b --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/OperationImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.implementation; + +import com.azure.resourcemanager.networkanalytics.fluent.models.OperationInner; +import com.azure.resourcemanager.networkanalytics.models.ActionType; +import com.azure.resourcemanager.networkanalytics.models.Operation; +import com.azure.resourcemanager.networkanalytics.models.OperationDisplay; +import com.azure.resourcemanager.networkanalytics.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager serviceManager; + + OperationImpl(OperationInner innerObject, + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager 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.networkanalytics.NetworkAnalyticsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/OperationsClientImpl.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..4d1c60ed46fa --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/OperationsClientImpl.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.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.networkanalytics.fluent.OperationsClient; +import com.azure.resourcemanager.networkanalytics.fluent.models.OperationInner; +import com.azure.resourcemanager.networkanalytics.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 NetworkAnalyticsMgmtClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(NetworkAnalyticsMgmtClientImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkAnalyticsMgmtClientOperations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkAnalyticsMgmt") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.NetworkAnalytics/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), 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 PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(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 PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, 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 as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * 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<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/OperationsImpl.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/OperationsImpl.java new file mode 100644 index 000000000000..c3c2b512e0b8 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.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.networkanalytics.fluent.OperationsClient; +import com.azure.resourcemanager.networkanalytics.fluent.models.OperationInner; +import com.azure.resourcemanager.networkanalytics.models.Operation; +import com.azure.resourcemanager.networkanalytics.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.networkanalytics.NetworkAnalyticsManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/RoleAssignmentDetailImpl.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/RoleAssignmentDetailImpl.java new file mode 100644 index 000000000000..5b2ba822d28d --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/RoleAssignmentDetailImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.implementation; + +import com.azure.resourcemanager.networkanalytics.fluent.models.RoleAssignmentDetailInner; +import com.azure.resourcemanager.networkanalytics.models.DataProductUserRole; +import com.azure.resourcemanager.networkanalytics.models.RoleAssignmentDetail; +import java.util.Collections; +import java.util.List; + +public final class RoleAssignmentDetailImpl implements RoleAssignmentDetail { + private RoleAssignmentDetailInner innerObject; + + private final com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager serviceManager; + + RoleAssignmentDetailImpl(RoleAssignmentDetailInner innerObject, + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String roleId() { + return this.innerModel().roleId(); + } + + public String principalId() { + return this.innerModel().principalId(); + } + + public String username() { + return this.innerModel().username(); + } + + public List dataTypeScope() { + List inner = this.innerModel().dataTypeScope(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String principalType() { + return this.innerModel().principalType(); + } + + public DataProductUserRole role() { + return this.innerModel().role(); + } + + public String roleAssignmentId() { + return this.innerModel().roleAssignmentId(); + } + + public RoleAssignmentDetailInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/Utils.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/Utils.java new file mode 100644 index 000000000000..f9e3cd18e17f --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/Utils.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + private Utils() { + } + + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (!segments.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/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/package-info.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/package-info.java new file mode 100644 index 000000000000..2c2804664b3b --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for NetworkAnalyticsMgmtClient. + * null. + */ +package com.azure.resourcemanager.networkanalytics.implementation; diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/AccountSas.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/AccountSas.java new file mode 100644 index 000000000000..aa526f504f27 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/AccountSas.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * The details for storage account sas creation. + */ +@Fluent +public final class AccountSas { + /* + * Sas token start timestamp. + */ + @JsonProperty(value = "startTimeStamp", required = true) + private OffsetDateTime startTimestamp; + + /* + * Sas token expiry timestamp. + */ + @JsonProperty(value = "expiryTimeStamp", required = true) + private OffsetDateTime expiryTimestamp; + + /* + * Ip Address + */ + @JsonProperty(value = "ipAddress", required = true) + private String ipAddress; + + /** + * Creates an instance of AccountSas class. + */ + public AccountSas() { + } + + /** + * Get the startTimestamp property: Sas token start timestamp. + * + * @return the startTimestamp value. + */ + public OffsetDateTime startTimestamp() { + return this.startTimestamp; + } + + /** + * Set the startTimestamp property: Sas token start timestamp. + * + * @param startTimestamp the startTimestamp value to set. + * @return the AccountSas object itself. + */ + public AccountSas withStartTimestamp(OffsetDateTime startTimestamp) { + this.startTimestamp = startTimestamp; + return this; + } + + /** + * Get the expiryTimestamp property: Sas token expiry timestamp. + * + * @return the expiryTimestamp value. + */ + public OffsetDateTime expiryTimestamp() { + return this.expiryTimestamp; + } + + /** + * Set the expiryTimestamp property: Sas token expiry timestamp. + * + * @param expiryTimestamp the expiryTimestamp value to set. + * @return the AccountSas object itself. + */ + public AccountSas withExpiryTimestamp(OffsetDateTime expiryTimestamp) { + this.expiryTimestamp = expiryTimestamp; + return this; + } + + /** + * Get the ipAddress property: Ip Address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: Ip Address. + * + * @param ipAddress the ipAddress value to set. + * @return the AccountSas object itself. + */ + public AccountSas withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (startTimestamp() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property startTimestamp in model AccountSas")); + } + if (expiryTimestamp() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property expiryTimestamp in model AccountSas")); + } + if (ipAddress() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property ipAddress in model AccountSas")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AccountSas.class); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/AccountSasToken.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/AccountSasToken.java new file mode 100644 index 000000000000..b5a799a17bbd --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/AccountSasToken.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.resourcemanager.networkanalytics.fluent.models.AccountSasTokenInner; + +/** + * An immutable client-side representation of AccountSasToken. + */ +public interface AccountSasToken { + /** + * Gets the storageAccountSasToken property: Field to specify storage account sas token. + * + * @return the storageAccountSasToken value. + */ + String storageAccountSasToken(); + + /** + * Gets the inner com.azure.resourcemanager.networkanalytics.fluent.models.AccountSasTokenInner object. + * + * @return the inner object. + */ + AccountSasTokenInner innerModel(); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ActionType.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ActionType.java new file mode 100644 index 000000000000..910774bf30c6 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ActionType.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Static value Internal for ActionType. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + @JsonCreator + 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/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ConsumptionEndpointsProperties.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ConsumptionEndpointsProperties.java new file mode 100644 index 000000000000..12031b92bdb4 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ConsumptionEndpointsProperties.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of Consumption Properties. + */ +@Immutable +public final class ConsumptionEndpointsProperties { + /* + * Ingestion url to upload the data. + */ + @JsonProperty(value = "ingestionUrl", access = JsonProperty.Access.WRITE_ONLY) + private String ingestionUrl; + + /* + * Resource Id of ingestion endpoint. + */ + @JsonProperty(value = "ingestionResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String ingestionResourceId; + + /* + * Url to consume file type. + */ + @JsonProperty(value = "fileAccessUrl", access = JsonProperty.Access.WRITE_ONLY) + private String fileAccessUrl; + + /* + * Resource Id of file access endpoint. + */ + @JsonProperty(value = "fileAccessResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String fileAccessResourceId; + + /* + * Url to consume the processed data. + */ + @JsonProperty(value = "queryUrl", access = JsonProperty.Access.WRITE_ONLY) + private String queryUrl; + + /* + * Resource Id of query endpoint. + */ + @JsonProperty(value = "queryResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String queryResourceId; + + /** + * Creates an instance of ConsumptionEndpointsProperties class. + */ + public ConsumptionEndpointsProperties() { + } + + /** + * Get the ingestionUrl property: Ingestion url to upload the data. + * + * @return the ingestionUrl value. + */ + public String ingestionUrl() { + return this.ingestionUrl; + } + + /** + * Get the ingestionResourceId property: Resource Id of ingestion endpoint. + * + * @return the ingestionResourceId value. + */ + public String ingestionResourceId() { + return this.ingestionResourceId; + } + + /** + * Get the fileAccessUrl property: Url to consume file type. + * + * @return the fileAccessUrl value. + */ + public String fileAccessUrl() { + return this.fileAccessUrl; + } + + /** + * Get the fileAccessResourceId property: Resource Id of file access endpoint. + * + * @return the fileAccessResourceId value. + */ + public String fileAccessResourceId() { + return this.fileAccessResourceId; + } + + /** + * Get the queryUrl property: Url to consume the processed data. + * + * @return the queryUrl value. + */ + public String queryUrl() { + return this.queryUrl; + } + + /** + * Get the queryResourceId property: Resource Id of query endpoint. + * + * @return the queryResourceId value. + */ + public String queryResourceId() { + return this.queryResourceId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ContainerSaS.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ContainerSaS.java new file mode 100644 index 000000000000..7c159adf564c --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ContainerSaS.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * The details for container sas creation. + */ +@Fluent +public final class ContainerSaS { + /* + * Sas token start timestamp. + */ + @JsonProperty(value = "startTimeStamp", required = true) + private OffsetDateTime startTimestamp; + + /* + * Sas token expiry timestamp. + */ + @JsonProperty(value = "expiryTimeStamp", required = true) + private OffsetDateTime expiryTimestamp; + + /* + * Ip Address + */ + @JsonProperty(value = "ipAddress", required = true) + private String ipAddress; + + /** + * Creates an instance of ContainerSaS class. + */ + public ContainerSaS() { + } + + /** + * Get the startTimestamp property: Sas token start timestamp. + * + * @return the startTimestamp value. + */ + public OffsetDateTime startTimestamp() { + return this.startTimestamp; + } + + /** + * Set the startTimestamp property: Sas token start timestamp. + * + * @param startTimestamp the startTimestamp value to set. + * @return the ContainerSaS object itself. + */ + public ContainerSaS withStartTimestamp(OffsetDateTime startTimestamp) { + this.startTimestamp = startTimestamp; + return this; + } + + /** + * Get the expiryTimestamp property: Sas token expiry timestamp. + * + * @return the expiryTimestamp value. + */ + public OffsetDateTime expiryTimestamp() { + return this.expiryTimestamp; + } + + /** + * Set the expiryTimestamp property: Sas token expiry timestamp. + * + * @param expiryTimestamp the expiryTimestamp value to set. + * @return the ContainerSaS object itself. + */ + public ContainerSaS withExpiryTimestamp(OffsetDateTime expiryTimestamp) { + this.expiryTimestamp = expiryTimestamp; + return this; + } + + /** + * Get the ipAddress property: Ip Address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: Ip Address. + * + * @param ipAddress the ipAddress value to set. + * @return the ContainerSaS object itself. + */ + public ContainerSaS withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (startTimestamp() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property startTimestamp in model ContainerSaS")); + } + if (expiryTimestamp() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property expiryTimestamp in model ContainerSaS")); + } + if (ipAddress() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property ipAddress in model ContainerSaS")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerSaS.class); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ContainerSasToken.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ContainerSasToken.java new file mode 100644 index 000000000000..f9d594d6e418 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ContainerSasToken.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.resourcemanager.networkanalytics.fluent.models.ContainerSasTokenInner; + +/** + * An immutable client-side representation of ContainerSasToken. + */ +public interface ContainerSasToken { + /** + * Gets the storageContainerSasToken property: Field to specify storage container sas token. + * + * @return the storageContainerSasToken value. + */ + String storageContainerSasToken(); + + /** + * Gets the inner com.azure.resourcemanager.networkanalytics.fluent.models.ContainerSasTokenInner object. + * + * @return the inner object. + */ + ContainerSasTokenInner innerModel(); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ControlState.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ControlState.java new file mode 100644 index 000000000000..652e9da3c777 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ControlState.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The data type state. + */ +public final class ControlState extends ExpandableStringEnum { + /** + * Static value Enabled for ControlState. + */ + public static final ControlState ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for ControlState. + */ + public static final ControlState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of ControlState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ControlState() { + } + + /** + * Creates or finds a ControlState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ControlState. + */ + @JsonCreator + public static ControlState fromString(String name) { + return fromString(name, ControlState.class); + } + + /** + * Gets known ControlState values. + * + * @return known ControlState values. + */ + public static Collection values() { + return values(ControlState.class); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProduct.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProduct.java new file mode 100644 index 000000000000..8bf4019f1247 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProduct.java @@ -0,0 +1,414 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.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.networkanalytics.fluent.models.DataProductInner; +import com.azure.resourcemanager.networkanalytics.fluent.models.RoleAssignmentDetailInner; +import java.util.Map; + +/** + * An immutable client-side representation of DataProduct. + */ +public interface DataProduct { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + DataProductProperties 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.networkanalytics.fluent.models.DataProductInner object. + * + * @return the inner object. + */ + DataProductInner innerModel(); + + /** + * The entirety of the DataProduct definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The DataProduct definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the DataProduct definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the DataProduct 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 DataProduct 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 DataProduct 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. + */ + DataProduct create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DataProduct create(Context context); + } + + /** + * The stage of the DataProduct 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 DataProduct definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(DataProductProperties properties); + } + + /** + * The stage of the DataProduct 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 DataProduct resource. + * + * @return the stage of resource update. + */ + DataProduct.Update update(); + + /** + * The template for DataProduct update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DataProduct apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DataProduct apply(Context context); + } + + /** + * The DataProduct update stages. + */ + interface UpdateStages { + /** + * The stage of the DataProduct 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 DataProduct 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); + } + + /** + * The stage of the DataProduct update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The updatable properties of the DataProduct.. + * + * @param properties The updatable properties of the DataProduct. + * @return the next definition stage. + */ + Update withProperties(DataProductUpdateProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DataProduct refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DataProduct refresh(Context context); + + /** + * Assign role to the data product. + * + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details for role assignment response along with {@link Response}. + */ + Response addUserRoleWithResponse(RoleAssignmentCommonProperties body, Context context); + + /** + * Assign role to the data product. + * + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details for role assignment response. + */ + RoleAssignmentDetail addUserRole(RoleAssignmentCommonProperties body); + + /** + * Generate sas token for storage account. + * + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of storage account sas token along with {@link Response}. + */ + Response generateStorageAccountSasTokenWithResponse(AccountSas body, Context context); + + /** + * Generate sas token for storage account. + * + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of storage account sas token. + */ + AccountSasToken generateStorageAccountSasToken(AccountSas body); + + /** + * List user roles associated with the data product. + * + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list role assignments along with {@link Response}. + */ + Response listRolesAssignmentsWithResponse(Object body, Context context); + + /** + * List user roles associated with the data product. + * + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list role assignments. + */ + ListRoleAssignments listRolesAssignments(Object body); + + /** + * Remove role from the data product. + * + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response removeUserRoleWithResponse(RoleAssignmentDetailInner body, Context context); + + /** + * Remove role from the data product. + * + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void removeUserRole(RoleAssignmentDetailInner body); + + /** + * Initiate key rotation on Data Product. + * + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response rotateKeyWithResponse(KeyVaultInfo body, Context context); + + /** + * Initiate key rotation on Data Product. + * + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rotateKey(KeyVaultInfo body); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductInformation.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductInformation.java new file mode 100644 index 000000000000..60cad017ac36 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductInformation.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Data Product Information. + */ +@Fluent +public final class DataProductInformation { + /* + * Name of data product. + */ + @JsonProperty(value = "dataProductName", required = true) + private String dataProductName; + + /* + * Description about data product. + */ + @JsonProperty(value = "description", required = true) + private String description; + + /* + * Version information of data product. + */ + @JsonProperty(value = "dataProductVersions", required = true) + private List dataProductVersions; + + /** + * Creates an instance of DataProductInformation class. + */ + public DataProductInformation() { + } + + /** + * Get the dataProductName property: Name of data product. + * + * @return the dataProductName value. + */ + public String dataProductName() { + return this.dataProductName; + } + + /** + * Set the dataProductName property: Name of data product. + * + * @param dataProductName the dataProductName value to set. + * @return the DataProductInformation object itself. + */ + public DataProductInformation withDataProductName(String dataProductName) { + this.dataProductName = dataProductName; + return this; + } + + /** + * Get the description property: Description about data product. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description about data product. + * + * @param description the description value to set. + * @return the DataProductInformation object itself. + */ + public DataProductInformation withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the dataProductVersions property: Version information of data product. + * + * @return the dataProductVersions value. + */ + public List dataProductVersions() { + return this.dataProductVersions; + } + + /** + * Set the dataProductVersions property: Version information of data product. + * + * @param dataProductVersions the dataProductVersions value to set. + * @return the DataProductInformation object itself. + */ + public DataProductInformation withDataProductVersions(List dataProductVersions) { + this.dataProductVersions = dataProductVersions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataProductName() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property dataProductName in model DataProductInformation")); + } + if (description() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property description in model DataProductInformation")); + } + if (dataProductVersions() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property dataProductVersions in model DataProductInformation")); + } else { + dataProductVersions().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataProductInformation.class); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductListResult.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductListResult.java new file mode 100644 index 000000000000..019d697ae184 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductListResult.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkanalytics.fluent.models.DataProductInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The response of a DataProduct list operation. + */ +@Fluent +public final class DataProductListResult { + /* + * The DataProduct items on this page + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The link to the next page of items + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of DataProductListResult class. + */ + public DataProductListResult() { + } + + /** + * Get the value property: The DataProduct items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The DataProduct items on this page. + * + * @param value the value value to set. + * @return the DataProductListResult object itself. + */ + public DataProductListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the DataProductListResult object itself. + */ + public DataProductListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model DataProductListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataProductListResult.class); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductNetworkAcls.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductNetworkAcls.java new file mode 100644 index 000000000000..3488b26d6534 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductNetworkAcls.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Data Product Network rule set. + */ +@Fluent +public final class DataProductNetworkAcls { + /* + * Virtual Network Rule + */ + @JsonProperty(value = "virtualNetworkRule", required = true) + private List virtualNetworkRule; + + /* + * IP rule with specific IP or IP range in CIDR format. + */ + @JsonProperty(value = "ipRules", required = true) + private List ipRules; + + /* + * The list of query ips in the format of CIDR allowed to connect to query/visualization endpoint. + */ + @JsonProperty(value = "allowedQueryIpRangeList", required = true) + private List allowedQueryIpRangeList; + + /* + * Default Action + */ + @JsonProperty(value = "defaultAction", required = true) + private DefaultAction defaultAction; + + /** + * Creates an instance of DataProductNetworkAcls class. + */ + public DataProductNetworkAcls() { + } + + /** + * Get the virtualNetworkRule property: Virtual Network Rule. + * + * @return the virtualNetworkRule value. + */ + public List virtualNetworkRule() { + return this.virtualNetworkRule; + } + + /** + * Set the virtualNetworkRule property: Virtual Network Rule. + * + * @param virtualNetworkRule the virtualNetworkRule value to set. + * @return the DataProductNetworkAcls object itself. + */ + public DataProductNetworkAcls withVirtualNetworkRule(List virtualNetworkRule) { + this.virtualNetworkRule = virtualNetworkRule; + return this; + } + + /** + * Get the ipRules property: IP rule with specific IP or IP range in CIDR format. + * + * @return the ipRules value. + */ + public List ipRules() { + return this.ipRules; + } + + /** + * Set the ipRules property: IP rule with specific IP or IP range in CIDR format. + * + * @param ipRules the ipRules value to set. + * @return the DataProductNetworkAcls object itself. + */ + public DataProductNetworkAcls withIpRules(List ipRules) { + this.ipRules = ipRules; + return this; + } + + /** + * Get the allowedQueryIpRangeList property: The list of query ips in the format of CIDR allowed to connect to + * query/visualization endpoint. + * + * @return the allowedQueryIpRangeList value. + */ + public List allowedQueryIpRangeList() { + return this.allowedQueryIpRangeList; + } + + /** + * Set the allowedQueryIpRangeList property: The list of query ips in the format of CIDR allowed to connect to + * query/visualization endpoint. + * + * @param allowedQueryIpRangeList the allowedQueryIpRangeList value to set. + * @return the DataProductNetworkAcls object itself. + */ + public DataProductNetworkAcls withAllowedQueryIpRangeList(List allowedQueryIpRangeList) { + this.allowedQueryIpRangeList = allowedQueryIpRangeList; + return this; + } + + /** + * Get the defaultAction property: Default Action. + * + * @return the defaultAction value. + */ + public DefaultAction defaultAction() { + return this.defaultAction; + } + + /** + * Set the defaultAction property: Default Action. + * + * @param defaultAction the defaultAction value to set. + * @return the DataProductNetworkAcls object itself. + */ + public DataProductNetworkAcls withDefaultAction(DefaultAction defaultAction) { + this.defaultAction = defaultAction; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualNetworkRule() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property virtualNetworkRule in model DataProductNetworkAcls")); + } else { + virtualNetworkRule().forEach(e -> e.validate()); + } + if (ipRules() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property ipRules in model DataProductNetworkAcls")); + } else { + ipRules().forEach(e -> e.validate()); + } + if (allowedQueryIpRangeList() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property allowedQueryIpRangeList in model DataProductNetworkAcls")); + } + if (defaultAction() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property defaultAction in model DataProductNetworkAcls")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataProductNetworkAcls.class); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductProperties.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductProperties.java new file mode 100644 index 000000000000..1a5477f75d04 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductProperties.java @@ -0,0 +1,514 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The data product properties. + */ +@Fluent +public final class DataProductProperties { + /* + * The resource GUID property of the data product resource. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * Latest provisioning state of data product. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Data product publisher name. + */ + @JsonProperty(value = "publisher", required = true) + private String publisher; + + /* + * Product name of data product. + */ + @JsonProperty(value = "product", required = true) + private String product; + + /* + * Major version of data product. + */ + @JsonProperty(value = "majorVersion", required = true) + private String majorVersion; + + /* + * List of name or email associated with data product resource deployment. + */ + @JsonProperty(value = "owners") + private List owners; + + /* + * Flag to enable or disable redundancy for data product. + */ + @JsonProperty(value = "redundancy") + private ControlState redundancy; + + /* + * Purview account url for data product to connect to. + */ + @JsonProperty(value = "purviewAccount") + private String purviewAccount; + + /* + * Purview collection url for data product to connect to. + */ + @JsonProperty(value = "purviewCollection") + private String purviewCollection; + + /* + * Flag to enable or disable private link for data product resource. + */ + @JsonProperty(value = "privateLinksEnabled") + private ControlState privateLinksEnabled; + + /* + * Flag to enable or disable public access of data product resource. + */ + @JsonProperty(value = "publicNetworkAccess") + private ControlState publicNetworkAccess; + + /* + * Flag to enable customer managed key encryption for data product. + */ + @JsonProperty(value = "customerManagedKeyEncryptionEnabled") + private ControlState customerManagedKeyEncryptionEnabled; + + /* + * Customer managed encryption key details for data product. + */ + @JsonProperty(value = "customerEncryptionKey") + private EncryptionKeyDetails customerEncryptionKey; + + /* + * Network rule set for data product. + */ + @JsonProperty(value = "networkacls") + private DataProductNetworkAcls networkacls; + + /* + * Managed resource group configuration. + */ + @JsonProperty(value = "managedResourceGroupConfiguration") + private ManagedResourceGroupConfiguration managedResourceGroupConfiguration; + + /* + * List of available minor versions of the data product resource. + */ + @JsonProperty(value = "availableMinorVersions", access = JsonProperty.Access.WRITE_ONLY) + private List availableMinorVersions; + + /* + * Current configured minor version of the data product resource. + */ + @JsonProperty(value = "currentMinorVersion") + private String currentMinorVersion; + + /* + * Documentation link for the data product based on definition file. + */ + @JsonProperty(value = "documentation", access = JsonProperty.Access.WRITE_ONLY) + private String documentation; + + /* + * Resource links which exposed to the customer to query the data. + */ + @JsonProperty(value = "consumptionEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private ConsumptionEndpointsProperties consumptionEndpoints; + + /* + * Key vault url. + */ + @JsonProperty(value = "keyVaultUrl", access = JsonProperty.Access.WRITE_ONLY) + private String keyVaultUrl; + + /** + * Creates an instance of DataProductProperties class. + */ + public DataProductProperties() { + } + + /** + * Get the resourceGuid property: The resource GUID property of the data product resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: Latest provisioning state of data product. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the publisher property: Data product publisher name. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: Data product publisher name. + * + * @param publisher the publisher value to set. + * @return the DataProductProperties object itself. + */ + public DataProductProperties withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the product property: Product name of data product. + * + * @return the product value. + */ + public String product() { + return this.product; + } + + /** + * Set the product property: Product name of data product. + * + * @param product the product value to set. + * @return the DataProductProperties object itself. + */ + public DataProductProperties withProduct(String product) { + this.product = product; + return this; + } + + /** + * Get the majorVersion property: Major version of data product. + * + * @return the majorVersion value. + */ + public String majorVersion() { + return this.majorVersion; + } + + /** + * Set the majorVersion property: Major version of data product. + * + * @param majorVersion the majorVersion value to set. + * @return the DataProductProperties object itself. + */ + public DataProductProperties withMajorVersion(String majorVersion) { + this.majorVersion = majorVersion; + return this; + } + + /** + * Get the owners property: List of name or email associated with data product resource deployment. + * + * @return the owners value. + */ + public List owners() { + return this.owners; + } + + /** + * Set the owners property: List of name or email associated with data product resource deployment. + * + * @param owners the owners value to set. + * @return the DataProductProperties object itself. + */ + public DataProductProperties withOwners(List owners) { + this.owners = owners; + return this; + } + + /** + * Get the redundancy property: Flag to enable or disable redundancy for data product. + * + * @return the redundancy value. + */ + public ControlState redundancy() { + return this.redundancy; + } + + /** + * Set the redundancy property: Flag to enable or disable redundancy for data product. + * + * @param redundancy the redundancy value to set. + * @return the DataProductProperties object itself. + */ + public DataProductProperties withRedundancy(ControlState redundancy) { + this.redundancy = redundancy; + return this; + } + + /** + * Get the purviewAccount property: Purview account url for data product to connect to. + * + * @return the purviewAccount value. + */ + public String purviewAccount() { + return this.purviewAccount; + } + + /** + * Set the purviewAccount property: Purview account url for data product to connect to. + * + * @param purviewAccount the purviewAccount value to set. + * @return the DataProductProperties object itself. + */ + public DataProductProperties withPurviewAccount(String purviewAccount) { + this.purviewAccount = purviewAccount; + return this; + } + + /** + * Get the purviewCollection property: Purview collection url for data product to connect to. + * + * @return the purviewCollection value. + */ + public String purviewCollection() { + return this.purviewCollection; + } + + /** + * Set the purviewCollection property: Purview collection url for data product to connect to. + * + * @param purviewCollection the purviewCollection value to set. + * @return the DataProductProperties object itself. + */ + public DataProductProperties withPurviewCollection(String purviewCollection) { + this.purviewCollection = purviewCollection; + return this; + } + + /** + * Get the privateLinksEnabled property: Flag to enable or disable private link for data product resource. + * + * @return the privateLinksEnabled value. + */ + public ControlState privateLinksEnabled() { + return this.privateLinksEnabled; + } + + /** + * Set the privateLinksEnabled property: Flag to enable or disable private link for data product resource. + * + * @param privateLinksEnabled the privateLinksEnabled value to set. + * @return the DataProductProperties object itself. + */ + public DataProductProperties withPrivateLinksEnabled(ControlState privateLinksEnabled) { + this.privateLinksEnabled = privateLinksEnabled; + return this; + } + + /** + * Get the publicNetworkAccess property: Flag to enable or disable public access of data product resource. + * + * @return the publicNetworkAccess value. + */ + public ControlState publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Flag to enable or disable public access of data product resource. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the DataProductProperties object itself. + */ + public DataProductProperties withPublicNetworkAccess(ControlState publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the customerManagedKeyEncryptionEnabled property: Flag to enable customer managed key encryption for data + * product. + * + * @return the customerManagedKeyEncryptionEnabled value. + */ + public ControlState customerManagedKeyEncryptionEnabled() { + return this.customerManagedKeyEncryptionEnabled; + } + + /** + * Set the customerManagedKeyEncryptionEnabled property: Flag to enable customer managed key encryption for data + * product. + * + * @param customerManagedKeyEncryptionEnabled the customerManagedKeyEncryptionEnabled value to set. + * @return the DataProductProperties object itself. + */ + public DataProductProperties + withCustomerManagedKeyEncryptionEnabled(ControlState customerManagedKeyEncryptionEnabled) { + this.customerManagedKeyEncryptionEnabled = customerManagedKeyEncryptionEnabled; + return this; + } + + /** + * Get the customerEncryptionKey property: Customer managed encryption key details for data product. + * + * @return the customerEncryptionKey value. + */ + public EncryptionKeyDetails customerEncryptionKey() { + return this.customerEncryptionKey; + } + + /** + * Set the customerEncryptionKey property: Customer managed encryption key details for data product. + * + * @param customerEncryptionKey the customerEncryptionKey value to set. + * @return the DataProductProperties object itself. + */ + public DataProductProperties withCustomerEncryptionKey(EncryptionKeyDetails customerEncryptionKey) { + this.customerEncryptionKey = customerEncryptionKey; + return this; + } + + /** + * Get the networkacls property: Network rule set for data product. + * + * @return the networkacls value. + */ + public DataProductNetworkAcls networkacls() { + return this.networkacls; + } + + /** + * Set the networkacls property: Network rule set for data product. + * + * @param networkacls the networkacls value to set. + * @return the DataProductProperties object itself. + */ + public DataProductProperties withNetworkacls(DataProductNetworkAcls networkacls) { + this.networkacls = networkacls; + return this; + } + + /** + * Get the managedResourceGroupConfiguration property: Managed resource group configuration. + * + * @return the managedResourceGroupConfiguration value. + */ + public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { + return this.managedResourceGroupConfiguration; + } + + /** + * Set the managedResourceGroupConfiguration property: Managed resource group configuration. + * + * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. + * @return the DataProductProperties object itself. + */ + public DataProductProperties + withManagedResourceGroupConfiguration(ManagedResourceGroupConfiguration managedResourceGroupConfiguration) { + this.managedResourceGroupConfiguration = managedResourceGroupConfiguration; + return this; + } + + /** + * Get the availableMinorVersions property: List of available minor versions of the data product resource. + * + * @return the availableMinorVersions value. + */ + public List availableMinorVersions() { + return this.availableMinorVersions; + } + + /** + * Get the currentMinorVersion property: Current configured minor version of the data product resource. + * + * @return the currentMinorVersion value. + */ + public String currentMinorVersion() { + return this.currentMinorVersion; + } + + /** + * Set the currentMinorVersion property: Current configured minor version of the data product resource. + * + * @param currentMinorVersion the currentMinorVersion value to set. + * @return the DataProductProperties object itself. + */ + public DataProductProperties withCurrentMinorVersion(String currentMinorVersion) { + this.currentMinorVersion = currentMinorVersion; + return this; + } + + /** + * Get the documentation property: Documentation link for the data product based on definition file. + * + * @return the documentation value. + */ + public String documentation() { + return this.documentation; + } + + /** + * Get the consumptionEndpoints property: Resource links which exposed to the customer to query the data. + * + * @return the consumptionEndpoints value. + */ + public ConsumptionEndpointsProperties consumptionEndpoints() { + return this.consumptionEndpoints; + } + + /** + * Get the keyVaultUrl property: Key vault url. + * + * @return the keyVaultUrl value. + */ + public String keyVaultUrl() { + return this.keyVaultUrl; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publisher() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property publisher in model DataProductProperties")); + } + if (product() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property product in model DataProductProperties")); + } + if (majorVersion() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property majorVersion in model DataProductProperties")); + } + if (customerEncryptionKey() != null) { + customerEncryptionKey().validate(); + } + if (networkacls() != null) { + networkacls().validate(); + } + if (managedResourceGroupConfiguration() != null) { + managedResourceGroupConfiguration().validate(); + } + if (consumptionEndpoints() != null) { + consumptionEndpoints().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataProductProperties.class); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductUpdate.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductUpdate.java new file mode 100644 index 000000000000..4801e022b9d2 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductUpdate.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * The type used for update operations of the DataProduct. + */ +@Fluent +public final class DataProductUpdate { + /* + * The managed service identities assigned to this resource. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The updatable properties of the DataProduct. + */ + @JsonProperty(value = "properties") + private DataProductUpdateProperties properties; + + /** + * Creates an instance of DataProductUpdate class. + */ + public DataProductUpdate() { + } + + /** + * 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 DataProductUpdate object itself. + */ + public DataProductUpdate 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 DataProductUpdate object itself. + */ + public DataProductUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: The updatable properties of the DataProduct. + * + * @return the properties value. + */ + public DataProductUpdateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The updatable properties of the DataProduct. + * + * @param properties the properties value to set. + * @return the DataProductUpdate object itself. + */ + public DataProductUpdate withProperties(DataProductUpdateProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductUpdateProperties.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductUpdateProperties.java new file mode 100644 index 000000000000..eefb270443a8 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductUpdateProperties.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The updatable properties of the DataProduct. + */ +@Fluent +public final class DataProductUpdateProperties { + /* + * List of name or email associated with data product resource deployment. + */ + @JsonProperty(value = "owners") + private List owners; + + /* + * Purview account url for data product to connect to. + */ + @JsonProperty(value = "purviewAccount") + private String purviewAccount; + + /* + * Purview collection url for data product to connect to. + */ + @JsonProperty(value = "purviewCollection") + private String purviewCollection; + + /* + * Flag to enable or disable private link for data product resource. + */ + @JsonProperty(value = "privateLinksEnabled") + private ControlState privateLinksEnabled; + + /* + * Current configured minor version of the data product resource. + */ + @JsonProperty(value = "currentMinorVersion") + private String currentMinorVersion; + + /** + * Creates an instance of DataProductUpdateProperties class. + */ + public DataProductUpdateProperties() { + } + + /** + * Get the owners property: List of name or email associated with data product resource deployment. + * + * @return the owners value. + */ + public List owners() { + return this.owners; + } + + /** + * Set the owners property: List of name or email associated with data product resource deployment. + * + * @param owners the owners value to set. + * @return the DataProductUpdateProperties object itself. + */ + public DataProductUpdateProperties withOwners(List owners) { + this.owners = owners; + return this; + } + + /** + * Get the purviewAccount property: Purview account url for data product to connect to. + * + * @return the purviewAccount value. + */ + public String purviewAccount() { + return this.purviewAccount; + } + + /** + * Set the purviewAccount property: Purview account url for data product to connect to. + * + * @param purviewAccount the purviewAccount value to set. + * @return the DataProductUpdateProperties object itself. + */ + public DataProductUpdateProperties withPurviewAccount(String purviewAccount) { + this.purviewAccount = purviewAccount; + return this; + } + + /** + * Get the purviewCollection property: Purview collection url for data product to connect to. + * + * @return the purviewCollection value. + */ + public String purviewCollection() { + return this.purviewCollection; + } + + /** + * Set the purviewCollection property: Purview collection url for data product to connect to. + * + * @param purviewCollection the purviewCollection value to set. + * @return the DataProductUpdateProperties object itself. + */ + public DataProductUpdateProperties withPurviewCollection(String purviewCollection) { + this.purviewCollection = purviewCollection; + return this; + } + + /** + * Get the privateLinksEnabled property: Flag to enable or disable private link for data product resource. + * + * @return the privateLinksEnabled value. + */ + public ControlState privateLinksEnabled() { + return this.privateLinksEnabled; + } + + /** + * Set the privateLinksEnabled property: Flag to enable or disable private link for data product resource. + * + * @param privateLinksEnabled the privateLinksEnabled value to set. + * @return the DataProductUpdateProperties object itself. + */ + public DataProductUpdateProperties withPrivateLinksEnabled(ControlState privateLinksEnabled) { + this.privateLinksEnabled = privateLinksEnabled; + return this; + } + + /** + * Get the currentMinorVersion property: Current configured minor version of the data product resource. + * + * @return the currentMinorVersion value. + */ + public String currentMinorVersion() { + return this.currentMinorVersion; + } + + /** + * Set the currentMinorVersion property: Current configured minor version of the data product resource. + * + * @param currentMinorVersion the currentMinorVersion value to set. + * @return the DataProductUpdateProperties object itself. + */ + public DataProductUpdateProperties withCurrentMinorVersion(String currentMinorVersion) { + this.currentMinorVersion = currentMinorVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductUserRole.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductUserRole.java new file mode 100644 index 000000000000..0d9ef0f4adfa --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductUserRole.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The data type state. + */ +public final class DataProductUserRole extends ExpandableStringEnum { + /** + * Static value Reader for DataProductUserRole. + */ + public static final DataProductUserRole READER = fromString("Reader"); + + /** + * Static value SensitiveReader for DataProductUserRole. + */ + public static final DataProductUserRole SENSITIVE_READER = fromString("SensitiveReader"); + + /** + * Creates a new instance of DataProductUserRole value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataProductUserRole() { + } + + /** + * Creates or finds a DataProductUserRole from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataProductUserRole. + */ + @JsonCreator + public static DataProductUserRole fromString(String name) { + return fromString(name, DataProductUserRole.class); + } + + /** + * Gets known DataProductUserRole values. + * + * @return known DataProductUserRole values. + */ + public static Collection values() { + return values(DataProductUserRole.class); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductVersion.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductVersion.java new file mode 100644 index 000000000000..9c4e40d09ecc --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductVersion.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Product Version. + */ +@Fluent +public final class DataProductVersion { + /* + * Version of data product + */ + @JsonProperty(value = "version", required = true) + private String version; + + /** + * Creates an instance of DataProductVersion class. + */ + public DataProductVersion() { + } + + /** + * Get the version property: Version of data product. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version of data product. + * + * @param version the version value to set. + * @return the DataProductVersion object itself. + */ + public DataProductVersion withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (version() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property version in model DataProductVersion")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataProductVersion.class); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProducts.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProducts.java new file mode 100644 index 000000000000..6ae4ea69698f --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProducts.java @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkanalytics.fluent.models.RoleAssignmentDetailInner; + +/** + * Resource collection API of DataProducts. + */ +public interface DataProducts { + /** + * List data products by 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 DataProduct list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List data products by 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 DataProduct list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List data products by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataProduct list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List data products by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataProduct list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String dataProductName, + Context context); + + /** + * Retrieve data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data product resource. + */ + DataProduct getByResourceGroup(String resourceGroupName, String dataProductName); + + /** + * Delete data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String dataProductName); + + /** + * Delete data product resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String dataProductName, Context context); + + /** + * Assign role to the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details for role assignment response along with {@link Response}. + */ + Response addUserRoleWithResponse(String resourceGroupName, String dataProductName, + RoleAssignmentCommonProperties body, Context context); + + /** + * Assign role to the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details for role assignment response. + */ + RoleAssignmentDetail addUserRole(String resourceGroupName, String dataProductName, + RoleAssignmentCommonProperties body); + + /** + * Generate sas token for storage account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of storage account sas token along with {@link Response}. + */ + Response generateStorageAccountSasTokenWithResponse(String resourceGroupName, + String dataProductName, AccountSas body, Context context); + + /** + * Generate sas token for storage account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of storage account sas token. + */ + AccountSasToken generateStorageAccountSasToken(String resourceGroupName, String dataProductName, AccountSas body); + + /** + * List user roles associated with the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list role assignments along with {@link Response}. + */ + Response listRolesAssignmentsWithResponse(String resourceGroupName, String dataProductName, + Object body, Context context); + + /** + * List user roles associated with the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list role assignments. + */ + ListRoleAssignments listRolesAssignments(String resourceGroupName, String dataProductName, Object body); + + /** + * Remove role from the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response removeUserRoleWithResponse(String resourceGroupName, String dataProductName, + RoleAssignmentDetailInner body, Context context); + + /** + * Remove role from the data product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void removeUserRole(String resourceGroupName, String dataProductName, RoleAssignmentDetailInner body); + + /** + * Initiate key rotation on Data Product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response rotateKeyWithResponse(String resourceGroupName, String dataProductName, KeyVaultInfo body, + Context context); + + /** + * Initiate key rotation on Data Product. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rotateKey(String resourceGroupName, String dataProductName, KeyVaultInfo body); + + /** + * Retrieve data product 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 data product resource along with {@link Response}. + */ + DataProduct getById(String id); + + /** + * Retrieve data product 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 data product resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete data product 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); + + /** + * Delete data product 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 DataProduct resource. + * + * @param name resource name. + * @return the first stage of the new DataProduct definition. + */ + DataProduct.DefinitionStages.Blank define(String name); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductsCatalog.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductsCatalog.java new file mode 100644 index 000000000000..780b85f5e0b2 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductsCatalog.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.networkanalytics.fluent.models.DataProductsCatalogInner; + +/** + * An immutable client-side representation of DataProductsCatalog. + */ +public interface DataProductsCatalog { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + DataProductsCatalogProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.networkanalytics.fluent.models.DataProductsCatalogInner object. + * + * @return the inner object. + */ + DataProductsCatalogInner innerModel(); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductsCatalogListResult.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductsCatalogListResult.java new file mode 100644 index 000000000000..377411893b44 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductsCatalogListResult.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkanalytics.fluent.models.DataProductsCatalogInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The response of a DataProductsCatalog list operation. + */ +@Fluent +public final class DataProductsCatalogListResult { + /* + * The DataProductsCatalog items on this page + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The link to the next page of items + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of DataProductsCatalogListResult class. + */ + public DataProductsCatalogListResult() { + } + + /** + * Get the value property: The DataProductsCatalog items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The DataProductsCatalog items on this page. + * + * @param value the value value to set. + * @return the DataProductsCatalogListResult object itself. + */ + public DataProductsCatalogListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the DataProductsCatalogListResult object itself. + */ + public DataProductsCatalogListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model DataProductsCatalogListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataProductsCatalogListResult.class); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductsCatalogProperties.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductsCatalogProperties.java new file mode 100644 index 000000000000..d7688884152b --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductsCatalogProperties.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Details for data catalog properties. + */ +@Fluent +public final class DataProductsCatalogProperties { + /* + * The data catalog provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The data product publisher information. + */ + @JsonProperty(value = "publishers", required = true) + private List publishers; + + /** + * Creates an instance of DataProductsCatalogProperties class. + */ + public DataProductsCatalogProperties() { + } + + /** + * Get the provisioningState property: The data catalog provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the publishers property: The data product publisher information. + * + * @return the publishers value. + */ + public List publishers() { + return this.publishers; + } + + /** + * Set the publishers property: The data product publisher information. + * + * @param publishers the publishers value to set. + * @return the DataProductsCatalogProperties object itself. + */ + public DataProductsCatalogProperties withPublishers(List publishers) { + this.publishers = publishers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publishers() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property publishers in model DataProductsCatalogProperties")); + } else { + publishers().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataProductsCatalogProperties.class); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductsCatalogs.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductsCatalogs.java new file mode 100644 index 000000000000..5b7fffb33445 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataProductsCatalogs.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.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 DataProductsCatalogs. + */ +public interface DataProductsCatalogs { + /** + * List data catalog by 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 DataProductsCatalog list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List data catalog by 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 DataProductsCatalog list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List data catalog by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataProductsCatalog list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List data catalog by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataProductsCatalog list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve data type resource. + * + * @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 data catalog resource along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, Context context); + + /** + * Retrieve data type resource. + * + * @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 data catalog resource. + */ + DataProductsCatalog getByResourceGroup(String resourceGroupName); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataType.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataType.java new file mode 100644 index 000000000000..d1ba72be4a4c --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataType.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkanalytics.fluent.models.DataTypeInner; + +/** + * An immutable client-side representation of DataType. + */ +public interface DataType { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + DataTypeProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.networkanalytics.fluent.models.DataTypeInner object. + * + * @return the inner object. + */ + DataTypeInner innerModel(); + + /** + * The entirety of the DataType definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The DataType definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the DataType definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the DataType definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, dataProductName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @return the next definition stage. + */ + WithCreate withExistingDataProduct(String resourceGroupName, String dataProductName); + } + + /** + * The stage of the DataType definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + DataType create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DataType create(Context context); + } + + /** + * The stage of the DataType definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(DataTypeProperties properties); + } + } + + /** + * Begins update for the DataType resource. + * + * @return the stage of resource update. + */ + DataType.Update update(); + + /** + * The template for DataType update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DataType apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DataType apply(Context context); + } + + /** + * The DataType update stages. + */ + interface UpdateStages { + /** + * The stage of the DataType update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The updatable properties of the DataType.. + * + * @param properties The updatable properties of the DataType. + * @return the next definition stage. + */ + Update withProperties(DataTypeUpdateProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DataType refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DataType refresh(Context context); + + /** + * Delete data for data type. + * + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteData(Object body); + + /** + * Delete data for data type. + * + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteData(Object body, Context context); + + /** + * Generate sas token for storage container. + * + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of storage container account sas token along with {@link Response}. + */ + Response generateStorageContainerSasTokenWithResponse(ContainerSaS body, Context context); + + /** + * Generate sas token for storage container. + * + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of storage container account sas token. + */ + ContainerSasToken generateStorageContainerSasToken(ContainerSaS body); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataTypeListResult.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataTypeListResult.java new file mode 100644 index 000000000000..8731ec84e5a9 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataTypeListResult.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkanalytics.fluent.models.DataTypeInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The response of a DataType list operation. + */ +@Fluent +public final class DataTypeListResult { + /* + * The DataType items on this page + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The link to the next page of items + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of DataTypeListResult class. + */ + public DataTypeListResult() { + } + + /** + * Get the value property: The DataType items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The DataType items on this page. + * + * @param value the value value to set. + * @return the DataTypeListResult object itself. + */ + public DataTypeListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the DataTypeListResult object itself. + */ + public DataTypeListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model DataTypeListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataTypeListResult.class); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataTypeProperties.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataTypeProperties.java new file mode 100644 index 000000000000..f0747eebdb76 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataTypeProperties.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The data type properties. + */ +@Fluent +public final class DataTypeProperties { + /* + * Latest provisioning state of data product. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * State of data type. + */ + @JsonProperty(value = "state") + private DataTypeState state; + + /* + * Reason for the state of data type. + */ + @JsonProperty(value = "stateReason", access = JsonProperty.Access.WRITE_ONLY) + private String stateReason; + + /* + * Field for storage output retention in days. + */ + @JsonProperty(value = "storageOutputRetention") + private Integer storageOutputRetention; + + /* + * Field for database cache retention in days. + */ + @JsonProperty(value = "databaseCacheRetention") + private Integer databaseCacheRetention; + + /* + * Field for database data retention in days. + */ + @JsonProperty(value = "databaseRetention") + private Integer databaseRetention; + + /* + * Url for data visualization. + */ + @JsonProperty(value = "visualizationUrl", access = JsonProperty.Access.WRITE_ONLY) + private String visualizationUrl; + + /** + * Creates an instance of DataTypeProperties class. + */ + public DataTypeProperties() { + } + + /** + * Get the provisioningState property: Latest provisioning state of data product. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the state property: State of data type. + * + * @return the state value. + */ + public DataTypeState state() { + return this.state; + } + + /** + * Set the state property: State of data type. + * + * @param state the state value to set. + * @return the DataTypeProperties object itself. + */ + public DataTypeProperties withState(DataTypeState state) { + this.state = state; + return this; + } + + /** + * Get the stateReason property: Reason for the state of data type. + * + * @return the stateReason value. + */ + public String stateReason() { + return this.stateReason; + } + + /** + * Get the storageOutputRetention property: Field for storage output retention in days. + * + * @return the storageOutputRetention value. + */ + public Integer storageOutputRetention() { + return this.storageOutputRetention; + } + + /** + * Set the storageOutputRetention property: Field for storage output retention in days. + * + * @param storageOutputRetention the storageOutputRetention value to set. + * @return the DataTypeProperties object itself. + */ + public DataTypeProperties withStorageOutputRetention(Integer storageOutputRetention) { + this.storageOutputRetention = storageOutputRetention; + return this; + } + + /** + * Get the databaseCacheRetention property: Field for database cache retention in days. + * + * @return the databaseCacheRetention value. + */ + public Integer databaseCacheRetention() { + return this.databaseCacheRetention; + } + + /** + * Set the databaseCacheRetention property: Field for database cache retention in days. + * + * @param databaseCacheRetention the databaseCacheRetention value to set. + * @return the DataTypeProperties object itself. + */ + public DataTypeProperties withDatabaseCacheRetention(Integer databaseCacheRetention) { + this.databaseCacheRetention = databaseCacheRetention; + return this; + } + + /** + * Get the databaseRetention property: Field for database data retention in days. + * + * @return the databaseRetention value. + */ + public Integer databaseRetention() { + return this.databaseRetention; + } + + /** + * Set the databaseRetention property: Field for database data retention in days. + * + * @param databaseRetention the databaseRetention value to set. + * @return the DataTypeProperties object itself. + */ + public DataTypeProperties withDatabaseRetention(Integer databaseRetention) { + this.databaseRetention = databaseRetention; + return this; + } + + /** + * Get the visualizationUrl property: Url for data visualization. + * + * @return the visualizationUrl value. + */ + public String visualizationUrl() { + return this.visualizationUrl; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataTypeState.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataTypeState.java new file mode 100644 index 000000000000..727e80b3a33e --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataTypeState.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The data type state. + */ +public final class DataTypeState extends ExpandableStringEnum { + /** + * Static value Stopped for DataTypeState. + */ + public static final DataTypeState STOPPED = fromString("Stopped"); + + /** + * Static value Running for DataTypeState. + */ + public static final DataTypeState RUNNING = fromString("Running"); + + /** + * Creates a new instance of DataTypeState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataTypeState() { + } + + /** + * Creates or finds a DataTypeState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataTypeState. + */ + @JsonCreator + public static DataTypeState fromString(String name) { + return fromString(name, DataTypeState.class); + } + + /** + * Gets known DataTypeState values. + * + * @return known DataTypeState values. + */ + public static Collection values() { + return values(DataTypeState.class); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataTypeUpdate.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataTypeUpdate.java new file mode 100644 index 000000000000..9960877d3a5f --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataTypeUpdate.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type used for update operations of the DataType. + */ +@Fluent +public final class DataTypeUpdate { + /* + * The updatable properties of the DataType. + */ + @JsonProperty(value = "properties") + private DataTypeUpdateProperties properties; + + /** + * Creates an instance of DataTypeUpdate class. + */ + public DataTypeUpdate() { + } + + /** + * Get the properties property: The updatable properties of the DataType. + * + * @return the properties value. + */ + public DataTypeUpdateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The updatable properties of the DataType. + * + * @param properties the properties value to set. + * @return the DataTypeUpdate object itself. + */ + public DataTypeUpdate withProperties(DataTypeUpdateProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataTypeUpdateProperties.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataTypeUpdateProperties.java new file mode 100644 index 000000000000..756bbe5ffb34 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataTypeUpdateProperties.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The updatable properties of the DataType. + */ +@Fluent +public final class DataTypeUpdateProperties { + /* + * State of data type. + */ + @JsonProperty(value = "state") + private DataTypeState state; + + /* + * Field for storage output retention in days. + */ + @JsonProperty(value = "storageOutputRetention") + private Integer storageOutputRetention; + + /* + * Field for database cache retention in days. + */ + @JsonProperty(value = "databaseCacheRetention") + private Integer databaseCacheRetention; + + /* + * Field for database data retention in days. + */ + @JsonProperty(value = "databaseRetention") + private Integer databaseRetention; + + /** + * Creates an instance of DataTypeUpdateProperties class. + */ + public DataTypeUpdateProperties() { + } + + /** + * Get the state property: State of data type. + * + * @return the state value. + */ + public DataTypeState state() { + return this.state; + } + + /** + * Set the state property: State of data type. + * + * @param state the state value to set. + * @return the DataTypeUpdateProperties object itself. + */ + public DataTypeUpdateProperties withState(DataTypeState state) { + this.state = state; + return this; + } + + /** + * Get the storageOutputRetention property: Field for storage output retention in days. + * + * @return the storageOutputRetention value. + */ + public Integer storageOutputRetention() { + return this.storageOutputRetention; + } + + /** + * Set the storageOutputRetention property: Field for storage output retention in days. + * + * @param storageOutputRetention the storageOutputRetention value to set. + * @return the DataTypeUpdateProperties object itself. + */ + public DataTypeUpdateProperties withStorageOutputRetention(Integer storageOutputRetention) { + this.storageOutputRetention = storageOutputRetention; + return this; + } + + /** + * Get the databaseCacheRetention property: Field for database cache retention in days. + * + * @return the databaseCacheRetention value. + */ + public Integer databaseCacheRetention() { + return this.databaseCacheRetention; + } + + /** + * Set the databaseCacheRetention property: Field for database cache retention in days. + * + * @param databaseCacheRetention the databaseCacheRetention value to set. + * @return the DataTypeUpdateProperties object itself. + */ + public DataTypeUpdateProperties withDatabaseCacheRetention(Integer databaseCacheRetention) { + this.databaseCacheRetention = databaseCacheRetention; + return this; + } + + /** + * Get the databaseRetention property: Field for database data retention in days. + * + * @return the databaseRetention value. + */ + public Integer databaseRetention() { + return this.databaseRetention; + } + + /** + * Set the databaseRetention property: Field for database data retention in days. + * + * @param databaseRetention the databaseRetention value to set. + * @return the DataTypeUpdateProperties object itself. + */ + public DataTypeUpdateProperties withDatabaseRetention(Integer databaseRetention) { + this.databaseRetention = databaseRetention; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataTypes.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataTypes.java new file mode 100644 index 000000000000..6f9a337aa48b --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DataTypes.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.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 DataTypes. + */ +public interface DataTypes { + /** + * List data type by parent resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataType list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByDataProduct(String resourceGroupName, String dataProductName); + + /** + * List data type by parent resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DataType list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByDataProduct(String resourceGroupName, String dataProductName, Context context); + + /** + * Retrieve data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String dataProductName, String dataTypeName, + Context context); + + /** + * Retrieve data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the data type resource. + */ + DataType get(String resourceGroupName, String dataProductName, String dataTypeName); + + /** + * Delete data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String dataProductName, String dataTypeName); + + /** + * Delete data type resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String dataProductName, String dataTypeName, Context context); + + /** + * Delete data for data type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteData(String resourceGroupName, String dataProductName, String dataTypeName, Object body); + + /** + * Delete data for data type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteData(String resourceGroupName, String dataProductName, String dataTypeName, Object body, + Context context); + + /** + * Generate sas token for storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of storage container account sas token along with {@link Response}. + */ + Response generateStorageContainerSasTokenWithResponse(String resourceGroupName, + String dataProductName, String dataTypeName, ContainerSaS body, Context context); + + /** + * Generate sas token for storage container. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dataProductName The data product resource name. + * @param dataTypeName The data type name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of storage container account sas token. + */ + ContainerSasToken generateStorageContainerSasToken(String resourceGroupName, String dataProductName, + String dataTypeName, ContainerSaS body); + + /** + * Retrieve data type 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 data type resource along with {@link Response}. + */ + DataType getById(String id); + + /** + * Retrieve data type 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 data type resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete data type 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); + + /** + * Delete data type 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 DataType resource. + * + * @param name resource name. + * @return the first stage of the new DataType definition. + */ + DataType.DefinitionStages.Blank define(String name); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DefaultAction.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DefaultAction.java new file mode 100644 index 000000000000..a06feaa2fff5 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/DefaultAction.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Specifies the default action of allow or deny when no other rules match. + */ +public final class DefaultAction extends ExpandableStringEnum { + /** + * Static value Allow for DefaultAction. + */ + public static final DefaultAction ALLOW = fromString("Allow"); + + /** + * Static value Deny for DefaultAction. + */ + public static final DefaultAction DENY = fromString("Deny"); + + /** + * Creates a new instance of DefaultAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DefaultAction() { + } + + /** + * Creates or finds a DefaultAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding DefaultAction. + */ + @JsonCreator + public static DefaultAction fromString(String name) { + return fromString(name, DefaultAction.class); + } + + /** + * Gets known DefaultAction values. + * + * @return known DefaultAction values. + */ + public static Collection values() { + return values(DefaultAction.class); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/EncryptionKeyDetails.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/EncryptionKeyDetails.java new file mode 100644 index 000000000000..5de09cfc8bbd --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/EncryptionKeyDetails.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Encryption key details. + */ +@Fluent +public final class EncryptionKeyDetails { + /* + * The Uri of the key vault. + */ + @JsonProperty(value = "keyVaultUri", required = true) + private String keyVaultUri; + + /* + * The name of the key vault key. + */ + @JsonProperty(value = "keyName", required = true) + private String keyName; + + /* + * The version of the key vault key. + */ + @JsonProperty(value = "keyVersion", required = true) + private String keyVersion; + + /** + * Creates an instance of EncryptionKeyDetails class. + */ + public EncryptionKeyDetails() { + } + + /** + * Get the keyVaultUri property: The Uri of the key vault. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the keyVaultUri property: The Uri of the key vault. + * + * @param keyVaultUri the keyVaultUri value to set. + * @return the EncryptionKeyDetails object itself. + */ + public EncryptionKeyDetails withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + + /** + * Get the keyName property: The name of the key vault key. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: The name of the key vault key. + * + * @param keyName the keyName value to set. + * @return the EncryptionKeyDetails object itself. + */ + public EncryptionKeyDetails withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the keyVersion property: The version of the key vault key. + * + * @return the keyVersion value. + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set the keyVersion property: The version of the key vault key. + * + * @param keyVersion the keyVersion value to set. + * @return the EncryptionKeyDetails object itself. + */ + public EncryptionKeyDetails withKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultUri() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property keyVaultUri in model EncryptionKeyDetails")); + } + if (keyName() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property keyName in model EncryptionKeyDetails")); + } + if (keyVersion() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property keyVersion in model EncryptionKeyDetails")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EncryptionKeyDetails.class); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/IpRules.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/IpRules.java new file mode 100644 index 000000000000..073b90db207d --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/IpRules.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * IP rule with specific IP or IP range in CIDR format. + */ +@Fluent +public final class IpRules { + /* + * IP Rules Value + */ + @JsonProperty(value = "value") + private String value; + + /* + * The action of virtual network rule. + */ + @JsonProperty(value = "action", required = true) + private String action; + + /** + * Creates an instance of IpRules class. + */ + public IpRules() { + } + + /** + * Get the value property: IP Rules Value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: IP Rules Value. + * + * @param value the value value to set. + * @return the IpRules object itself. + */ + public IpRules withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the action property: The action of virtual network rule. + * + * @return the action value. + */ + public String action() { + return this.action; + } + + /** + * Set the action property: The action of virtual network rule. + * + * @param action the action value to set. + * @return the IpRules object itself. + */ + public IpRules withAction(String action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (action() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property action in model IpRules")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IpRules.class); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/KeyVaultInfo.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/KeyVaultInfo.java new file mode 100644 index 000000000000..bf7bf84fc0c7 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/KeyVaultInfo.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details for KeyVault. + */ +@Fluent +public final class KeyVaultInfo { + /* + * key vault url. + */ + @JsonProperty(value = "keyVaultUrl", required = true) + private String keyVaultUrl; + + /** + * Creates an instance of KeyVaultInfo class. + */ + public KeyVaultInfo() { + } + + /** + * Get the keyVaultUrl property: key vault url. + * + * @return the keyVaultUrl value. + */ + public String keyVaultUrl() { + return this.keyVaultUrl; + } + + /** + * Set the keyVaultUrl property: key vault url. + * + * @param keyVaultUrl the keyVaultUrl value to set. + * @return the KeyVaultInfo object itself. + */ + public KeyVaultInfo withKeyVaultUrl(String keyVaultUrl) { + this.keyVaultUrl = keyVaultUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultUrl() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property keyVaultUrl in model KeyVaultInfo")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KeyVaultInfo.class); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ListRoleAssignments.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ListRoleAssignments.java new file mode 100644 index 000000000000..ad214d52877e --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ListRoleAssignments.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.resourcemanager.networkanalytics.fluent.models.ListRoleAssignmentsInner; +import java.util.List; + +/** + * An immutable client-side representation of ListRoleAssignments. + */ +public interface ListRoleAssignments { + /** + * Gets the count property: Count of role assignments. + * + * @return the count value. + */ + int count(); + + /** + * Gets the roleAssignmentResponse property: list of role assignments. + * + * @return the roleAssignmentResponse value. + */ + List roleAssignmentResponse(); + + /** + * Gets the inner com.azure.resourcemanager.networkanalytics.fluent.models.ListRoleAssignmentsInner object. + * + * @return the inner object. + */ + ListRoleAssignmentsInner innerModel(); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ManagedResourceGroupConfiguration.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ManagedResourceGroupConfiguration.java new file mode 100644 index 000000000000..0400bd87aa34 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ManagedResourceGroupConfiguration.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * ManagedResourceGroup related properties. + */ +@Fluent +public final class ManagedResourceGroupConfiguration { + /* + * Name of managed resource group + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Managed Resource Group location + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Creates an instance of ManagedResourceGroupConfiguration class. + */ + public ManagedResourceGroupConfiguration() { + } + + /** + * Get the name property: Name of managed resource group. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of managed resource group. + * + * @param name the name value to set. + * @return the ManagedResourceGroupConfiguration object itself. + */ + public ManagedResourceGroupConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the location property: Managed Resource Group location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Managed Resource Group location. + * + * @param location the location value to set. + * @return the ManagedResourceGroupConfiguration object itself. + */ + public ManagedResourceGroupConfiguration withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property name in model ManagedResourceGroupConfiguration")); + } + if (location() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property location in model ManagedResourceGroupConfiguration")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedResourceGroupConfiguration.class); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ManagedServiceIdentity.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..02f264495942 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ManagedServiceIdentity.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import java.util.UUID; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public final class ManagedServiceIdentity { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tenantId; + + /* + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ + @JsonProperty(value = "type", required = true) + private ManagedServiceIdentityType type; + + /* + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/ + * userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedServiceIdentity class. + */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided + * for a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ManagedServiceIdentityType.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..b62b554cb38f --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ManagedServiceIdentityType.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** + * Static value None for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** + * Static value SystemAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * Static value UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Static value SystemAssigned, UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED + = fromString("SystemAssigned, UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + @JsonCreator + 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/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/Operation.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/Operation.java new file mode 100644 index 000000000000..666f8653ab5c --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/Operation.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.resourcemanager.networkanalytics.fluent.models.OperationInner; + +/** + * An immutable client-side representation of Operation. + */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.networkanalytics.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/OperationDisplay.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/OperationDisplay.java new file mode 100644 index 000000000000..f3089db10978 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/OperationDisplay.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Localized display information for this particular operation. + */ +@Immutable +public final class OperationDisplay { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + * Compute". + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + * Schedule Collections". + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + * Machine", "Restart Virtual Machine". + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + public OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/OperationListResult.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/OperationListResult.java new file mode 100644 index 000000000000..1fced1eee5ca --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/OperationListResult.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.networkanalytics.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + /* + * List of operations supported by the resource provider + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + public OperationListResult() { + } + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/Operations.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/Operations.java new file mode 100644 index 000000000000..ecf29e142584 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/Operations.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.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/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/Origin.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/Origin.java new file mode 100644 index 000000000000..697e13e080d2 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/Origin.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Static value user for Origin. + */ + public static final Origin USER = fromString("user"); + + /** + * Static value system for Origin. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Static value user,system for Origin. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + @JsonCreator + 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/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ProvisioningState.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ProvisioningState.java new file mode 100644 index 000000000000..bb9d98874249 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/ProvisioningState.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The status of the current operation. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Static value Succeeded for ProvisioningState. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for ProvisioningState. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for ProvisioningState. + */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Provisioning for ProvisioningState. + */ + public static final ProvisioningState PROVISIONING = fromString("Provisioning"); + + /** + * Static value Updating for ProvisioningState. + */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for ProvisioningState. + */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Accepted for ProvisioningState. + */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + 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/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/PublisherInformation.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/PublisherInformation.java new file mode 100644 index 000000000000..fa799f5275e8 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/PublisherInformation.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Details for Publisher Information. + */ +@Fluent +public final class PublisherInformation { + /* + * Name of the publisher. + */ + @JsonProperty(value = "publisherName", required = true) + private String publisherName; + + /* + * Data product information. + */ + @JsonProperty(value = "dataProducts", required = true) + private List dataProducts; + + /** + * Creates an instance of PublisherInformation class. + */ + public PublisherInformation() { + } + + /** + * Get the publisherName property: Name of the publisher. + * + * @return the publisherName value. + */ + public String publisherName() { + return this.publisherName; + } + + /** + * Set the publisherName property: Name of the publisher. + * + * @param publisherName the publisherName value to set. + * @return the PublisherInformation object itself. + */ + public PublisherInformation withPublisherName(String publisherName) { + this.publisherName = publisherName; + return this; + } + + /** + * Get the dataProducts property: Data product information. + * + * @return the dataProducts value. + */ + public List dataProducts() { + return this.dataProducts; + } + + /** + * Set the dataProducts property: Data product information. + * + * @param dataProducts the dataProducts value to set. + * @return the PublisherInformation object itself. + */ + public PublisherInformation withDataProducts(List dataProducts) { + this.dataProducts = dataProducts; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publisherName() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property publisherName in model PublisherInformation")); + } + if (dataProducts() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property dataProducts in model PublisherInformation")); + } else { + dataProducts().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PublisherInformation.class); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/RoleAssignmentCommonProperties.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/RoleAssignmentCommonProperties.java new file mode 100644 index 000000000000..1875d506327d --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/RoleAssignmentCommonProperties.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The details for role assignment common properties. + */ +@Fluent +public final class RoleAssignmentCommonProperties { + /* + * Role Id of the Built-In Role + */ + @JsonProperty(value = "roleId", required = true) + private String roleId; + + /* + * Object ID of the AAD principal or security-group. + */ + @JsonProperty(value = "principalId", required = true) + private String principalId; + + /* + * User name. + */ + @JsonProperty(value = "userName", required = true) + private String username; + + /* + * Data Type Scope at which the role assignment is created. + */ + @JsonProperty(value = "dataTypeScope", required = true) + private List dataTypeScope; + + /* + * Type of the principal Id: User, Group or ServicePrincipal + */ + @JsonProperty(value = "principalType", required = true) + private String principalType; + + /* + * Data Product role to be assigned to a user. + */ + @JsonProperty(value = "role", required = true) + private DataProductUserRole role; + + /** + * Creates an instance of RoleAssignmentCommonProperties class. + */ + public RoleAssignmentCommonProperties() { + } + + /** + * Get the roleId property: Role Id of the Built-In Role. + * + * @return the roleId value. + */ + public String roleId() { + return this.roleId; + } + + /** + * Set the roleId property: Role Id of the Built-In Role. + * + * @param roleId the roleId value to set. + * @return the RoleAssignmentCommonProperties object itself. + */ + public RoleAssignmentCommonProperties withRoleId(String roleId) { + this.roleId = roleId; + return this; + } + + /** + * Get the principalId property: Object ID of the AAD principal or security-group. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: Object ID of the AAD principal or security-group. + * + * @param principalId the principalId value to set. + * @return the RoleAssignmentCommonProperties object itself. + */ + public RoleAssignmentCommonProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the username property: User name. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: User name. + * + * @param username the username value to set. + * @return the RoleAssignmentCommonProperties object itself. + */ + public RoleAssignmentCommonProperties withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the dataTypeScope property: Data Type Scope at which the role assignment is created. + * + * @return the dataTypeScope value. + */ + public List dataTypeScope() { + return this.dataTypeScope; + } + + /** + * Set the dataTypeScope property: Data Type Scope at which the role assignment is created. + * + * @param dataTypeScope the dataTypeScope value to set. + * @return the RoleAssignmentCommonProperties object itself. + */ + public RoleAssignmentCommonProperties withDataTypeScope(List dataTypeScope) { + this.dataTypeScope = dataTypeScope; + return this; + } + + /** + * Get the principalType property: Type of the principal Id: User, Group or ServicePrincipal. + * + * @return the principalType value. + */ + public String principalType() { + return this.principalType; + } + + /** + * Set the principalType property: Type of the principal Id: User, Group or ServicePrincipal. + * + * @param principalType the principalType value to set. + * @return the RoleAssignmentCommonProperties object itself. + */ + public RoleAssignmentCommonProperties withPrincipalType(String principalType) { + this.principalType = principalType; + return this; + } + + /** + * Get the role property: Data Product role to be assigned to a user. + * + * @return the role value. + */ + public DataProductUserRole role() { + return this.role; + } + + /** + * Set the role property: Data Product role to be assigned to a user. + * + * @param role the role value to set. + * @return the RoleAssignmentCommonProperties object itself. + */ + public RoleAssignmentCommonProperties withRole(DataProductUserRole role) { + this.role = role; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (roleId() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property roleId in model RoleAssignmentCommonProperties")); + } + if (principalId() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property principalId in model RoleAssignmentCommonProperties")); + } + if (username() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property username in model RoleAssignmentCommonProperties")); + } + if (dataTypeScope() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property dataTypeScope in model RoleAssignmentCommonProperties")); + } + if (principalType() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property principalType in model RoleAssignmentCommonProperties")); + } + if (role() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property role in model RoleAssignmentCommonProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RoleAssignmentCommonProperties.class); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/RoleAssignmentDetail.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/RoleAssignmentDetail.java new file mode 100644 index 000000000000..3ae1886310fc --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/RoleAssignmentDetail.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.resourcemanager.networkanalytics.fluent.models.RoleAssignmentDetailInner; +import java.util.List; + +/** + * An immutable client-side representation of RoleAssignmentDetail. + */ +public interface RoleAssignmentDetail { + /** + * Gets the roleId property: Role Id of the Built-In Role. + * + * @return the roleId value. + */ + String roleId(); + + /** + * Gets the principalId property: Object ID of the AAD principal or security-group. + * + * @return the principalId value. + */ + String principalId(); + + /** + * Gets the username property: User name. + * + * @return the username value. + */ + String username(); + + /** + * Gets the dataTypeScope property: Data Type Scope at which the role assignment is created. + * + * @return the dataTypeScope value. + */ + List dataTypeScope(); + + /** + * Gets the principalType property: Type of the principal Id: User, Group or ServicePrincipal. + * + * @return the principalType value. + */ + String principalType(); + + /** + * Gets the role property: Data Product role to be assigned to a user. + * + * @return the role value. + */ + DataProductUserRole role(); + + /** + * Gets the roleAssignmentId property: Id of role assignment request. + * + * @return the roleAssignmentId value. + */ + String roleAssignmentId(); + + /** + * Gets the inner com.azure.resourcemanager.networkanalytics.fluent.models.RoleAssignmentDetailInner object. + * + * @return the inner object. + */ + RoleAssignmentDetailInner innerModel(); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/UserAssignedIdentity.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..76fab2986d86 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/UserAssignedIdentity.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** + * User assigned identity properties. + */ +@Immutable +public final class UserAssignedIdentity { + /* + * The principal ID of the assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private UUID clientId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/VirtualNetworkRule.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/VirtualNetworkRule.java new file mode 100644 index 000000000000..0a5b21bcd5e1 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/VirtualNetworkRule.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Virtual Network Rule. + */ +@Fluent +public final class VirtualNetworkRule { + /* + * Resource ID of a subnet + */ + @JsonProperty(value = "id", required = true) + private String id; + + /* + * The action of virtual network rule. + */ + @JsonProperty(value = "action") + private String action; + + /* + * Gets the state of virtual network rule. + */ + @JsonProperty(value = "state") + private String state; + + /** + * Creates an instance of VirtualNetworkRule class. + */ + public VirtualNetworkRule() { + } + + /** + * Get the id property: Resource ID of a subnet. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID of a subnet. + * + * @param id the id value to set. + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withId(String id) { + this.id = id; + return this; + } + + /** + * Get the action property: The action of virtual network rule. + * + * @return the action value. + */ + public String action() { + return this.action; + } + + /** + * Set the action property: The action of virtual network rule. + * + * @param action the action value to set. + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withAction(String action) { + this.action = action; + return this; + } + + /** + * Get the state property: Gets the state of virtual network rule. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Set the state property: Gets the state of virtual network rule. + * + * @param state the state value to set. + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withState(String state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property id in model VirtualNetworkRule")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkRule.class); +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/package-info.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/package-info.java new file mode 100644 index 000000000000..a471d6d4ab29 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for NetworkAnalyticsMgmtClient. + * null. + */ +package com.azure.resourcemanager.networkanalytics.models; diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/package-info.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/package-info.java new file mode 100644 index 000000000000..c2eac74843c1 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for NetworkAnalyticsMgmtClient. + * null. + */ +package com.azure.resourcemanager.networkanalytics; diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/module-info.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/module-info.java new file mode 100644 index 000000000000..51acd5a793c5 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/module-info.java @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.networkanalytics { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.networkanalytics; + exports com.azure.resourcemanager.networkanalytics.fluent; + exports com.azure.resourcemanager.networkanalytics.fluent.models; + exports com.azure.resourcemanager.networkanalytics.models; + + opens com.azure.resourcemanager.networkanalytics.fluent.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.networkanalytics.models to com.azure.core, com.fasterxml.jackson.databind; +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-networkanalytics/proxy-config.json b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-networkanalytics/proxy-config.json new file mode 100644 index 000000000000..274a22d318d2 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-networkanalytics/proxy-config.json @@ -0,0 +1 @@ +[ [ "com.azure.resourcemanager.networkanalytics.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.networkanalytics.implementation.DataProductsClientImpl$DataProductsService" ], [ "com.azure.resourcemanager.networkanalytics.implementation.DataProductsCatalogsClientImpl$DataProductsCatalogsService" ], [ "com.azure.resourcemanager.networkanalytics.implementation.DataTypesClientImpl$DataTypesService" ] ] \ No newline at end of file diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-networkanalytics/reflect-config.json b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-networkanalytics/reflect-config.json new file mode 100644 index 000000000000..373cf533b62e --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-networkanalytics/reflect-config.json @@ -0,0 +1,216 @@ +[ { + "name" : "com.azure.resourcemanager.networkanalytics.models.OperationListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.fluent.models.OperationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.OperationDisplay", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.DataProductListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.fluent.models.DataProductInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.DataProductProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.EncryptionKeyDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.DataProductNetworkAcls", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.VirtualNetworkRule", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.IpRules", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.ManagedResourceGroupConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.ConsumptionEndpointsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.ManagedServiceIdentity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.UserAssignedIdentity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.DataProductsCatalogListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.fluent.models.DataProductsCatalogInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.DataProductsCatalogProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.PublisherInformation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.DataProductInformation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.DataProductVersion", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.DataProductUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.DataProductUpdateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.RoleAssignmentCommonProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.fluent.models.RoleAssignmentDetailInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.DataTypeListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.fluent.models.DataTypeInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.DataTypeProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.DataTypeUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.DataTypeUpdateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.ContainerSaS", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.fluent.models.ContainerSasTokenInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.AccountSas", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.fluent.models.AccountSasTokenInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.fluent.models.ListRoleAssignmentsInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.KeyVaultInfo", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.Origin", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.ActionType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.ProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.ControlState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.DefaultAction", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.ManagedServiceIdentityType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.DataProductUserRole", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.networkanalytics.models.DataTypeState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +} ] \ No newline at end of file diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsAddUserRoleSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsAddUserRoleSamples.java new file mode 100644 index 000000000000..5623c1ae09b3 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsAddUserRoleSamples.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.generated; + +import com.azure.resourcemanager.networkanalytics.models.DataProductUserRole; +import com.azure.resourcemanager.networkanalytics.models.RoleAssignmentCommonProperties; +import java.util.Arrays; + +/** + * Samples for DataProducts AddUserRole. + */ +public final class DataProductsAddUserRoleSamples { + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProducts_AddUserRole_MinimumSet_Gen.json + */ + /** + * Sample code: DataProducts_AddUserRole_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsAddUserRoleMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().addUserRoleWithResponse("aoiresourceGroupName", "dataproduct01", + new RoleAssignmentCommonProperties().withRoleId("00000000-0000-0000-0000-00000000000") + .withPrincipalId("00000000-0000-0000-0000-00000000000").withUsername("userName") + .withDataTypeScope(Arrays.asList("scope")).withPrincipalType("User") + .withRole(DataProductUserRole.READER), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProducts_AddUserRole_MaximumSet_Gen.json + */ + /** + * Sample code: DataProducts_AddUserRole_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsAddUserRoleMaximumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().addUserRoleWithResponse("aoiresourceGroupName", "dataproduct01", + new RoleAssignmentCommonProperties().withRoleId("00000000-0000-0000-0000-00000000000") + .withPrincipalId("00000000-0000-0000-0000-00000000000").withUsername("UserName") + .withDataTypeScope(Arrays.asList("scope")).withPrincipalType("User") + .withRole(DataProductUserRole.READER), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogsGetByResourceGroupSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..501739a40693 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogsGetByResourceGroupSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.generated; + +/** + * Samples for DataProductsCatalogs GetByResourceGroup. + */ +public final class DataProductsCatalogsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProductsCatalogs_Get_MinimumSet_Gen.json + */ + /** + * Sample code: DataProductsCatalogs_Get_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsCatalogsGetMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProductsCatalogs().getByResourceGroupWithResponse("aoiresourceGroupName", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProductsCatalogs_Get_MaximumSet_Gen.json + */ + /** + * Sample code: DataProductsCatalogs_Get_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsCatalogsGetMaximumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProductsCatalogs().getByResourceGroupWithResponse("aoiresourceGroupName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogsListByResourceGroupSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogsListByResourceGroupSamples.java new file mode 100644 index 000000000000..f5b3eb22472a --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogsListByResourceGroupSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.generated; + +/** + * Samples for DataProductsCatalogs ListByResourceGroup. + */ +public final class DataProductsCatalogsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProductsCatalogs_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: DataProductsCatalogs_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsCatalogsListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProductsCatalogs().listByResourceGroup("aoiresourceGroupName", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProductsCatalogs_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: DataProductsCatalogs_ListByResourceGroup_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsCatalogsListByResourceGroupMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProductsCatalogs().listByResourceGroup("aoiresourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogsListSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogsListSamples.java new file mode 100644 index 000000000000..70ee3cdee1ea --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogsListSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.generated; + +/** + * Samples for DataProductsCatalogs List. + */ +public final class DataProductsCatalogsListSamples { + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProductsCatalogs_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: DataProductsCatalogs_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsCatalogsListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProductsCatalogs().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProductsCatalogs_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: DataProductsCatalogs_ListBySubscription_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsCatalogsListBySubscriptionMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProductsCatalogs().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCreateSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCreateSamples.java new file mode 100644 index 000000000000..1b93168922c0 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCreateSamples.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.generated; + +import com.azure.resourcemanager.networkanalytics.models.ControlState; +import com.azure.resourcemanager.networkanalytics.models.DataProductNetworkAcls; +import com.azure.resourcemanager.networkanalytics.models.DataProductProperties; +import com.azure.resourcemanager.networkanalytics.models.DefaultAction; +import com.azure.resourcemanager.networkanalytics.models.EncryptionKeyDetails; +import com.azure.resourcemanager.networkanalytics.models.IpRules; +import com.azure.resourcemanager.networkanalytics.models.ManagedResourceGroupConfiguration; +import com.azure.resourcemanager.networkanalytics.models.ManagedServiceIdentity; +import com.azure.resourcemanager.networkanalytics.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.networkanalytics.models.UserAssignedIdentity; +import com.azure.resourcemanager.networkanalytics.models.VirtualNetworkRule; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DataProducts Create. + */ +public final class DataProductsCreateSamples { + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProducts_Create_MaximumSet_Gen.json + */ + /** + * Sample code: DataProducts_Create_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void + dataProductsCreateMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().define("dataproduct01").withRegion("eastus") + .withExistingResourceGroup("aoiresourceGroupName") + .withTags(mapOf("userSpecifiedKeyName", "fakeTokenPlaceholder")) + .withProperties(new DataProductProperties().withPublisher("Microsoft").withProduct("MCC") + .withMajorVersion("1.0.0").withOwners(Arrays.asList("abc@micros.com")) + .withRedundancy(ControlState.DISABLED).withPurviewAccount("testpurview") + .withPurviewCollection("134567890").withPrivateLinksEnabled(ControlState.DISABLED) + .withPublicNetworkAccess(ControlState.ENABLED) + .withCustomerManagedKeyEncryptionEnabled(ControlState.ENABLED) + .withCustomerEncryptionKey(new EncryptionKeyDetails().withKeyVaultUri("fakeTokenPlaceholder") + .withKeyName("fakeTokenPlaceholder").withKeyVersion("fakeTokenPlaceholder")) + .withNetworkacls(new DataProductNetworkAcls() + .withVirtualNetworkRule(Arrays.asList(new VirtualNetworkRule().withId( + "/subscriptions/subscriptionId/resourcegroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/virtualNetworkName/subnets/subnetName") + .withAction("Allow").withState(""))) + .withIpRules(Arrays.asList(new IpRules().withValue("1.1.1.1").withAction("Allow"))) + .withAllowedQueryIpRangeList(Arrays.asList("1.1.1.1")).withDefaultAction(DefaultAction.ALLOW)) + .withManagedResourceGroupConfiguration( + new ManagedResourceGroupConfiguration().withName("managedResourceGroupName").withLocation("eastus")) + .withCurrentMinorVersion("1.0.1")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", + new UserAssignedIdentity()))) + .create(); + } + + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProducts_Create_MinimumSet_Gen.json + */ + /** + * Sample code: DataProducts_Create_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsCreateMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().define("dataproduct01").withRegion("eastus") + .withExistingResourceGroup("aoiresourceGroupName") + .withTags(mapOf("userSpecifiedKeyName", "fakeTokenPlaceholder")) + .withProperties( + new DataProductProperties().withPublisher("Microsoft").withProduct("MCC").withMajorVersion("1.0.0")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsDeleteSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsDeleteSamples.java new file mode 100644 index 000000000000..615a154fd215 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsDeleteSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.generated; + +/** + * Samples for DataProducts Delete. + */ +public final class DataProductsDeleteSamples { + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProducts_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: DataProducts_Delete_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void + dataProductsDeleteMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().delete("aoiresourceGroupName", "dataproduct01", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProducts_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: DataProducts_Delete_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsDeleteMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().delete("aoiresourceGroupName", "dataproduct01", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsGenerateStorageAccountSasTokenSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsGenerateStorageAccountSasTokenSamples.java new file mode 100644 index 000000000000..024769b4cbca --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsGenerateStorageAccountSasTokenSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.generated; + +import com.azure.resourcemanager.networkanalytics.models.AccountSas; +import java.time.OffsetDateTime; + +/** + * Samples for DataProducts GenerateStorageAccountSasToken. + */ +public final class DataProductsGenerateStorageAccountSasTokenSamples { + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProducts_GenerateStorageAccountSasToken_MinimumSet_Gen.json + */ + /** + * Sample code: DataProducts_GenerateStorageAccountSasToken_MaximumSet_Gen - generated by [MinimumSet] + * rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsGenerateStorageAccountSasTokenMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().generateStorageAccountSasTokenWithResponse("aoiresourceGroupName", "dataproduct01", + new AccountSas().withStartTimestamp(OffsetDateTime.parse("2023-08-24T05:35:17.051Z")) + .withExpiryTimestamp(OffsetDateTime.parse("2023-08-24T05:35:17.051Z")).withIpAddress("1.1.1.1"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProducts_GenerateStorageAccountSasToken_MaximumSet_Gen.json + */ + /** + * Sample code: DataProducts_GenerateStorageAccountSasToken_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsGenerateStorageAccountSasTokenMaximumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().generateStorageAccountSasTokenWithResponse("aoiresourceGroupName", "dataproduct01", + new AccountSas().withStartTimestamp(OffsetDateTime.parse("2023-08-24T05:34:58.151Z")) + .withExpiryTimestamp(OffsetDateTime.parse("2023-08-24T05:34:58.151Z")).withIpAddress("1.1.1.1"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsGetByResourceGroupSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..36af561f2ac1 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsGetByResourceGroupSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.generated; + +/** + * Samples for DataProducts GetByResourceGroup. + */ +public final class DataProductsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProducts_Get_MaximumSet_Gen.json + */ + /** + * Sample code: DataProducts_Get_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void + dataProductsGetMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().getByResourceGroupWithResponse("aoiresourceGroupName", "dataproduct01", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProducts_Get_MinimumSet_Gen.json + */ + /** + * Sample code: DataProducts_Get_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsGetMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().getByResourceGroupWithResponse("aoiresourceGroupName", "dataproduct01", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsListByResourceGroupSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsListByResourceGroupSamples.java new file mode 100644 index 000000000000..2e4c78e06fb3 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsListByResourceGroupSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.generated; + +/** + * Samples for DataProducts ListByResourceGroup. + */ +public final class DataProductsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProducts_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: DataProducts_ListByResourceGroup_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsListByResourceGroupMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().listByResourceGroup("aoiresourceGroupName", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProducts_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: DataProducts_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().listByResourceGroup("aoiresourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsListRolesAssignmentsSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsListRolesAssignmentsSamples.java new file mode 100644 index 000000000000..2a467222b1dd --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsListRolesAssignmentsSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** + * Samples for DataProducts ListRolesAssignments. + */ +public final class DataProductsListRolesAssignmentsSamples { + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProducts_ListRolesAssignments_MinimumSet_Gen.json + */ + /** + * Sample code: DataProducts_ListRolesAssignments_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsListRolesAssignmentsMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) throws IOException { + manager.dataProducts() + .listRolesAssignmentsWithResponse("aoiresourceGroupName", "dataproduct01", SerializerFactory + .createDefaultManagementSerializerAdapter().deserialize("{}", Object.class, SerializerEncoding.JSON), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProducts_ListRolesAssignments_MaximumSet_Gen.json + */ + /** + * Sample code: DataProducts_ListRolesAssignments_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsListRolesAssignmentsMaximumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) throws IOException { + manager.dataProducts() + .listRolesAssignmentsWithResponse("aoiresourceGroupName", "dataproduct01", SerializerFactory + .createDefaultManagementSerializerAdapter().deserialize("{}", Object.class, SerializerEncoding.JSON), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsListSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsListSamples.java new file mode 100644 index 000000000000..6d6259f4efdd --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsListSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.generated; + +/** + * Samples for DataProducts List. + */ +public final class DataProductsListSamples { + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProducts_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: DataProducts_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProducts_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: DataProducts_ListBySubscription_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsListBySubscriptionMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsRemoveUserRoleSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsRemoveUserRoleSamples.java new file mode 100644 index 000000000000..31c0f8f79a06 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsRemoveUserRoleSamples.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.generated; + +import com.azure.resourcemanager.networkanalytics.fluent.models.RoleAssignmentDetailInner; +import com.azure.resourcemanager.networkanalytics.models.DataProductUserRole; +import java.util.Arrays; + +/** + * Samples for DataProducts RemoveUserRole. + */ +public final class DataProductsRemoveUserRoleSamples { + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProducts_RemoveUserRole_MaximumSet_Gen.json + */ + /** + * Sample code: DataProducts_RemoveUserRole_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsRemoveUserRoleMaximumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().removeUserRoleWithResponse("aoiresourceGroupName", "dataproduct01", + new RoleAssignmentDetailInner().withRoleId("00000000-0000-0000-0000-00000000000") + .withPrincipalId("00000000-0000-0000-0000-00000000000").withUsername("UserName") + .withDataTypeScope(Arrays.asList("scope")).withPrincipalType("User") + .withRole(DataProductUserRole.READER).withRoleAssignmentId("00000000-0000-0000-0000-00000000000"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProducts_RemoveUserRole_MinimumSet_Gen.json + */ + /** + * Sample code: DataProducts_RemoveUserRole_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsRemoveUserRoleMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().removeUserRoleWithResponse("aoiresourceGroupName", "dataproduct01", + new RoleAssignmentDetailInner().withRoleId("00000000-0000-0000-0000-00000000000") + .withPrincipalId("00000000-0000-0000-0000-00000000000").withUsername("UserName") + .withDataTypeScope(Arrays.asList("scope")).withPrincipalType("User") + .withRole(DataProductUserRole.READER).withRoleAssignmentId("00000000-0000-0000-0000-00000000000"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsRotateKeySamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsRotateKeySamples.java new file mode 100644 index 000000000000..a42bd3c754dc --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsRotateKeySamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.generated; + +import com.azure.resourcemanager.networkanalytics.models.KeyVaultInfo; + +/** + * Samples for DataProducts RotateKey. + */ +public final class DataProductsRotateKeySamples { + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProducts_RotateKey_MaximumSet_Gen.json + */ + /** + * Sample code: DataProducts_RotateKey_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void + dataProductsRotateKeyMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().rotateKeyWithResponse("aoiresourceGroupName", "dataproduct01", + new KeyVaultInfo().withKeyVaultUrl("fakeTokenPlaceholder"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProducts_RotateKey_MinimumSet_Gen.json + */ + /** + * Sample code: DataProducts_RotateKey_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsRotateKeyMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts().rotateKeyWithResponse("aoiresourceGroupName", "dataproduct01", + new KeyVaultInfo().withKeyVaultUrl("fakeTokenPlaceholder"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsUpdateSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsUpdateSamples.java new file mode 100644 index 000000000000..a2031d49dee9 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsUpdateSamples.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.generated; + +import com.azure.resourcemanager.networkanalytics.models.ControlState; +import com.azure.resourcemanager.networkanalytics.models.DataProduct; +import com.azure.resourcemanager.networkanalytics.models.DataProductUpdateProperties; +import com.azure.resourcemanager.networkanalytics.models.ManagedServiceIdentity; +import com.azure.resourcemanager.networkanalytics.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.networkanalytics.models.UserAssignedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DataProducts Update. + */ +public final class DataProductsUpdateSamples { + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProducts_Update_MaximumSet_Gen.json + */ + /** + * Sample code: DataProducts_Update_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void + dataProductsUpdateMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + DataProduct resource = manager.dataProducts() + .getByResourceGroupWithResponse("aoiresourceGroupName", "dataproduct01", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("userSpecifiedKeyName", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", + new UserAssignedIdentity()))) + .withProperties( + new DataProductUpdateProperties().withOwners(Arrays.asList("abc@micros.com", "def@micros.com")) + .withPurviewAccount("testpurview").withPurviewCollection("134567890") + .withPrivateLinksEnabled(ControlState.DISABLED).withCurrentMinorVersion("1.0.1")) + .apply(); + } + + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataProducts_Update_MinimumSet_Gen.json + */ + /** + * Sample code: DataProducts_Update_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataProductsUpdateMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + DataProduct resource = manager.dataProducts() + .getByResourceGroupWithResponse("aoiresourceGroupName", "dataproduct01", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesCreateSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesCreateSamples.java new file mode 100644 index 000000000000..126be7572836 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesCreateSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.generated; + +import com.azure.resourcemanager.networkanalytics.models.DataTypeProperties; +import com.azure.resourcemanager.networkanalytics.models.DataTypeState; + +/** + * Samples for DataTypes Create. + */ +public final class DataTypesCreateSamples { + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataTypes_Create_MaximumSet_Gen.json + */ + /** + * Sample code: DataTypes_Create_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void + dataTypesCreateMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes().define("datatypename").withExistingDataProduct("aoiresourceGroupName", "dataproduct01") + .withProperties(new DataTypeProperties().withState(DataTypeState.fromString("STARTED")) + .withStorageOutputRetention(27).withDatabaseCacheRetention(23).withDatabaseRetention(6)) + .create(); + } + + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataTypes_Create_MinimumSet_Gen.json + */ + /** + * Sample code: DataTypes_Create_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesCreateMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes().define("datatypename").withExistingDataProduct("aoiresourceGroupName", "dataproduct01") + .create(); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesDeleteDataSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesDeleteDataSamples.java new file mode 100644 index 000000000000..75d988400552 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesDeleteDataSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** + * Samples for DataTypes DeleteData. + */ +public final class DataTypesDeleteDataSamples { + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataTypes_DeleteData_MinimumSet_Gen.json + */ + /** + * Sample code: DataTypes_DeleteData_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesDeleteDataMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) throws IOException { + manager.dataTypes() + .deleteData("aoiresourceGroupName", "dataproduct01", "datatypename", SerializerFactory + .createDefaultManagementSerializerAdapter().deserialize("{}", Object.class, SerializerEncoding.JSON), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataTypes_DeleteData_MaximumSet_Gen.json + */ + /** + * Sample code: DataTypes_DeleteData_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesDeleteDataMaximumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) throws IOException { + manager.dataTypes() + .deleteData("aoiresourceGroupName", "dataproduct01", "datatypename", SerializerFactory + .createDefaultManagementSerializerAdapter().deserialize("{}", Object.class, SerializerEncoding.JSON), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesDeleteSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesDeleteSamples.java new file mode 100644 index 000000000000..ea07350af132 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesDeleteSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.generated; + +/** + * Samples for DataTypes Delete. + */ +public final class DataTypesDeleteSamples { + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataTypes_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: DataTypes_Delete_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesDeleteMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes().delete("aoiresourceGroupName", "dataproduct01", "datatypename", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataTypes_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: DataTypes_Delete_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void + dataTypesDeleteMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes().delete("aoiresourceGroupName", "dataproduct01", "datatypename", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesGenerateStorageContainerSasTokenSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesGenerateStorageContainerSasTokenSamples.java new file mode 100644 index 000000000000..b892aea87ab5 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesGenerateStorageContainerSasTokenSamples.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.generated; + +import com.azure.resourcemanager.networkanalytics.models.ContainerSaS; +import java.time.OffsetDateTime; + +/** + * Samples for DataTypes GenerateStorageContainerSasToken. + */ +public final class DataTypesGenerateStorageContainerSasTokenSamples { + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataTypes_GenerateStorageContainerSasToken_MaximumSet_Gen.json + */ + /** + * Sample code: DataTypes_GenerateStorageContainerSasToken_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesGenerateStorageContainerSasTokenMaximumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes().generateStorageContainerSasTokenWithResponse("aoiresourceGroupName", "dataproduct01", + "datatypename", + new ContainerSaS().withStartTimestamp(OffsetDateTime.parse("2023-08-24T05:34:58.039Z")) + .withExpiryTimestamp(OffsetDateTime.parse("2023-08-24T05:34:58.039Z")).withIpAddress("1.1.1.1"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataTypes_GenerateStorageContainerSasToken_MinimumSet_Gen.json + */ + /** + * Sample code: DataTypes_GenerateStorageContainerSasToken_MaximumSet_Gen - generated by [MinimumSet] + * rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesGenerateStorageContainerSasTokenMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes().generateStorageContainerSasTokenWithResponse("aoiresourceGroupName", "dataproduct01", + "datatypename", + new ContainerSaS().withStartTimestamp(OffsetDateTime.parse("2023-08-24T05:35:16.887Z")) + .withExpiryTimestamp(OffsetDateTime.parse("2023-08-24T05:35:16.887Z")).withIpAddress("1.1.1.1"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesGetSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesGetSamples.java new file mode 100644 index 000000000000..c0297be64593 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesGetSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.generated; + +/** + * Samples for DataTypes Get. + */ +public final class DataTypesGetSamples { + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataTypes_Get_MinimumSet_Gen.json + */ + /** + * Sample code: DataTypes_Get_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesGetMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes().getWithResponse("aoiresourceGroupName", "dataproduct01", "datatypename", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataTypes_Get_MaximumSet_Gen.json + */ + /** + * Sample code: DataTypes_Get_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void + dataTypesGetMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes().getWithResponse("aoiresourceGroupName", "dataproduct01", "datatypename", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesListByDataProductSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesListByDataProductSamples.java new file mode 100644 index 000000000000..9aee933006c7 --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesListByDataProductSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.generated; + +/** + * Samples for DataTypes ListByDataProduct. + */ +public final class DataTypesListByDataProductSamples { + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataTypes_ListByDataProduct_MaximumSet_Gen.json + */ + /** + * Sample code: DataTypes_ListByDataProduct_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesListByDataProductMaximumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes().listByDataProduct("aoiresourceGroupName", "dataproduct01", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataTypes_ListByDataProduct_MinimumSet_Gen.json + */ + /** + * Sample code: DataTypes_ListByDataProduct_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesListByDataProductMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes().listByDataProduct("aoiresourceGroupName", "dataproduct01", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesUpdateSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesUpdateSamples.java new file mode 100644 index 000000000000..7aede019f90c --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesUpdateSamples.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.generated; + +import com.azure.resourcemanager.networkanalytics.models.DataType; +import com.azure.resourcemanager.networkanalytics.models.DataTypeState; +import com.azure.resourcemanager.networkanalytics.models.DataTypeUpdateProperties; + +/** + * Samples for DataTypes Update. + */ +public final class DataTypesUpdateSamples { + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataTypes_Update_MinimumSet_Gen.json + */ + /** + * Sample code: DataTypes_Update_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void dataTypesUpdateMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + DataType resource = manager.dataTypes() + .getWithResponse("aoiresourceGroupName", "dataproduct01", "datatypename", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } + + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * DataTypes_Update_MaximumSet_Gen.json + */ + /** + * Sample code: DataTypes_Update_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void + dataTypesUpdateMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + DataType resource = manager.dataTypes() + .getWithResponse("aoiresourceGroupName", "dataproduct01", "datatypename", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withProperties(new DataTypeUpdateProperties().withState(DataTypeState.fromString("STARTED")) + .withStorageOutputRetention(30).withDatabaseCacheRetention(16).withDatabaseRetention(9)).apply(); + } +} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/OperationsListSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/OperationsListSamples.java new file mode 100644 index 000000000000..b81379bb486a --- /dev/null +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/OperationsListSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkanalytics.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet_Gen - generated by [MinimumSet] rule_MinimumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void operationsListMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/ + * Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet_Gen. + * + * @param manager Entry point to NetworkAnalyticsManager. + */ + public static void + operationsListMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkanalytics/ci.yml b/sdk/networkanalytics/ci.yml new file mode 100644 index 000000000000..339204c5378c --- /dev/null +++ b/sdk/networkanalytics/ci.yml @@ -0,0 +1,47 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/networkanalytics/ci.yml + - sdk/networkanalytics/azure-resourcemanager-networkanalytics/ + exclude: + - sdk/networkanalytics/pom.xml + - sdk/networkanalytics/azure-resourcemanager-networkanalytics/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkanalytics/ci.yml + - sdk/networkanalytics/azure-resourcemanager-networkanalytics/ + exclude: + - sdk/networkanalytics/pom.xml + - sdk/networkanalytics/azure-resourcemanager-networkanalytics/pom.xml + +parameters: + - name: release_azureresourcemanagernetworkanalytics + displayName: azure-resourcemanager-networkanalytics + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: networkanalytics + EnableBatchRelease: true + Artifacts: + - name: azure-resourcemanager-networkanalytics + groupId: com.azure.resourcemanager + safeName: azureresourcemanagernetworkanalytics + releaseInBatch: ${{ parameters.release_azureresourcemanagernetworkanalytics }} diff --git a/sdk/networkanalytics/pom.xml b/sdk/networkanalytics/pom.xml new file mode 100644 index 000000000000..5e6b0fc7a759 --- /dev/null +++ b/sdk/networkanalytics/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-networkanalytics-service + pom + 1.0.0 + + + azure-resourcemanager-networkanalytics + +