diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/CHANGELOG.md b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/CHANGELOG.md index 9121c655ade8..d280c00e6575 100644 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/CHANGELOG.md +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/CHANGELOG.md @@ -1,14 +1,145 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2024-08-28) + +- 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). ### Features Added -### Breaking Changes +#### `models.DataTypeProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DataProductUpdateProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DataProductInformation` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AccountSas` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ManagedResourceGroupConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DataTypeUpdateProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.OperationDisplay` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ConsumptionEndpointsProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DataTypeListResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DataProductUpdate` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.VirtualNetworkRule` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.IpRules` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DataProductNetworkAcls` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.KeyVaultInfo` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.UserAssignedIdentity` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.PublisherInformation` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.OperationListResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DataProductProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ContainerSaS` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DataTypeUpdate` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.EncryptionKeyDetails` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.DataProductVersion` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DataProductsCatalogListResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ManagedServiceIdentity` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DataProductListResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.RoleAssignmentCommonProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added -### Bugs Fixed +#### `models.DataProductsCatalogProperties` was modified -### Other Changes +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added ## 1.0.0 (2024-01-24) diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/README.md b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/README.md index 5954f2714efb..4a6fa66efd98 100644 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/README.md +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-networkanalytics - 1.0.0 + 1.1.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -45,15 +45,11 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. -- `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. +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -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: +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -97,6 +93,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/SAMPLE.md b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/SAMPLE.md index ecfc094d5214..34e8ac9ea797 100644 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/SAMPLE.md +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/SAMPLE.md @@ -40,34 +40,55 @@ 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 + * 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); + 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 + * 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); + 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); } } ``` @@ -89,34 +110,79 @@ 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 + * 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(); + 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 + * 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(); + 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 @@ -141,26 +207,32 @@ public final class DataProductsCreateSamples { */ public final class DataProductsDeleteSamples { /* - * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Delete_MaximumSet_Gen.json + * 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) { + 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 + * 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) { + public static void dataProductsDeleteMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { manager.dataProducts().delete("aoiresourceGroupName", "dataproduct01", com.azure.core.util.Context.NONE); } } @@ -171,34 +243,50 @@ public final class DataProductsDeleteSamples { ```java import com.azure.resourcemanager.networkanalytics.models.AccountSas; import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; /** * 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 + * 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. + * 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); + 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 + * 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); + 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); } } ``` @@ -211,27 +299,35 @@ public final class DataProductsGenerateStorageAccountSasTokenSamples { */ public final class DataProductsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Get_MaximumSet_Gen.json + * 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); + 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 + * 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); + public static void dataProductsGetMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProducts() + .getByResourceGroupWithResponse("aoiresourceGroupName", "dataproduct01", com.azure.core.util.Context.NONE); } } ``` @@ -244,26 +340,32 @@ public final class DataProductsGetByResourceGroupSamples { */ public final class DataProductsListSamples { /* - * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_ListBySubscription_MaximumSet_Gen.json + * 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) { + 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 + * 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) { + public static void dataProductsListBySubscriptionMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { manager.dataProducts().list(com.azure.core.util.Context.NONE); } } @@ -277,26 +379,32 @@ public final class DataProductsListSamples { */ public final class DataProductsListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_ListByResourceGroup_MinimumSet_Gen.json + * 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) { + 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 + * 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) { + public static void dataProductsListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { manager.dataProducts().listByResourceGroup("aoiresourceGroupName", com.azure.core.util.Context.NONE); } } @@ -314,27 +422,41 @@ import java.io.IOException; */ public final class DataProductsListRolesAssignmentsSamples { /* - * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_ListRolesAssignments_MinimumSet_Gen.json + * 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); + 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 + * 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); + 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); } } ``` @@ -345,34 +467,57 @@ public final class DataProductsListRolesAssignmentsSamples { 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 + * 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); + 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 + * 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); + 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); } } ``` @@ -387,27 +532,37 @@ import com.azure.resourcemanager.networkanalytics.models.KeyVaultInfo; */ public final class DataProductsRotateKeySamples { /* - * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_RotateKey_MaximumSet_Gen.json + * 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); + 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 + * 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); + 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); } } ``` @@ -424,35 +579,56 @@ 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 + * 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(); + 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 + * 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(); + 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(); } @@ -478,27 +654,35 @@ public final class DataProductsUpdateSamples { */ public final class DataProductsCatalogsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProductsCatalogs_Get_MinimumSet_Gen.json + * 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); + 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 + * 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); + public static void dataProductsCatalogsGetMaximumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataProductsCatalogs() + .getByResourceGroupWithResponse("aoiresourceGroupName", com.azure.core.util.Context.NONE); } } ``` @@ -511,26 +695,32 @@ public final class DataProductsCatalogsGetByResourceGroupSamples { */ public final class DataProductsCatalogsListSamples { /* - * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProductsCatalogs_ListBySubscription_MaximumSet_Gen.json + * 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) { + 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 + * 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) { + public static void dataProductsCatalogsListBySubscriptionMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { manager.dataProductsCatalogs().list(com.azure.core.util.Context.NONE); } } @@ -544,26 +734,32 @@ public final class DataProductsCatalogsListSamples { */ public final class DataProductsCatalogsListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProductsCatalogs_ListByResourceGroup_MaximumSet_Gen.json + * 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) { + 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 + * 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) { + public static void dataProductsCatalogsListByResourceGroupMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { manager.dataProductsCatalogs().listByResourceGroup("aoiresourceGroupName", com.azure.core.util.Context.NONE); } } @@ -574,34 +770,49 @@ public final class DataProductsCatalogsListByResourceGroupSamples { ```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 + * 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(); + 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 + * 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(); + public static void dataTypesCreateMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes() + .define("datatypename") + .withExistingDataProduct("aoiresourceGroupName", "dataproduct01") + .create(); } } ``` @@ -614,27 +825,35 @@ public final class DataTypesCreateSamples { */ public final class DataTypesDeleteSamples { /* - * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Delete_MinimumSet_Gen.json + * 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); + 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 + * 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); + public static void + dataTypesDeleteMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes() + .delete("aoiresourceGroupName", "dataproduct01", "datatypename", com.azure.core.util.Context.NONE); } } ``` @@ -651,27 +870,41 @@ import java.io.IOException; */ public final class DataTypesDeleteDataSamples { /* - * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_DeleteData_MinimumSet_Gen.json + * 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); + 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 + * 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); + 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); } } ``` @@ -681,34 +914,50 @@ public final class DataTypesDeleteDataSamples { ```java import com.azure.resourcemanager.networkanalytics.models.ContainerSaS; import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; /** * 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 + * 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); + 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 + * 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. + * 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); + 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); } } ``` @@ -721,27 +970,35 @@ public final class DataTypesGenerateStorageContainerSasTokenSamples { */ public final class DataTypesGetSamples { /* - * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Get_MinimumSet_Gen.json + * 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); + 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 + * 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); + public static void + dataTypesGetMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes() + .getWithResponse("aoiresourceGroupName", "dataproduct01", "datatypename", com.azure.core.util.Context.NONE); } } ``` @@ -754,27 +1011,35 @@ public final class DataTypesGetSamples { */ public final class DataTypesListByDataProductSamples { /* - * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_ListByDataProduct_MaximumSet_Gen.json + * 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); + 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 + * 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); + public static void dataTypesListByDataProductMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( + com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { + manager.dataTypes() + .listByDataProduct("aoiresourceGroupName", "dataproduct01", com.azure.core.util.Context.NONE); } } ``` @@ -785,36 +1050,50 @@ public final class DataTypesListByDataProductSamples { 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 + * 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(); + 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 + * 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(); + 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(); } } ``` @@ -827,26 +1106,32 @@ public final class DataTypesUpdateSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/Operations_List_MinimumSet_Gen.json + * 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) { + 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 + * 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) { + 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 index 1759e7a0abfa..2b0aaa6dfcca 100644 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/pom.xml +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/pom.xml @@ -45,8 +45,14 @@ UTF-8 0 0 + true + + com.azure + azure-json + 1.2.0 + com.azure azure-core 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 index 53f94400f9ec..966e93b24358 100644 --- 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 @@ -11,8 +11,8 @@ 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.HttpLogOptions; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; @@ -58,8 +58,10 @@ private NetworkAnalyticsManager(HttpPipeline httpPipeline, AzureProfile profile, 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(); + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); } /** @@ -210,12 +212,19 @@ public NetworkAnalyticsManager authenticate(TokenCredential credential, AzurePro 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"); + 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)"); + 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)"); } @@ -234,18 +243,21 @@ public NetworkAnalyticsManager authenticate(TokenCredential credential, AzurePro 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) + 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())); + .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(); + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); return new NetworkAnalyticsManager(httpPipeline, profile, defaultPollInterval); } } 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 index 0f1de881cd87..3f12c6a34e50 100644 --- 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 @@ -6,17 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Details of storage account sas token . */ @Fluent -public final class AccountSasTokenInner { +public final class AccountSasTokenInner implements JsonSerializable { /* * Field to specify storage account sas token. */ - @JsonProperty(value = "storageAccountSasToken") private String storageAccountSasToken; /** @@ -52,10 +55,48 @@ public AccountSasTokenInner withStorageAccountSasToken(String storageAccountSasT */ public void validate() { if (storageAccountSasToken() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property storageAccountSasToken in model AccountSasTokenInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property storageAccountSasToken in model AccountSasTokenInner")); } } private static final ClientLogger LOGGER = new ClientLogger(AccountSasTokenInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("storageAccountSasToken", this.storageAccountSasToken); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountSasTokenInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountSasTokenInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AccountSasTokenInner. + */ + public static AccountSasTokenInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountSasTokenInner deserializedAccountSasTokenInner = new AccountSasTokenInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageAccountSasToken".equals(fieldName)) { + deserializedAccountSasTokenInner.storageAccountSasToken = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountSasTokenInner; + }); + } } 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 index 2605e2bdeb8f..214befd0d32d 100644 --- 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 @@ -6,17 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Details of storage container account sas token . */ @Fluent -public final class ContainerSasTokenInner { +public final class ContainerSasTokenInner implements JsonSerializable { /* * Field to specify storage container sas token. */ - @JsonProperty(value = "storageContainerSasToken") private String storageContainerSasToken; /** @@ -52,10 +55,48 @@ public ContainerSasTokenInner withStorageContainerSasToken(String storageContain */ public void validate() { if (storageContainerSasToken() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property storageContainerSasToken in model ContainerSasTokenInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property storageContainerSasToken in model ContainerSasTokenInner")); } } private static final ClientLogger LOGGER = new ClientLogger(ContainerSasTokenInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("storageContainerSasToken", this.storageContainerSasToken); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerSasTokenInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerSasTokenInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ContainerSasTokenInner. + */ + public static ContainerSasTokenInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerSasTokenInner deserializedContainerSasTokenInner = new ContainerSasTokenInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageContainerSasToken".equals(fieldName)) { + deserializedContainerSasTokenInner.storageContainerSasToken = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerSasTokenInner; + }); + } } 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 index 638b2cd83b66..0216b3c7b81f 100644 --- 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 @@ -7,9 +7,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.networkanalytics.models.DataProductProperties; import com.azure.resourcemanager.networkanalytics.models.ManagedServiceIdentity; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; /** @@ -20,21 +23,33 @@ 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; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of DataProductInner class. */ @@ -90,6 +105,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * {@inheritDoc} */ @@ -121,4 +166,59 @@ public void validate() { identity().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataProductInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataProductInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataProductInner. + */ + public static DataProductInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataProductInner deserializedDataProductInner = new DataProductInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDataProductInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDataProductInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDataProductInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedDataProductInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDataProductInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedDataProductInner.properties = DataProductProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedDataProductInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDataProductInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDataProductInner; + }); + } } 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 index b4e3467554dd..543b161334ea 100644 --- 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 @@ -7,8 +7,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.networkanalytics.models.DataProductsCatalogProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The data catalog resource. @@ -18,15 +21,28 @@ 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; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of DataProductsCatalogInner class. */ @@ -62,6 +78,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. * @@ -72,4 +118,49 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataProductsCatalogInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataProductsCatalogInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataProductsCatalogInner. + */ + public static DataProductsCatalogInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataProductsCatalogInner deserializedDataProductsCatalogInner = new DataProductsCatalogInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDataProductsCatalogInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDataProductsCatalogInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDataProductsCatalogInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDataProductsCatalogInner.properties = DataProductsCatalogProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDataProductsCatalogInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDataProductsCatalogInner; + }); + } } 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 index 414722f2786f..b5b5200635e9 100644 --- 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 @@ -7,8 +7,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.networkanalytics.models.DataTypeProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The data type resource. @@ -18,15 +21,28 @@ 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; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of DataTypeInner class. */ @@ -62,6 +78,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. * @@ -72,4 +118,49 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataTypeInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataTypeInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataTypeInner. + */ + public static DataTypeInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataTypeInner deserializedDataTypeInner = new DataTypeInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDataTypeInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDataTypeInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDataTypeInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDataTypeInner.properties = DataTypeProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDataTypeInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDataTypeInner; + }); + } } 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 index 869b0e05bd1c..8246cf2348f3 100644 --- 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 @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * list role assignments. */ @Fluent -public final class ListRoleAssignmentsInner { +public final class ListRoleAssignmentsInner implements JsonSerializable { /* * Count of role assignments. */ - @JsonProperty(value = "count", required = true) private int count; /* * list of role assignments */ - @JsonProperty(value = "roleAssignmentResponse", required = true) private List roleAssignmentResponse; /** @@ -79,12 +81,56 @@ public ListRoleAssignmentsInner withRoleAssignmentResponse(List e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(ListRoleAssignmentsInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("count", this.count); + jsonWriter.writeArrayField("roleAssignmentResponse", this.roleAssignmentResponse, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListRoleAssignmentsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListRoleAssignmentsInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ListRoleAssignmentsInner. + */ + public static ListRoleAssignmentsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListRoleAssignmentsInner deserializedListRoleAssignmentsInner = new ListRoleAssignmentsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("count".equals(fieldName)) { + deserializedListRoleAssignmentsInner.count = reader.getInt(); + } else if ("roleAssignmentResponse".equals(fieldName)) { + List roleAssignmentResponse + = reader.readArray(reader1 -> RoleAssignmentDetailInner.fromJson(reader1)); + deserializedListRoleAssignmentsInner.roleAssignmentResponse = roleAssignmentResponse; + } else { + reader.skipChildren(); + } + } + + return deserializedListRoleAssignmentsInner; + }); + } } 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 index a5190e2372fc..fa3f5ea9a80e 100644 --- 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 @@ -5,10 +5,14 @@ package com.azure.resourcemanager.networkanalytics.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.networkanalytics.models.ActionType; import com.azure.resourcemanager.networkanalytics.models.OperationDisplay; import com.azure.resourcemanager.networkanalytics.models.Origin; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * REST API Operation @@ -16,38 +20,33 @@ * Details of a REST API operation, returned from the Resource Provider Operations API. */ @Fluent -public final class OperationInner { +public final class OperationInner implements JsonSerializable { /* * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ - @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; /** @@ -126,4 +125,48 @@ public void validate() { display().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } } diff --git a/sdk/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 index f434d38ef789..fb86d334d249 100644 --- 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 @@ -6,55 +6,52 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.networkanalytics.models.DataProductUserRole; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The details for role assignment response. */ @Fluent -public final class RoleAssignmentDetailInner { +public final class RoleAssignmentDetailInner implements JsonSerializable { /* * 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; /** @@ -210,34 +207,97 @@ public RoleAssignmentDetailInner withRoleAssignmentId(String roleAssignmentId) { */ public void validate() { if (roleId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property roleId in model RoleAssignmentDetailInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property roleId in model RoleAssignmentDetailInner")); } if (principalId() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property principalId in model RoleAssignmentDetailInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property principalId in model RoleAssignmentDetailInner")); } if (username() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property username in model RoleAssignmentDetailInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property username in model RoleAssignmentDetailInner")); } if (dataTypeScope() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property dataTypeScope in model RoleAssignmentDetailInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dataTypeScope in model RoleAssignmentDetailInner")); } if (principalType() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property principalType in model RoleAssignmentDetailInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property principalType in model RoleAssignmentDetailInner")); } if (role() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property role in model RoleAssignmentDetailInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property role in model RoleAssignmentDetailInner")); } if (roleAssignmentId() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property roleAssignmentId in model RoleAssignmentDetailInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property roleAssignmentId in model RoleAssignmentDetailInner")); } } private static final ClientLogger LOGGER = new ClientLogger(RoleAssignmentDetailInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("roleId", this.roleId); + jsonWriter.writeStringField("principalId", this.principalId); + jsonWriter.writeStringField("userName", this.username); + jsonWriter.writeArrayField("dataTypeScope", this.dataTypeScope, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("principalType", this.principalType); + jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString()); + jsonWriter.writeStringField("roleAssignmentId", this.roleAssignmentId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoleAssignmentDetailInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoleAssignmentDetailInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RoleAssignmentDetailInner. + */ + public static RoleAssignmentDetailInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoleAssignmentDetailInner deserializedRoleAssignmentDetailInner = new RoleAssignmentDetailInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("roleId".equals(fieldName)) { + deserializedRoleAssignmentDetailInner.roleId = reader.getString(); + } else if ("principalId".equals(fieldName)) { + deserializedRoleAssignmentDetailInner.principalId = reader.getString(); + } else if ("userName".equals(fieldName)) { + deserializedRoleAssignmentDetailInner.username = reader.getString(); + } else if ("dataTypeScope".equals(fieldName)) { + List dataTypeScope = reader.readArray(reader1 -> reader1.getString()); + deserializedRoleAssignmentDetailInner.dataTypeScope = dataTypeScope; + } else if ("principalType".equals(fieldName)) { + deserializedRoleAssignmentDetailInner.principalType = reader.getString(); + } else if ("role".equals(fieldName)) { + deserializedRoleAssignmentDetailInner.role = DataProductUserRole.fromString(reader.getString()); + } else if ("roleAssignmentId".equals(fieldName)) { + deserializedRoleAssignmentDetailInner.roleAssignmentId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRoleAssignmentDetailInner; + }); + } } 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 index 2862cdbb52a8..e06fd32b1f01 100644 --- 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 @@ -98,14 +98,16 @@ public DataProductImpl withExistingResourceGroup(String resourceGroupName) { } public DataProduct create() { - this.innerObject = serviceManager.serviceClient().getDataProducts().create(resourceGroupName, dataProductName, - this.innerModel(), Context.NONE); + 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); + this.innerObject = serviceManager.serviceClient() + .getDataProducts() + .create(resourceGroupName, dataProductName, this.innerModel(), context); return this; } @@ -121,14 +123,16 @@ public DataProductImpl update() { } public DataProduct apply() { - this.innerObject = serviceManager.serviceClient().getDataProducts().update(resourceGroupName, dataProductName, - updateProperties, Context.NONE); + 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); + this.innerObject = serviceManager.serviceClient() + .getDataProducts() + .update(resourceGroupName, dataProductName, updateProperties, context); return this; } @@ -141,14 +145,18 @@ public DataProduct apply(Context context) { } public DataProduct refresh() { - this.innerObject = serviceManager.serviceClient().getDataProducts() - .getByResourceGroupWithResponse(resourceGroupName, dataProductName, Context.NONE).getValue(); + 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(); + this.innerObject = serviceManager.serviceClient() + .getDataProducts() + .getByResourceGroupWithResponse(resourceGroupName, dataProductName, context) + .getValue(); return this; } @@ -162,8 +170,8 @@ public RoleAssignmentDetail addUserRole(RoleAssignmentCommonProperties body) { } public Response generateStorageAccountSasTokenWithResponse(AccountSas body, Context context) { - return serviceManager.dataProducts().generateStorageAccountSasTokenWithResponse(resourceGroupName, - dataProductName, body, context); + return serviceManager.dataProducts() + .generateStorageAccountSasTokenWithResponse(resourceGroupName, dataProductName, body, context); } public AccountSasToken generateStorageAccountSasToken(AccountSas body) { @@ -171,8 +179,8 @@ public AccountSasToken generateStorageAccountSasToken(AccountSas body) { } public Response listRolesAssignmentsWithResponse(Object body, Context context) { - return serviceManager.dataProducts().listRolesAssignmentsWithResponse(resourceGroupName, dataProductName, body, - context); + return serviceManager.dataProducts() + .listRolesAssignmentsWithResponse(resourceGroupName, dataProductName, body, context); } public ListRoleAssignments listRolesAssignments(Object body) { @@ -180,8 +188,8 @@ public ListRoleAssignments listRolesAssignments(Object body) { } public Response removeUserRoleWithResponse(RoleAssignmentDetailInner body, Context context) { - return serviceManager.dataProducts().removeUserRoleWithResponse(resourceGroupName, dataProductName, body, - context); + return serviceManager.dataProducts() + .removeUserRoleWithResponse(resourceGroupName, dataProductName, body, context); } public void removeUserRole(RoleAssignmentDetailInner body) { 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 index 3afa90e3fb9f..5df3d365d78d 100644 --- 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 @@ -451,9 +451,7 @@ public DataProductsCatalogInner getByResourceGroup(String resourceGroupName) { /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -481,9 +479,7 @@ private Mono> listBySubscriptionNextSing /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -511,9 +507,7 @@ private Mono> listBySubscriptionNextSing /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -541,9 +535,7 @@ private Mono> listByResourceGroupNextSin /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. 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 index 58bdfc22321f..c1345c827d47 100644 --- 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 @@ -1914,9 +1914,7 @@ public void rotateKey(String resourceGroupName, String dataProductName, KeyVault /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1944,9 +1942,7 @@ private Mono> listBySubscriptionNextSinglePageAs /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1974,9 +1970,7 @@ private Mono> listBySubscriptionNextSinglePageAs /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2004,9 +1998,7 @@ private Mono> listByResourceGroupNextSinglePageA /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. 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 index 9c5b72e41ed3..e60ed1002001 100644 --- 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 @@ -67,14 +67,16 @@ public DataTypeImpl withExistingDataProduct(String resourceGroupName, String dat } public DataType create() { - this.innerObject = serviceManager.serviceClient().getDataTypes().create(resourceGroupName, dataProductName, - dataTypeName, this.innerModel(), Context.NONE); + 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); + this.innerObject = serviceManager.serviceClient() + .getDataTypes() + .create(resourceGroupName, dataProductName, dataTypeName, this.innerModel(), context); return this; } @@ -90,14 +92,16 @@ public DataTypeImpl update() { } public DataType apply() { - this.innerObject = serviceManager.serviceClient().getDataTypes().update(resourceGroupName, dataProductName, - dataTypeName, updateProperties, Context.NONE); + 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); + this.innerObject = serviceManager.serviceClient() + .getDataTypes() + .update(resourceGroupName, dataProductName, dataTypeName, updateProperties, context); return this; } @@ -111,14 +115,18 @@ public DataType apply(Context context) { } public DataType refresh() { - this.innerObject = serviceManager.serviceClient().getDataTypes() - .getWithResponse(resourceGroupName, dataProductName, dataTypeName, Context.NONE).getValue(); + 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(); + this.innerObject = serviceManager.serviceClient() + .getDataTypes() + .getWithResponse(resourceGroupName, dataProductName, dataTypeName, context) + .getValue(); return this; } @@ -132,13 +140,14 @@ public void deleteData(Object body, Context context) { public Response generateStorageContainerSasTokenWithResponse(ContainerSaS body, Context context) { - return serviceManager.dataTypes().generateStorageContainerSasTokenWithResponse(resourceGroupName, - dataProductName, dataTypeName, body, context); + return serviceManager.dataTypes() + .generateStorageContainerSasTokenWithResponse(resourceGroupName, dataProductName, dataTypeName, body, + context); } public ContainerSasToken generateStorageContainerSasToken(ContainerSaS body) { - return serviceManager.dataTypes().generateStorageContainerSasToken(resourceGroupName, dataProductName, - dataTypeName, body); + return serviceManager.dataTypes() + .generateStorageContainerSasToken(resourceGroupName, dataProductName, dataTypeName, body); } public DataTypeImpl withProperties(DataTypeProperties properties) { 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 index bd23cfdcc76b..6fc94b103a2a 100644 --- 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 @@ -1558,9 +1558,7 @@ public ContainerSasTokenInner generateStorageContainerSasToken(String resourceGr /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1587,9 +1585,7 @@ private Mono> listByDataProductNextSinglePageAsync( /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. 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 index 73bd054b1095..0d8fe1128f79 100644 --- 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 @@ -82,8 +82,9 @@ public void deleteData(String resourceGroupName, String dataProductName, String public Response generateStorageContainerSasTokenWithResponse(String resourceGroupName, String dataProductName, String dataTypeName, ContainerSaS body, Context context) { - Response inner = this.serviceClient().generateStorageContainerSasTokenWithResponse( - resourceGroupName, dataProductName, dataTypeName, body, 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())); @@ -94,8 +95,8 @@ public Response generateStorageContainerSasTokenWithResponse( public ContainerSasToken generateStorageContainerSasToken(String resourceGroupName, String dataProductName, String dataTypeName, ContainerSaS body) { - ContainerSasTokenInner inner = this.serviceClient().generateStorageContainerSasToken(resourceGroupName, - dataProductName, dataTypeName, body); + ContainerSasTokenInner inner = this.serviceClient() + .generateStorageContainerSasToken(resourceGroupName, dataProductName, dataTypeName, body); if (inner != null) { return new ContainerSasTokenImpl(inner, this.manager()); } else { 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 index ecb40bcabba6..81f08723134f 100644 --- 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 @@ -31,7 +31,8 @@ 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())); + .map(inner1 -> new RoleAssignmentDetailImpl(inner1, this.manager())) + .collect(Collectors.toList())); } else { return Collections.emptyList(); } 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 index 1fbc4a03501d..6668be43de67 100644 --- 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 @@ -123,11 +123,13 @@ public NetworkAnalyticsMgmtClientBuilder serializerAdapter(SerializerAdapter ser public NetworkAnalyticsMgmtClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; - HttpPipeline localPipeline = (pipeline != null) ? pipeline + 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 + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); NetworkAnalyticsMgmtClientImpl client = new NetworkAnalyticsMgmtClientImpl(localPipeline, localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); 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 index c4eba671bf76..1426d73ad2bb 100644 --- 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.networkanalytics.implementation; import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpResponse; @@ -12,8 +13,8 @@ import com.azure.core.management.AzureEnvironment; import com.azure.core.management.exception.ManagementError; import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; @@ -265,8 +266,8 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, if (errorBody != null) { // try to deserialize error body to ManagementError try { - managementError = this.getSerializerAdapter().deserialize(errorBody, ManagementError.class, - SerializerEncoding.JSON); + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); if (managementError.getCode() == null || managementError.getMessage() == null) { managementError = null; } @@ -307,7 +308,7 @@ public int getStatusCode() { } public String getHeaderValue(String s) { - return httpHeaders.getValue(s); + return httpHeaders.getValue(HttpHeaderName.fromString(s)); } public HttpHeaders getHeaders() { 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 index 4d1c60ed46fa..1ba9b40f773f 100644 --- 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 @@ -183,9 +183,7 @@ public PagedIterable list(Context context) { /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -211,9 +209,7 @@ private Mono> listNextSinglePageAsync(String nextL /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/ResourceManagerUtils.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/ResourceManagerUtils.java index 3d4595a13e58..64148b83d4fb 100644 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/ResourceManagerUtils.java +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/com/azure/resourcemanager/networkanalytics/implementation/ResourceManagerUtils.java @@ -41,7 +41,6 @@ static String getValueFromIdByName(String id, String name) { } } return null; - } static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { @@ -75,7 +74,6 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } } return null; - } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { 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 index aa526f504f27..59cfbbd57ad2 100644 --- 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 @@ -5,31 +5,34 @@ package com.azure.resourcemanager.networkanalytics.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * The details for storage account sas creation. */ @Fluent -public final class AccountSas { +public final class AccountSas implements JsonSerializable { /* * 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; /** @@ -105,18 +108,65 @@ public AccountSas withIpAddress(String ipAddress) { */ public void validate() { if (startTimestamp() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property startTimestamp in model AccountSas")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property startTimestamp in model AccountSas")); } if (expiryTimestamp() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property expiryTimestamp in model AccountSas")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property expiryTimestamp in model AccountSas")); } if (ipAddress() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property ipAddress in model AccountSas")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property ipAddress in model AccountSas")); } } private static final ClientLogger LOGGER = new ClientLogger(AccountSas.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("startTimeStamp", + this.startTimestamp == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTimestamp)); + jsonWriter.writeStringField("expiryTimeStamp", + this.expiryTimestamp == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiryTimestamp)); + jsonWriter.writeStringField("ipAddress", this.ipAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountSas from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountSas if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AccountSas. + */ + public static AccountSas fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountSas deserializedAccountSas = new AccountSas(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startTimeStamp".equals(fieldName)) { + deserializedAccountSas.startTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("expiryTimeStamp".equals(fieldName)) { + deserializedAccountSas.expiryTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("ipAddress".equals(fieldName)) { + deserializedAccountSas.ipAddress = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountSas; + }); + } } 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 index 910774bf30c6..e8b4225f3edc 100644 --- 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.networkanalytics.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -32,7 +31,6 @@ public ActionType() { * @param name a name to look for. * @return the corresponding ActionType. */ - @JsonCreator public static ActionType fromString(String name) { return fromString(name, 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 index 12031b92bdb4..b0ccdba9db48 100644 --- 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 @@ -5,47 +5,45 @@ package com.azure.resourcemanager.networkanalytics.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Details of Consumption Properties. */ @Immutable -public final class ConsumptionEndpointsProperties { +public final class ConsumptionEndpointsProperties implements JsonSerializable { /* * 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; /** @@ -115,4 +113,50 @@ public String queryResourceId() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConsumptionEndpointsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConsumptionEndpointsProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConsumptionEndpointsProperties. + */ + public static ConsumptionEndpointsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConsumptionEndpointsProperties deserializedConsumptionEndpointsProperties + = new ConsumptionEndpointsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ingestionUrl".equals(fieldName)) { + deserializedConsumptionEndpointsProperties.ingestionUrl = reader.getString(); + } else if ("ingestionResourceId".equals(fieldName)) { + deserializedConsumptionEndpointsProperties.ingestionResourceId = reader.getString(); + } else if ("fileAccessUrl".equals(fieldName)) { + deserializedConsumptionEndpointsProperties.fileAccessUrl = reader.getString(); + } else if ("fileAccessResourceId".equals(fieldName)) { + deserializedConsumptionEndpointsProperties.fileAccessResourceId = reader.getString(); + } else if ("queryUrl".equals(fieldName)) { + deserializedConsumptionEndpointsProperties.queryUrl = reader.getString(); + } else if ("queryResourceId".equals(fieldName)) { + deserializedConsumptionEndpointsProperties.queryResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConsumptionEndpointsProperties; + }); + } } 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 index 7c159adf564c..3dec3c85be4b 100644 --- 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 @@ -5,31 +5,34 @@ package com.azure.resourcemanager.networkanalytics.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * The details for container sas creation. */ @Fluent -public final class ContainerSaS { +public final class ContainerSaS implements JsonSerializable { /* * 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; /** @@ -105,18 +108,65 @@ public ContainerSaS withIpAddress(String ipAddress) { */ public void validate() { if (startTimestamp() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property startTimestamp in model ContainerSaS")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property startTimestamp in model ContainerSaS")); } if (expiryTimestamp() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property expiryTimestamp in model ContainerSaS")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property expiryTimestamp in model ContainerSaS")); } if (ipAddress() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property ipAddress in model ContainerSaS")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property ipAddress in model ContainerSaS")); } } private static final ClientLogger LOGGER = new ClientLogger(ContainerSaS.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("startTimeStamp", + this.startTimestamp == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTimestamp)); + jsonWriter.writeStringField("expiryTimeStamp", + this.expiryTimestamp == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiryTimestamp)); + jsonWriter.writeStringField("ipAddress", this.ipAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerSaS from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerSaS if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ContainerSaS. + */ + public static ContainerSaS fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerSaS deserializedContainerSaS = new ContainerSaS(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startTimeStamp".equals(fieldName)) { + deserializedContainerSaS.startTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("expiryTimeStamp".equals(fieldName)) { + deserializedContainerSaS.expiryTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("ipAddress".equals(fieldName)) { + deserializedContainerSaS.ipAddress = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerSaS; + }); + } } 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 index 652e9da3c777..ac6b0944eb42 100644 --- 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.networkanalytics.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public ControlState() { * @param name a name to look for. * @return the corresponding ControlState. */ - @JsonCreator public static ControlState fromString(String name) { return fromString(name, 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 index 8bf4019f1247..615b805feb17 100644 --- 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 @@ -275,9 +275,9 @@ interface WithIdentity { */ interface WithProperties { /** - * Specifies the properties property: The updatable properties of the DataProduct.. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param properties The updatable properties of the DataProduct. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ Update withProperties(DataProductUpdateProperties properties); 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 index 60cad017ac36..5f5edbd079ca 100644 --- 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 @@ -6,30 +6,31 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Data Product Information. */ @Fluent -public final class DataProductInformation { +public final class DataProductInformation implements JsonSerializable { /* * 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; /** @@ -105,20 +106,69 @@ public DataProductInformation withDataProductVersions(List d */ public void validate() { if (dataProductName() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property dataProductName in model DataProductInformation")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dataProductName in model DataProductInformation")); } if (description() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property description in model DataProductInformation")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property description in model DataProductInformation")); } if (dataProductVersions() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property dataProductVersions in model DataProductInformation")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dataProductVersions in model DataProductInformation")); } else { dataProductVersions().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(DataProductInformation.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dataProductName", this.dataProductName); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("dataProductVersions", this.dataProductVersions, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataProductInformation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataProductInformation if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataProductInformation. + */ + public static DataProductInformation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataProductInformation deserializedDataProductInformation = new DataProductInformation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataProductName".equals(fieldName)) { + deserializedDataProductInformation.dataProductName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedDataProductInformation.description = reader.getString(); + } else if ("dataProductVersions".equals(fieldName)) { + List dataProductVersions + = reader.readArray(reader1 -> DataProductVersion.fromJson(reader1)); + deserializedDataProductInformation.dataProductVersions = dataProductVersions; + } else { + reader.skipChildren(); + } + } + + return deserializedDataProductInformation; + }); + } } 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 index 019d697ae184..b730d5d82e74 100644 --- 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 @@ -6,25 +6,27 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.networkanalytics.fluent.models.DataProductInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response of a DataProduct list operation. */ @Fluent -public final class DataProductListResult { +public final class DataProductListResult implements JsonSerializable { /* * 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; /** @@ -80,12 +82,53 @@ public DataProductListResult withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model DataProductListResult")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model DataProductListResult")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(DataProductListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataProductListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataProductListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataProductListResult. + */ + public static DataProductListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataProductListResult deserializedDataProductListResult = new DataProductListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> DataProductInner.fromJson(reader1)); + deserializedDataProductListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDataProductListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataProductListResult; + }); + } } 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 index 3488b26d6534..665bcb3bbdbd 100644 --- 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 @@ -6,36 +6,36 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Data Product Network rule set. */ @Fluent -public final class DataProductNetworkAcls { +public final class DataProductNetworkAcls implements JsonSerializable { /* * 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; /** @@ -133,26 +133,81 @@ public DataProductNetworkAcls withDefaultAction(DefaultAction defaultAction) { */ public void validate() { if (virtualNetworkRule() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property virtualNetworkRule in model DataProductNetworkAcls")); + throw LOGGER.atError() + .log(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")); + throw LOGGER.atError() + .log(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")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property allowedQueryIpRangeList in model DataProductNetworkAcls")); } if (defaultAction() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property defaultAction in model DataProductNetworkAcls")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property defaultAction in model DataProductNetworkAcls")); } } private static final ClientLogger LOGGER = new ClientLogger(DataProductNetworkAcls.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("virtualNetworkRule", this.virtualNetworkRule, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ipRules", this.ipRules, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("allowedQueryIpRangeList", this.allowedQueryIpRangeList, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("defaultAction", this.defaultAction == null ? null : this.defaultAction.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataProductNetworkAcls from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataProductNetworkAcls if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataProductNetworkAcls. + */ + public static DataProductNetworkAcls fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataProductNetworkAcls deserializedDataProductNetworkAcls = new DataProductNetworkAcls(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("virtualNetworkRule".equals(fieldName)) { + List virtualNetworkRule + = reader.readArray(reader1 -> VirtualNetworkRule.fromJson(reader1)); + deserializedDataProductNetworkAcls.virtualNetworkRule = virtualNetworkRule; + } else if ("ipRules".equals(fieldName)) { + List ipRules = reader.readArray(reader1 -> IpRules.fromJson(reader1)); + deserializedDataProductNetworkAcls.ipRules = ipRules; + } else if ("allowedQueryIpRangeList".equals(fieldName)) { + List allowedQueryIpRangeList = reader.readArray(reader1 -> reader1.getString()); + deserializedDataProductNetworkAcls.allowedQueryIpRangeList = allowedQueryIpRangeList; + } else if ("defaultAction".equals(fieldName)) { + deserializedDataProductNetworkAcls.defaultAction = DefaultAction.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDataProductNetworkAcls; + }); + } } 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 index 1a5477f75d04..fd49e18e3267 100644 --- 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 @@ -6,132 +6,116 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * The data product properties. */ @Fluent -public final class DataProductProperties { +public final class DataProductProperties implements JsonSerializable { /* * 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; /** @@ -485,16 +469,18 @@ public String keyVaultUrl() { */ public void validate() { if (publisher() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property publisher in model DataProductProperties")); + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property publisher in model DataProductProperties")); } if (product() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property product in model DataProductProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property product in model DataProductProperties")); } if (majorVersion() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property majorVersion in model DataProductProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property majorVersion in model DataProductProperties")); } if (customerEncryptionKey() != null) { customerEncryptionKey().validate(); @@ -511,4 +497,103 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(DataProductProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("publisher", this.publisher); + jsonWriter.writeStringField("product", this.product); + jsonWriter.writeStringField("majorVersion", this.majorVersion); + jsonWriter.writeArrayField("owners", this.owners, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("redundancy", this.redundancy == null ? null : this.redundancy.toString()); + jsonWriter.writeStringField("purviewAccount", this.purviewAccount); + jsonWriter.writeStringField("purviewCollection", this.purviewCollection); + jsonWriter.writeStringField("privateLinksEnabled", + this.privateLinksEnabled == null ? null : this.privateLinksEnabled.toString()); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + jsonWriter.writeStringField("customerManagedKeyEncryptionEnabled", + this.customerManagedKeyEncryptionEnabled == null + ? null + : this.customerManagedKeyEncryptionEnabled.toString()); + jsonWriter.writeJsonField("customerEncryptionKey", this.customerEncryptionKey); + jsonWriter.writeJsonField("networkacls", this.networkacls); + jsonWriter.writeJsonField("managedResourceGroupConfiguration", this.managedResourceGroupConfiguration); + jsonWriter.writeStringField("currentMinorVersion", this.currentMinorVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataProductProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataProductProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataProductProperties. + */ + public static DataProductProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataProductProperties deserializedDataProductProperties = new DataProductProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publisher".equals(fieldName)) { + deserializedDataProductProperties.publisher = reader.getString(); + } else if ("product".equals(fieldName)) { + deserializedDataProductProperties.product = reader.getString(); + } else if ("majorVersion".equals(fieldName)) { + deserializedDataProductProperties.majorVersion = reader.getString(); + } else if ("resourceGuid".equals(fieldName)) { + deserializedDataProductProperties.resourceGuid = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedDataProductProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("owners".equals(fieldName)) { + List owners = reader.readArray(reader1 -> reader1.getString()); + deserializedDataProductProperties.owners = owners; + } else if ("redundancy".equals(fieldName)) { + deserializedDataProductProperties.redundancy = ControlState.fromString(reader.getString()); + } else if ("purviewAccount".equals(fieldName)) { + deserializedDataProductProperties.purviewAccount = reader.getString(); + } else if ("purviewCollection".equals(fieldName)) { + deserializedDataProductProperties.purviewCollection = reader.getString(); + } else if ("privateLinksEnabled".equals(fieldName)) { + deserializedDataProductProperties.privateLinksEnabled = ControlState.fromString(reader.getString()); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedDataProductProperties.publicNetworkAccess = ControlState.fromString(reader.getString()); + } else if ("customerManagedKeyEncryptionEnabled".equals(fieldName)) { + deserializedDataProductProperties.customerManagedKeyEncryptionEnabled + = ControlState.fromString(reader.getString()); + } else if ("customerEncryptionKey".equals(fieldName)) { + deserializedDataProductProperties.customerEncryptionKey = EncryptionKeyDetails.fromJson(reader); + } else if ("networkacls".equals(fieldName)) { + deserializedDataProductProperties.networkacls = DataProductNetworkAcls.fromJson(reader); + } else if ("managedResourceGroupConfiguration".equals(fieldName)) { + deserializedDataProductProperties.managedResourceGroupConfiguration + = ManagedResourceGroupConfiguration.fromJson(reader); + } else if ("availableMinorVersions".equals(fieldName)) { + List availableMinorVersions = reader.readArray(reader1 -> reader1.getString()); + deserializedDataProductProperties.availableMinorVersions = availableMinorVersions; + } else if ("currentMinorVersion".equals(fieldName)) { + deserializedDataProductProperties.currentMinorVersion = reader.getString(); + } else if ("documentation".equals(fieldName)) { + deserializedDataProductProperties.documentation = reader.getString(); + } else if ("consumptionEndpoints".equals(fieldName)) { + deserializedDataProductProperties.consumptionEndpoints + = ConsumptionEndpointsProperties.fromJson(reader); + } else if ("keyVaultUrl".equals(fieldName)) { + deserializedDataProductProperties.keyVaultUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataProductProperties; + }); + } } 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 index 4801e022b9d2..3f0fe8b1f373 100644 --- 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 @@ -5,32 +5,31 @@ 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 com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** * The type used for update operations of the DataProduct. */ @Fluent -public final class DataProductUpdate { +public final class DataProductUpdate implements JsonSerializable { /* * 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. + * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties") private DataProductUpdateProperties properties; /** @@ -80,7 +79,7 @@ public DataProductUpdate withTags(Map tags) { } /** - * Get the properties property: The updatable properties of the DataProduct. + * Get the properties property: The resource-specific properties for this resource. * * @return the properties value. */ @@ -89,7 +88,7 @@ public DataProductUpdateProperties properties() { } /** - * Set the properties property: The updatable properties of the DataProduct. + * Set the properties property: The resource-specific properties for this resource. * * @param properties the properties value to set. * @return the DataProductUpdate object itself. @@ -112,4 +111,47 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataProductUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataProductUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DataProductUpdate. + */ + public static DataProductUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataProductUpdate deserializedDataProductUpdate = new DataProductUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedDataProductUpdate.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDataProductUpdate.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedDataProductUpdate.properties = DataProductUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDataProductUpdate; + }); + } } 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 index eefb270443a8..bbd46c1d88be 100644 --- 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 @@ -5,42 +5,41 @@ package com.azure.resourcemanager.networkanalytics.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * The updatable properties of the DataProduct. */ @Fluent -public final class DataProductUpdateProperties { +public final class DataProductUpdateProperties implements JsonSerializable { /* * 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; /** @@ -156,4 +155,55 @@ public DataProductUpdateProperties withCurrentMinorVersion(String currentMinorVe */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("owners", this.owners, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("purviewAccount", this.purviewAccount); + jsonWriter.writeStringField("purviewCollection", this.purviewCollection); + jsonWriter.writeStringField("privateLinksEnabled", + this.privateLinksEnabled == null ? null : this.privateLinksEnabled.toString()); + jsonWriter.writeStringField("currentMinorVersion", this.currentMinorVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataProductUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataProductUpdateProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataProductUpdateProperties. + */ + public static DataProductUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataProductUpdateProperties deserializedDataProductUpdateProperties = new DataProductUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("owners".equals(fieldName)) { + List owners = reader.readArray(reader1 -> reader1.getString()); + deserializedDataProductUpdateProperties.owners = owners; + } else if ("purviewAccount".equals(fieldName)) { + deserializedDataProductUpdateProperties.purviewAccount = reader.getString(); + } else if ("purviewCollection".equals(fieldName)) { + deserializedDataProductUpdateProperties.purviewCollection = reader.getString(); + } else if ("privateLinksEnabled".equals(fieldName)) { + deserializedDataProductUpdateProperties.privateLinksEnabled + = ControlState.fromString(reader.getString()); + } else if ("currentMinorVersion".equals(fieldName)) { + deserializedDataProductUpdateProperties.currentMinorVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataProductUpdateProperties; + }); + } } 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 index 0d9ef0f4adfa..6d6e946e7ee5 100644 --- 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.networkanalytics.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public DataProductUserRole() { * @param name a name to look for. * @return the corresponding DataProductUserRole. */ - @JsonCreator public static DataProductUserRole fromString(String name) { return fromString(name, 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 index 9c4e40d09ecc..83be4ad5c4e8 100644 --- 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 @@ -6,17 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Data Product Version. */ @Fluent -public final class DataProductVersion { +public final class DataProductVersion implements JsonSerializable { /* * Version of data product */ - @JsonProperty(value = "version", required = true) private String version; /** @@ -52,10 +55,47 @@ public DataProductVersion withVersion(String version) { */ public void validate() { if (version() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property version in model DataProductVersion")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property version in model DataProductVersion")); } } private static final ClientLogger LOGGER = new ClientLogger(DataProductVersion.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataProductVersion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataProductVersion if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataProductVersion. + */ + public static DataProductVersion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataProductVersion deserializedDataProductVersion = new DataProductVersion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("version".equals(fieldName)) { + deserializedDataProductVersion.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataProductVersion; + }); + } } 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 index 377411893b44..a71ef7383490 100644 --- 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 @@ -6,25 +6,27 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.networkanalytics.fluent.models.DataProductsCatalogInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response of a DataProductsCatalog list operation. */ @Fluent -public final class DataProductsCatalogListResult { +public final class DataProductsCatalogListResult implements JsonSerializable { /* * 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; /** @@ -80,12 +82,56 @@ public DataProductsCatalogListResult withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model DataProductsCatalogListResult")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model DataProductsCatalogListResult")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(DataProductsCatalogListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataProductsCatalogListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataProductsCatalogListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataProductsCatalogListResult. + */ + public static DataProductsCatalogListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataProductsCatalogListResult deserializedDataProductsCatalogListResult + = new DataProductsCatalogListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DataProductsCatalogInner.fromJson(reader1)); + deserializedDataProductsCatalogListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDataProductsCatalogListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataProductsCatalogListResult; + }); + } } 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 index d7688884152b..c8dcb9fd2c88 100644 --- 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 @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Details for data catalog properties. */ @Fluent -public final class DataProductsCatalogProperties { +public final class DataProductsCatalogProperties implements JsonSerializable { /* * 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; /** @@ -68,12 +70,56 @@ public DataProductsCatalogProperties withPublishers(List p */ public void validate() { if (publishers() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property publishers in model DataProductsCatalogProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property publishers in model DataProductsCatalogProperties")); } else { publishers().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(DataProductsCatalogProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("publishers", this.publishers, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataProductsCatalogProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataProductsCatalogProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataProductsCatalogProperties. + */ + public static DataProductsCatalogProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataProductsCatalogProperties deserializedDataProductsCatalogProperties + = new DataProductsCatalogProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publishers".equals(fieldName)) { + List publishers + = reader.readArray(reader1 -> PublisherInformation.fromJson(reader1)); + deserializedDataProductsCatalogProperties.publishers = publishers; + } else if ("provisioningState".equals(fieldName)) { + deserializedDataProductsCatalogProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDataProductsCatalogProperties; + }); + } } 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 index d1ba72be4a4c..164a37a500d2 100644 --- 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 @@ -164,9 +164,9 @@ interface UpdateStages { */ interface WithProperties { /** - * Specifies the properties property: The updatable properties of the DataType.. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param properties The updatable properties of the DataType. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ Update withProperties(DataTypeUpdateProperties properties); 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 index 8731ec84e5a9..e77280cd4d53 100644 --- 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 @@ -6,25 +6,27 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.networkanalytics.fluent.models.DataTypeInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response of a DataType list operation. */ @Fluent -public final class DataTypeListResult { +public final class DataTypeListResult implements JsonSerializable { /* * 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; /** @@ -80,12 +82,53 @@ public DataTypeListResult withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model DataTypeListResult")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model DataTypeListResult")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(DataTypeListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataTypeListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataTypeListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataTypeListResult. + */ + public static DataTypeListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataTypeListResult deserializedDataTypeListResult = new DataTypeListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> DataTypeInner.fromJson(reader1)); + deserializedDataTypeListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDataTypeListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataTypeListResult; + }); + } } 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 index f0747eebdb76..37f3a457de59 100644 --- 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 @@ -5,53 +5,50 @@ package com.azure.resourcemanager.networkanalytics.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The data type properties. */ @Fluent -public final class DataTypeProperties { +public final class DataTypeProperties implements JsonSerializable { /* * 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; /** @@ -174,4 +171,55 @@ public String visualizationUrl() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeNumberField("storageOutputRetention", this.storageOutputRetention); + jsonWriter.writeNumberField("databaseCacheRetention", this.databaseCacheRetention); + jsonWriter.writeNumberField("databaseRetention", this.databaseRetention); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataTypeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataTypeProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DataTypeProperties. + */ + public static DataTypeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataTypeProperties deserializedDataTypeProperties = new DataTypeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedDataTypeProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("state".equals(fieldName)) { + deserializedDataTypeProperties.state = DataTypeState.fromString(reader.getString()); + } else if ("stateReason".equals(fieldName)) { + deserializedDataTypeProperties.stateReason = reader.getString(); + } else if ("storageOutputRetention".equals(fieldName)) { + deserializedDataTypeProperties.storageOutputRetention = reader.getNullable(JsonReader::getInt); + } else if ("databaseCacheRetention".equals(fieldName)) { + deserializedDataTypeProperties.databaseCacheRetention = reader.getNullable(JsonReader::getInt); + } else if ("databaseRetention".equals(fieldName)) { + deserializedDataTypeProperties.databaseRetention = reader.getNullable(JsonReader::getInt); + } else if ("visualizationUrl".equals(fieldName)) { + deserializedDataTypeProperties.visualizationUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataTypeProperties; + }); + } } 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 index 727e80b3a33e..28addf43501a 100644 --- 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.networkanalytics.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public DataTypeState() { * @param name a name to look for. * @return the corresponding DataTypeState. */ - @JsonCreator public static DataTypeState fromString(String name) { return fromString(name, 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 index 9960877d3a5f..fa1e1e7d6214 100644 --- 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 @@ -5,17 +5,20 @@ package com.azure.resourcemanager.networkanalytics.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The type used for update operations of the DataType. */ @Fluent -public final class DataTypeUpdate { +public final class DataTypeUpdate implements JsonSerializable { /* - * The updatable properties of the DataType. + * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties") private DataTypeUpdateProperties properties; /** @@ -25,7 +28,7 @@ public DataTypeUpdate() { } /** - * Get the properties property: The updatable properties of the DataType. + * Get the properties property: The resource-specific properties for this resource. * * @return the properties value. */ @@ -34,7 +37,7 @@ public DataTypeUpdateProperties properties() { } /** - * Set the properties property: The updatable properties of the DataType. + * Set the properties property: The resource-specific properties for this resource. * * @param properties the properties value to set. * @return the DataTypeUpdate object itself. @@ -54,4 +57,40 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataTypeUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataTypeUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DataTypeUpdate. + */ + public static DataTypeUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataTypeUpdate deserializedDataTypeUpdate = new DataTypeUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedDataTypeUpdate.properties = DataTypeUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDataTypeUpdate; + }); + } } 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 index 756bbe5ffb34..bf9a605c534b 100644 --- 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 @@ -5,35 +5,35 @@ package com.azure.resourcemanager.networkanalytics.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The updatable properties of the DataType. */ @Fluent -public final class DataTypeUpdateProperties { +public final class DataTypeUpdateProperties implements JsonSerializable { /* * 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; /** @@ -129,4 +129,51 @@ public DataTypeUpdateProperties withDatabaseRetention(Integer databaseRetention) */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeNumberField("storageOutputRetention", this.storageOutputRetention); + jsonWriter.writeNumberField("databaseCacheRetention", this.databaseCacheRetention); + jsonWriter.writeNumberField("databaseRetention", this.databaseRetention); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataTypeUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataTypeUpdateProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataTypeUpdateProperties. + */ + public static DataTypeUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataTypeUpdateProperties deserializedDataTypeUpdateProperties = new DataTypeUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedDataTypeUpdateProperties.state = DataTypeState.fromString(reader.getString()); + } else if ("storageOutputRetention".equals(fieldName)) { + deserializedDataTypeUpdateProperties.storageOutputRetention + = reader.getNullable(JsonReader::getInt); + } else if ("databaseCacheRetention".equals(fieldName)) { + deserializedDataTypeUpdateProperties.databaseCacheRetention + = reader.getNullable(JsonReader::getInt); + } else if ("databaseRetention".equals(fieldName)) { + deserializedDataTypeUpdateProperties.databaseRetention = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedDataTypeUpdateProperties; + }); + } } 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 index a06feaa2fff5..19b228f8da43 100644 --- 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.networkanalytics.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public DefaultAction() { * @param name a name to look for. * @return the corresponding DefaultAction. */ - @JsonCreator public static DefaultAction fromString(String name) { return fromString(name, 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 index 5de09cfc8bbd..c2cff612b1f7 100644 --- 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 @@ -6,29 +6,30 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Encryption key details. */ @Fluent -public final class EncryptionKeyDetails { +public final class EncryptionKeyDetails implements JsonSerializable { /* * 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; /** @@ -104,18 +105,63 @@ public EncryptionKeyDetails withKeyVersion(String keyVersion) { */ public void validate() { if (keyVaultUri() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property keyVaultUri in model EncryptionKeyDetails")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property keyVaultUri in model EncryptionKeyDetails")); } if (keyName() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property keyName in model EncryptionKeyDetails")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property keyName in model EncryptionKeyDetails")); } if (keyVersion() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property keyVersion in model EncryptionKeyDetails")); + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property keyVersion in model EncryptionKeyDetails")); } } private static final ClientLogger LOGGER = new ClientLogger(EncryptionKeyDetails.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyVaultUri", this.keyVaultUri); + jsonWriter.writeStringField("keyName", this.keyName); + jsonWriter.writeStringField("keyVersion", this.keyVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionKeyDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionKeyDetails if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EncryptionKeyDetails. + */ + public static EncryptionKeyDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionKeyDetails deserializedEncryptionKeyDetails = new EncryptionKeyDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyVaultUri".equals(fieldName)) { + deserializedEncryptionKeyDetails.keyVaultUri = reader.getString(); + } else if ("keyName".equals(fieldName)) { + deserializedEncryptionKeyDetails.keyName = reader.getString(); + } else if ("keyVersion".equals(fieldName)) { + deserializedEncryptionKeyDetails.keyVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionKeyDetails; + }); + } } 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 index 073b90db207d..a29ab08baa62 100644 --- 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 @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * IP rule with specific IP or IP range in CIDR format. */ @Fluent -public final class IpRules { +public final class IpRules implements JsonSerializable { /* * IP Rules Value */ - @JsonProperty(value = "value") private String value; /* * The action of virtual network rule. */ - @JsonProperty(value = "action", required = true) private String action; /** @@ -78,10 +80,50 @@ public IpRules withAction(String action) { */ public void validate() { if (action() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property action in model IpRules")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property action in model IpRules")); } } private static final ClientLogger LOGGER = new ClientLogger(IpRules.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("action", this.action); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpRules from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpRules if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IpRules. + */ + public static IpRules fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpRules deserializedIpRules = new IpRules(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("action".equals(fieldName)) { + deserializedIpRules.action = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedIpRules.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpRules; + }); + } } 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 index bf7bf84fc0c7..f22ab4b25530 100644 --- 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 @@ -6,17 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Details for KeyVault. */ @Fluent -public final class KeyVaultInfo { +public final class KeyVaultInfo implements JsonSerializable { /* * key vault url. */ - @JsonProperty(value = "keyVaultUrl", required = true) private String keyVaultUrl; /** @@ -52,10 +55,47 @@ public KeyVaultInfo withKeyVaultUrl(String keyVaultUrl) { */ public void validate() { if (keyVaultUrl() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property keyVaultUrl in model KeyVaultInfo")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property keyVaultUrl in model KeyVaultInfo")); } } private static final ClientLogger LOGGER = new ClientLogger(KeyVaultInfo.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyVaultUrl", this.keyVaultUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyVaultInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyVaultInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KeyVaultInfo. + */ + public static KeyVaultInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyVaultInfo deserializedKeyVaultInfo = new KeyVaultInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyVaultUrl".equals(fieldName)) { + deserializedKeyVaultInfo.keyVaultUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyVaultInfo; + }); + } } 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 index 0400bd87aa34..cf3fe6ed63ed 100644 --- 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 @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * ManagedResourceGroup related properties. */ @Fluent -public final class ManagedResourceGroupConfiguration { +public final class ManagedResourceGroupConfiguration implements JsonSerializable { /* * 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; /** @@ -78,14 +80,57 @@ public ManagedResourceGroupConfiguration withLocation(String location) { */ public void validate() { if (name() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property name in model ManagedResourceGroupConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model ManagedResourceGroupConfiguration")); } if (location() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property location in model ManagedResourceGroupConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property location in model ManagedResourceGroupConfiguration")); } } private static final ClientLogger LOGGER = new ClientLogger(ManagedResourceGroupConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("location", this.location); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedResourceGroupConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedResourceGroupConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedResourceGroupConfiguration. + */ + public static ManagedResourceGroupConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedResourceGroupConfiguration deserializedManagedResourceGroupConfiguration + = new ManagedResourceGroupConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedManagedResourceGroupConfiguration.name = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedManagedResourceGroupConfiguration.location = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedResourceGroupConfiguration; + }); + } } 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 index 02f264495942..b1c47559c7c3 100644 --- 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 @@ -6,8 +6,11 @@ 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 com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; import java.util.UUID; @@ -15,36 +18,30 @@ * Managed service identity (system assigned and/or user assigned identities). */ @Fluent -public final class ManagedServiceIdentity { +public final class ManagedServiceIdentity implements JsonSerializable { /* * The service principal ID of the system assigned identity. This property will only be provided for a system * assigned identity. */ - @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: + * 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. + * 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; /** @@ -64,8 +61,8 @@ public UUID principalId() { } /** - * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided - * for a system assigned identity. + * 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. */ @@ -128,8 +125,8 @@ public ManagedServiceIdentity withUserAssignedIdentities(Map { @@ -141,4 +138,53 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedServiceIdentity. + */ + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentity; + }); + } } diff --git a/sdk/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 index b62b554cb38f..01706fed0359 100644 --- 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.networkanalytics.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -48,7 +47,6 @@ public ManagedServiceIdentityType() { * @param name a name to look for. * @return the corresponding ManagedServiceIdentityType. */ - @JsonCreator public static ManagedServiceIdentityType fromString(String name) { return fromString(name, ManagedServiceIdentityType.class); } 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 index f3089db10978..39ae3b5d3fd0 100644 --- 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 @@ -5,38 +5,38 @@ package com.azure.resourcemanager.networkanalytics.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Localized display information for this particular operation. */ @Immutable -public final class OperationDisplay { +public final class OperationDisplay implements JsonSerializable { /* - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft - * Compute". + * 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". + * 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". + * 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; /** @@ -92,4 +92,45 @@ public String description() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } } diff --git a/sdk/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 index 1fced1eee5ca..da88cf3cb180 100644 --- 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 @@ -5,26 +5,28 @@ package com.azure.resourcemanager.networkanalytics.models; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.networkanalytics.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** - * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set - * of results. + * 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 { +public final class OperationListResult implements JsonSerializable { /* * 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; /** @@ -61,4 +63,42 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } } diff --git a/sdk/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 index 697e13e080d2..70b1497f93e6 100644 --- 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.networkanalytics.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -43,7 +42,6 @@ public Origin() { * @param name a name to look for. * @return the corresponding Origin. */ - @JsonCreator public static Origin fromString(String name) { return fromString(name, 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 index bb9d98874249..fdea17378133 100644 --- 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.networkanalytics.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -62,7 +61,6 @@ public ProvisioningState() { * @param name a name to look for. * @return the corresponding ProvisioningState. */ - @JsonCreator public static ProvisioningState fromString(String name) { return fromString(name, 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 index fa799f5275e8..a0e70542a87e 100644 --- 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 @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Details for Publisher Information. */ @Fluent -public final class PublisherInformation { +public final class PublisherInformation implements JsonSerializable { /* * Name of the publisher. */ - @JsonProperty(value = "publisherName", required = true) private String publisherName; /* * Data product information. */ - @JsonProperty(value = "dataProducts", required = true) private List dataProducts; /** @@ -79,16 +81,60 @@ public PublisherInformation withDataProducts(List dataPr */ public void validate() { if (publisherName() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property publisherName in model PublisherInformation")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property publisherName in model PublisherInformation")); } if (dataProducts() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property dataProducts in model PublisherInformation")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dataProducts in model PublisherInformation")); } else { dataProducts().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(PublisherInformation.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("publisherName", this.publisherName); + jsonWriter.writeArrayField("dataProducts", this.dataProducts, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublisherInformation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublisherInformation if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PublisherInformation. + */ + public static PublisherInformation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublisherInformation deserializedPublisherInformation = new PublisherInformation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publisherName".equals(fieldName)) { + deserializedPublisherInformation.publisherName = reader.getString(); + } else if ("dataProducts".equals(fieldName)) { + List dataProducts + = reader.readArray(reader1 -> DataProductInformation.fromJson(reader1)); + deserializedPublisherInformation.dataProducts = dataProducts; + } else { + reader.skipChildren(); + } + } + + return deserializedPublisherInformation; + }); + } } 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 index 1875d506327d..c7b17eb729d4 100644 --- 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 @@ -6,48 +6,46 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * The details for role assignment common properties. */ @Fluent -public final class RoleAssignmentCommonProperties { +public final class RoleAssignmentCommonProperties implements JsonSerializable { /* * 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; /** @@ -183,30 +181,92 @@ public RoleAssignmentCommonProperties withRole(DataProductUserRole role) { */ public void validate() { if (roleId() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property roleId in model RoleAssignmentCommonProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property roleId in model RoleAssignmentCommonProperties")); } if (principalId() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property principalId in model RoleAssignmentCommonProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property principalId in model RoleAssignmentCommonProperties")); } if (username() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property username in model RoleAssignmentCommonProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property username in model RoleAssignmentCommonProperties")); } if (dataTypeScope() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property dataTypeScope in model RoleAssignmentCommonProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dataTypeScope in model RoleAssignmentCommonProperties")); } if (principalType() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property principalType in model RoleAssignmentCommonProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property principalType in model RoleAssignmentCommonProperties")); } if (role() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property role in model RoleAssignmentCommonProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property role in model RoleAssignmentCommonProperties")); } } private static final ClientLogger LOGGER = new ClientLogger(RoleAssignmentCommonProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("roleId", this.roleId); + jsonWriter.writeStringField("principalId", this.principalId); + jsonWriter.writeStringField("userName", this.username); + jsonWriter.writeArrayField("dataTypeScope", this.dataTypeScope, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("principalType", this.principalType); + jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoleAssignmentCommonProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoleAssignmentCommonProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RoleAssignmentCommonProperties. + */ + public static RoleAssignmentCommonProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoleAssignmentCommonProperties deserializedRoleAssignmentCommonProperties + = new RoleAssignmentCommonProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("roleId".equals(fieldName)) { + deserializedRoleAssignmentCommonProperties.roleId = reader.getString(); + } else if ("principalId".equals(fieldName)) { + deserializedRoleAssignmentCommonProperties.principalId = reader.getString(); + } else if ("userName".equals(fieldName)) { + deserializedRoleAssignmentCommonProperties.username = reader.getString(); + } else if ("dataTypeScope".equals(fieldName)) { + List dataTypeScope = reader.readArray(reader1 -> reader1.getString()); + deserializedRoleAssignmentCommonProperties.dataTypeScope = dataTypeScope; + } else if ("principalType".equals(fieldName)) { + deserializedRoleAssignmentCommonProperties.principalType = reader.getString(); + } else if ("role".equals(fieldName)) { + deserializedRoleAssignmentCommonProperties.role + = DataProductUserRole.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRoleAssignmentCommonProperties; + }); + } } 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 index 76fab2986d86..4018f3a9d7d1 100644 --- 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 @@ -5,24 +5,26 @@ package com.azure.resourcemanager.networkanalytics.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.UUID; /** * User assigned identity properties. */ @Immutable -public final class UserAssignedIdentity { +public final class UserAssignedIdentity implements JsonSerializable { /* * 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; /** @@ -56,4 +58,43 @@ public UUID clientId() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } } diff --git a/sdk/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 index 0a5b21bcd5e1..f2f275c641dc 100644 --- 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 @@ -6,29 +6,30 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Virtual Network Rule. */ @Fluent -public final class VirtualNetworkRule { +public final class VirtualNetworkRule implements JsonSerializable { /* * 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; /** @@ -104,10 +105,53 @@ public VirtualNetworkRule withState(String state) { */ public void validate() { if (id() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property id in model VirtualNetworkRule")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model VirtualNetworkRule")); } } private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("action", this.action); + jsonWriter.writeStringField("state", this.state); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualNetworkRule. + */ + public static VirtualNetworkRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkRule deserializedVirtualNetworkRule = new VirtualNetworkRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVirtualNetworkRule.id = reader.getString(); + } else if ("action".equals(fieldName)) { + deserializedVirtualNetworkRule.action = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedVirtualNetworkRule.state = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkRule; + }); + } } 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 index 51acd5a793c5..2da1271338f0 100644 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/module-info.java +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/main/java/module-info.java @@ -4,12 +4,10 @@ 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; -} + opens com.azure.resourcemanager.networkanalytics.fluent.models to com.azure.core; + opens com.azure.resourcemanager.networkanalytics.models to com.azure.core; +} \ 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/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 index 274a22d318d2..b671804376e6 100644 --- 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 @@ -1 +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 +[["com.azure.resourcemanager.networkanalytics.implementation.DataProductsCatalogsClientImpl$DataProductsCatalogsService"],["com.azure.resourcemanager.networkanalytics.implementation.DataProductsClientImpl$DataProductsService"],["com.azure.resourcemanager.networkanalytics.implementation.DataTypesClientImpl$DataTypesService"],["com.azure.resourcemanager.networkanalytics.implementation.OperationsClientImpl$OperationsService"]] \ 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 index 373cf533b62e..0637a088a01e 100644 --- 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 @@ -1,216 +1 @@ -[ { - "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 +[] \ 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 index 5623c1ae09b3..9bf866b4f3c8 100644 --- 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 @@ -24,12 +24,15 @@ public final class DataProductsAddUserRoleSamples { */ 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); + 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); } /* @@ -44,11 +47,14 @@ public static void dataProductsAddUserRoleMaximumSetGenGeneratedByMinimumSetRule */ 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); + 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 index 501739a40693..e0ef556996d7 100644 --- 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 @@ -20,8 +20,8 @@ public final class DataProductsCatalogsGetByResourceGroupSamples { */ public static void dataProductsCatalogsGetMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { - manager.dataProductsCatalogs().getByResourceGroupWithResponse("aoiresourceGroupName", - com.azure.core.util.Context.NONE); + manager.dataProductsCatalogs() + .getByResourceGroupWithResponse("aoiresourceGroupName", com.azure.core.util.Context.NONE); } /* @@ -36,7 +36,7 @@ public static void dataProductsCatalogsGetMaximumSetGenGeneratedByMinimumSetRule */ public static void dataProductsCatalogsGetMaximumSetGen( com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { - manager.dataProductsCatalogs().getByResourceGroupWithResponse("aoiresourceGroupName", - com.azure.core.util.Context.NONE); + 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/DataProductsCreateSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCreateSamples.java index 1b93168922c0..c4b56d390f4f 100644 --- 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 @@ -35,23 +35,32 @@ public final class DataProductsCreateSamples { */ public static void dataProductsCreateMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { - manager.dataProducts().define("dataproduct01").withRegion("eastus") + 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) + .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")) + .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(""))) + .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)) + .withAllowedQueryIpRangeList(Arrays.asList("1.1.1.1")) + .withDefaultAction(DefaultAction.ALLOW)) .withManagedResourceGroupConfiguration( new ManagedResourceGroupConfiguration().withName("managedResourceGroupName").withLocation("eastus")) .withCurrentMinorVersion("1.0.1")) @@ -74,7 +83,9 @@ public final class DataProductsCreateSamples { */ public static void dataProductsCreateMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { - manager.dataProducts().define("dataproduct01").withRegion("eastus") + manager.dataProducts() + .define("dataproduct01") + .withRegion("eastus") .withExistingResourceGroup("aoiresourceGroupName") .withTags(mapOf("userSpecifiedKeyName", "fakeTokenPlaceholder")) .withProperties( 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 index 024769b4cbca..ced15e72d81b 100644 --- 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 @@ -24,10 +24,12 @@ public final class DataProductsGenerateStorageAccountSasTokenSamples { */ 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); + 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); } /* @@ -42,9 +44,11 @@ public static void dataProductsGenerateStorageAccountSasTokenMaximumSetGenGenera */ 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); + 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 index 36af561f2ac1..dde5c58019d3 100644 --- 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 @@ -20,8 +20,8 @@ public final class DataProductsGetByResourceGroupSamples { */ public static void dataProductsGetMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { - manager.dataProducts().getByResourceGroupWithResponse("aoiresourceGroupName", "dataproduct01", - com.azure.core.util.Context.NONE); + manager.dataProducts() + .getByResourceGroupWithResponse("aoiresourceGroupName", "dataproduct01", com.azure.core.util.Context.NONE); } /* @@ -36,7 +36,7 @@ public final class DataProductsGetByResourceGroupSamples { */ public static void dataProductsGetMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { - manager.dataProducts().getByResourceGroupWithResponse("aoiresourceGroupName", "dataproduct01", - com.azure.core.util.Context.NONE); + 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/DataProductsListRolesAssignmentsSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsListRolesAssignmentsSamples.java index 2a467222b1dd..cf2fd64ba0a9 100644 --- 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 @@ -25,8 +25,9 @@ public final class DataProductsListRolesAssignmentsSamples { public static void dataProductsListRolesAssignmentsMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) throws IOException { manager.dataProducts() - .listRolesAssignmentsWithResponse("aoiresourceGroupName", "dataproduct01", SerializerFactory - .createDefaultManagementSerializerAdapter().deserialize("{}", Object.class, SerializerEncoding.JSON), + .listRolesAssignmentsWithResponse("aoiresourceGroupName", "dataproduct01", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON), com.azure.core.util.Context.NONE); } @@ -43,8 +44,9 @@ public static void dataProductsListRolesAssignmentsMaximumSetGenGeneratedByMinim public static void dataProductsListRolesAssignmentsMaximumSetGen( com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) throws IOException { manager.dataProducts() - .listRolesAssignmentsWithResponse("aoiresourceGroupName", "dataproduct01", SerializerFactory - .createDefaultManagementSerializerAdapter().deserialize("{}", Object.class, SerializerEncoding.JSON), + .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/DataProductsRemoveUserRoleSamples.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/samples/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsRemoveUserRoleSamples.java index 31c0f8f79a06..8a3410cb2c98 100644 --- 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 @@ -24,12 +24,16 @@ public final class DataProductsRemoveUserRoleSamples { */ 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); + 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); } /* @@ -44,11 +48,15 @@ public static void dataProductsRemoveUserRoleMaximumSetGen( */ 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); + 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 index a42bd3c754dc..0d137685a75f 100644 --- 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 @@ -22,8 +22,9 @@ public final class DataProductsRotateKeySamples { */ 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); + manager.dataProducts() + .rotateKeyWithResponse("aoiresourceGroupName", "dataproduct01", + new KeyVaultInfo().withKeyVaultUrl("fakeTokenPlaceholder"), com.azure.core.util.Context.NONE); } /* @@ -38,7 +39,8 @@ public final class DataProductsRotateKeySamples { */ 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); + 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 index a2031d49dee9..40ff5261e83f 100644 --- 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 @@ -33,15 +33,18 @@ public final class DataProductsUpdateSamples { DataProduct resource = manager.dataProducts() .getByResourceGroupWithResponse("aoiresourceGroupName", "dataproduct01", com.azure.core.util.Context.NONE) .getValue(); - resource.update().withTags(mapOf("userSpecifiedKeyName", "fakeTokenPlaceholder")) + 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")) + .withPurviewAccount("testpurview") + .withPurviewCollection("134567890") + .withPrivateLinksEnabled(ControlState.DISABLED) + .withCurrentMinorVersion("1.0.1")) .apply(); } 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 index 126be7572836..787b33bab98d 100644 --- 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 @@ -23,9 +23,13 @@ public final class DataTypesCreateSamples { */ public static void dataTypesCreateMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { - manager.dataTypes().define("datatypename").withExistingDataProduct("aoiresourceGroupName", "dataproduct01") + manager.dataTypes() + .define("datatypename") + .withExistingDataProduct("aoiresourceGroupName", "dataproduct01") .withProperties(new DataTypeProperties().withState(DataTypeState.fromString("STARTED")) - .withStorageOutputRetention(27).withDatabaseCacheRetention(23).withDatabaseRetention(6)) + .withStorageOutputRetention(27) + .withDatabaseCacheRetention(23) + .withDatabaseRetention(6)) .create(); } @@ -41,7 +45,9 @@ public final class DataTypesCreateSamples { */ public static void dataTypesCreateMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { - manager.dataTypes().define("datatypename").withExistingDataProduct("aoiresourceGroupName", "dataproduct01") + 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 index 75d988400552..a93c19aa8f6c 100644 --- 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 @@ -25,8 +25,9 @@ public final class DataTypesDeleteDataSamples { 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), + .deleteData("aoiresourceGroupName", "dataproduct01", "datatypename", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON), com.azure.core.util.Context.NONE); } @@ -43,8 +44,9 @@ public static void dataTypesDeleteDataMinimumSetGen( 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), + .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 index ea07350af132..d51995fe7cec 100644 --- 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 @@ -20,8 +20,8 @@ public final class DataTypesDeleteSamples { */ public static void dataTypesDeleteMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { - manager.dataTypes().delete("aoiresourceGroupName", "dataproduct01", "datatypename", - com.azure.core.util.Context.NONE); + manager.dataTypes() + .delete("aoiresourceGroupName", "dataproduct01", "datatypename", com.azure.core.util.Context.NONE); } /* @@ -36,7 +36,7 @@ public static void dataTypesDeleteMaximumSetGenGeneratedByMinimumSetRuleMinimumS */ public static void dataTypesDeleteMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { - manager.dataTypes().delete("aoiresourceGroupName", "dataproduct01", "datatypename", - com.azure.core.util.Context.NONE); + 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 index b892aea87ab5..eb84ceea2a7d 100644 --- 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 @@ -23,11 +23,12 @@ public final class DataTypesGenerateStorageContainerSasTokenSamples { */ 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); + 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); } /* @@ -43,10 +44,11 @@ public static void dataTypesGenerateStorageContainerSasTokenMaximumSetGen( */ 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); + 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 index c0297be64593..97fc2870af8b 100644 --- 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 @@ -20,8 +20,8 @@ public final class DataTypesGetSamples { */ public static void dataTypesGetMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { - manager.dataTypes().getWithResponse("aoiresourceGroupName", "dataproduct01", "datatypename", - com.azure.core.util.Context.NONE); + manager.dataTypes() + .getWithResponse("aoiresourceGroupName", "dataproduct01", "datatypename", com.azure.core.util.Context.NONE); } /* @@ -36,7 +36,7 @@ public static void dataTypesGetMaximumSetGenGeneratedByMinimumSetRuleMinimumSetG */ public static void dataTypesGetMaximumSetGen(com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { - manager.dataTypes().getWithResponse("aoiresourceGroupName", "dataproduct01", "datatypename", - com.azure.core.util.Context.NONE); + 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 index 9aee933006c7..f7271b4abf92 100644 --- 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 @@ -20,8 +20,8 @@ public final class DataTypesListByDataProductSamples { */ public static void dataTypesListByDataProductMaximumSetGen( com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { - manager.dataTypes().listByDataProduct("aoiresourceGroupName", "dataproduct01", - com.azure.core.util.Context.NONE); + manager.dataTypes() + .listByDataProduct("aoiresourceGroupName", "dataproduct01", com.azure.core.util.Context.NONE); } /* @@ -36,7 +36,7 @@ public static void dataTypesListByDataProductMaximumSetGen( */ public static void dataTypesListByDataProductMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen( com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager manager) { - manager.dataTypes().listByDataProduct("aoiresourceGroupName", "dataproduct01", - com.azure.core.util.Context.NONE); + 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 index 7aede019f90c..2c349052b5e7 100644 --- 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 @@ -45,7 +45,11 @@ public static void dataTypesUpdateMaximumSetGenGeneratedByMinimumSetRuleMinimumS 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(); + 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/test/java/com/azure/resourcemanager/networkanalytics/generated/AccountSasTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/AccountSasTests.java deleted file mode 100644 index b42fd74896be..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/AccountSasTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.models.AccountSas; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class AccountSasTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccountSas model = BinaryData.fromString( - "{\"startTimeStamp\":\"2021-04-17T17:42:02Z\",\"expiryTimeStamp\":\"2021-04-15T11:53:36Z\",\"ipAddress\":\"pclhocohslk\"}") - .toObject(AccountSas.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-17T17:42:02Z"), model.startTimestamp()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-15T11:53:36Z"), model.expiryTimestamp()); - Assertions.assertEquals("pclhocohslk", model.ipAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccountSas model = new AccountSas().withStartTimestamp(OffsetDateTime.parse("2021-04-17T17:42:02Z")) - .withExpiryTimestamp(OffsetDateTime.parse("2021-04-15T11:53:36Z")).withIpAddress("pclhocohslk"); - model = BinaryData.fromObject(model).toObject(AccountSas.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-17T17:42:02Z"), model.startTimestamp()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-15T11:53:36Z"), model.expiryTimestamp()); - Assertions.assertEquals("pclhocohslk", model.ipAddress()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/ConsumptionEndpointsPropertiesTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/ConsumptionEndpointsPropertiesTests.java deleted file mode 100644 index 205163d36989..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/ConsumptionEndpointsPropertiesTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.models.ConsumptionEndpointsProperties; - -public final class ConsumptionEndpointsPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConsumptionEndpointsProperties model = BinaryData.fromString( - "{\"ingestionUrl\":\"vmgxsab\",\"ingestionResourceId\":\"qduujitcjczdz\",\"fileAccessUrl\":\"ndhkrw\",\"fileAccessResourceId\":\"appd\",\"queryUrl\":\"dkvwrwjfe\",\"queryResourceId\":\"nhutjeltmrldhugj\"}") - .toObject(ConsumptionEndpointsProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConsumptionEndpointsProperties model = new ConsumptionEndpointsProperties(); - model = BinaryData.fromObject(model).toObject(ConsumptionEndpointsProperties.class); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/ContainerSaSTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/ContainerSaSTests.java deleted file mode 100644 index 099c41114a75..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/ContainerSaSTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.models.ContainerSaS; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ContainerSaSTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ContainerSaS model = BinaryData.fromString( - "{\"startTimeStamp\":\"2021-09-15T05:38:02Z\",\"expiryTimeStamp\":\"2021-05-02T14:53:40Z\",\"ipAddress\":\"v\"}") - .toObject(ContainerSaS.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-15T05:38:02Z"), model.startTimestamp()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-02T14:53:40Z"), model.expiryTimestamp()); - Assertions.assertEquals("v", model.ipAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ContainerSaS model = new ContainerSaS().withStartTimestamp(OffsetDateTime.parse("2021-09-15T05:38:02Z")) - .withExpiryTimestamp(OffsetDateTime.parse("2021-05-02T14:53:40Z")).withIpAddress("v"); - model = BinaryData.fromObject(model).toObject(ContainerSaS.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-15T05:38:02Z"), model.startTimestamp()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-02T14:53:40Z"), model.expiryTimestamp()); - Assertions.assertEquals("v", model.ipAddress()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductInformationTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductInformationTests.java deleted file mode 100644 index caa1c2949a87..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductInformationTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.models.DataProductInformation; -import com.azure.resourcemanager.networkanalytics.models.DataProductVersion; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DataProductInformationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataProductInformation model = BinaryData.fromString( - "{\"dataProductName\":\"xibqeojnx\",\"description\":\"bzv\",\"dataProductVersions\":[{\"version\":\"ntwndeicbtwnpzao\"},{\"version\":\"vuhrhcffcyddgl\"},{\"version\":\"jthjqkwpyei\"}]}") - .toObject(DataProductInformation.class); - Assertions.assertEquals("xibqeojnx", model.dataProductName()); - Assertions.assertEquals("bzv", model.description()); - Assertions.assertEquals("ntwndeicbtwnpzao", model.dataProductVersions().get(0).version()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataProductInformation model - = new DataProductInformation().withDataProductName("xibqeojnx").withDescription("bzv") - .withDataProductVersions(Arrays.asList(new DataProductVersion().withVersion("ntwndeicbtwnpzao"), - new DataProductVersion().withVersion("vuhrhcffcyddgl"), - new DataProductVersion().withVersion("jthjqkwpyei"))); - model = BinaryData.fromObject(model).toObject(DataProductInformation.class); - Assertions.assertEquals("xibqeojnx", model.dataProductName()); - Assertions.assertEquals("bzv", model.description()); - Assertions.assertEquals("ntwndeicbtwnpzao", model.dataProductVersions().get(0).version()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductNetworkAclsTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductNetworkAclsTests.java deleted file mode 100644 index ff73cce9c652..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductNetworkAclsTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.models.DataProductNetworkAcls; -import com.azure.resourcemanager.networkanalytics.models.DefaultAction; -import com.azure.resourcemanager.networkanalytics.models.IpRules; -import com.azure.resourcemanager.networkanalytics.models.VirtualNetworkRule; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DataProductNetworkAclsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataProductNetworkAcls model = BinaryData.fromString( - "{\"virtualNetworkRule\":[{\"id\":\"nmayhuybb\",\"action\":\"odepoogin\",\"state\":\"amiheognarxz\"}],\"ipRules\":[{\"value\":\"eotusivyevc\",\"action\":\"iqihn\"},{\"value\":\"ngbwjz\",\"action\":\"nfygxgispemvtz\"},{\"value\":\"ufubl\",\"action\":\"ofx\"}],\"allowedQueryIpRangeList\":[\"ofjaeqjhqjb\",\"s\",\"msmjqulngsntn\"],\"defaultAction\":\"Allow\"}") - .toObject(DataProductNetworkAcls.class); - Assertions.assertEquals("nmayhuybb", model.virtualNetworkRule().get(0).id()); - Assertions.assertEquals("odepoogin", model.virtualNetworkRule().get(0).action()); - Assertions.assertEquals("amiheognarxz", model.virtualNetworkRule().get(0).state()); - Assertions.assertEquals("eotusivyevc", model.ipRules().get(0).value()); - Assertions.assertEquals("iqihn", model.ipRules().get(0).action()); - Assertions.assertEquals("ofjaeqjhqjb", model.allowedQueryIpRangeList().get(0)); - Assertions.assertEquals(DefaultAction.ALLOW, model.defaultAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataProductNetworkAcls model = new DataProductNetworkAcls() - .withVirtualNetworkRule(Arrays - .asList(new VirtualNetworkRule().withId("nmayhuybb").withAction("odepoogin").withState("amiheognarxz"))) - .withIpRules(Arrays.asList(new IpRules().withValue("eotusivyevc").withAction("iqihn"), - new IpRules().withValue("ngbwjz").withAction("nfygxgispemvtz"), - new IpRules().withValue("ufubl").withAction("ofx"))) - .withAllowedQueryIpRangeList(Arrays.asList("ofjaeqjhqjb", "s", "msmjqulngsntn")) - .withDefaultAction(DefaultAction.ALLOW); - model = BinaryData.fromObject(model).toObject(DataProductNetworkAcls.class); - Assertions.assertEquals("nmayhuybb", model.virtualNetworkRule().get(0).id()); - Assertions.assertEquals("odepoogin", model.virtualNetworkRule().get(0).action()); - Assertions.assertEquals("amiheognarxz", model.virtualNetworkRule().get(0).state()); - Assertions.assertEquals("eotusivyevc", model.ipRules().get(0).value()); - Assertions.assertEquals("iqihn", model.ipRules().get(0).action()); - Assertions.assertEquals("ofjaeqjhqjb", model.allowedQueryIpRangeList().get(0)); - Assertions.assertEquals(DefaultAction.ALLOW, model.defaultAction()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductUpdatePropertiesTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductUpdatePropertiesTests.java deleted file mode 100644 index e42c700314d2..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductUpdatePropertiesTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.models.ControlState; -import com.azure.resourcemanager.networkanalytics.models.DataProductUpdateProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DataProductUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataProductUpdateProperties model = BinaryData.fromString( - "{\"owners\":[\"ampmngnz\",\"c\",\"aqw\",\"ochcbonqvpkvl\"],\"purviewAccount\":\"njeaseipheofloke\",\"purviewCollection\":\"ienjbdlwtgr\",\"privateLinksEnabled\":\"Disabled\",\"currentMinorVersion\":\"pj\"}") - .toObject(DataProductUpdateProperties.class); - Assertions.assertEquals("ampmngnz", model.owners().get(0)); - Assertions.assertEquals("njeaseipheofloke", model.purviewAccount()); - Assertions.assertEquals("ienjbdlwtgr", model.purviewCollection()); - Assertions.assertEquals(ControlState.DISABLED, model.privateLinksEnabled()); - Assertions.assertEquals("pj", model.currentMinorVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataProductUpdateProperties model - = new DataProductUpdateProperties().withOwners(Arrays.asList("ampmngnz", "c", "aqw", "ochcbonqvpkvl")) - .withPurviewAccount("njeaseipheofloke").withPurviewCollection("ienjbdlwtgr") - .withPrivateLinksEnabled(ControlState.DISABLED).withCurrentMinorVersion("pj"); - model = BinaryData.fromObject(model).toObject(DataProductUpdateProperties.class); - Assertions.assertEquals("ampmngnz", model.owners().get(0)); - Assertions.assertEquals("njeaseipheofloke", model.purviewAccount()); - Assertions.assertEquals("ienjbdlwtgr", model.purviewCollection()); - Assertions.assertEquals(ControlState.DISABLED, model.privateLinksEnabled()); - Assertions.assertEquals("pj", model.currentMinorVersion()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductUpdateTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductUpdateTests.java deleted file mode 100644 index b8ffa0e4f035..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductUpdateTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.models.ControlState; -import com.azure.resourcemanager.networkanalytics.models.DataProductUpdate; -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 org.junit.jupiter.api.Assertions; - -public final class DataProductUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataProductUpdate model = BinaryData.fromString( - "{\"identity\":{\"principalId\":\"d6a13dec-c6ab-46e1-b357-d42dd1938cb1\",\"tenantId\":\"32877e4f-75d9-43ac-a11d-9ac301c050ef\",\"type\":\"SystemAssigned, UserAssigned\",\"userAssignedIdentities\":{\"igdtopbob\":{\"principalId\":\"c414294d-22dc-44cd-8588-e5d485b501e2\",\"clientId\":\"52775d55-778f-431c-a20a-300e486b6208\"},\"hm\":{\"principalId\":\"f2b3ce00-f395-41f7-9fe3-9701cd88b4f9\",\"clientId\":\"c5575f34-f028-48d5-87f5-78a0e9762fd4\"},\"a\":{\"principalId\":\"39c12ec5-f1d5-4d79-815a-c4832a2ff9b8\",\"clientId\":\"9795d956-b504-4b92-a9ec-f9491f67a028\"},\"hrzayvvtpgvdf\":{\"principalId\":\"2dac13c4-5efe-442a-bbf2-371d36288ff5\",\"clientId\":\"15324244-ade2-4b66-aa4e-a344f200e1c5\"}}},\"tags\":{\"efgugnxk\":\"tkftutqxlngx\",\"hjybigehoqfbo\":\"xdqmidtthzrvqdra\",\"zlcuiywgqywgndrv\":\"skanyk\",\"ocpecfvmmco\":\"nhzgpphrcgyn\"},\"properties\":{\"owners\":[\"lzevgbmqjqab\",\"y\",\"mivkwlzuvcc\",\"wnfnbacf\"],\"purviewAccount\":\"nlebxetqgtzxd\",\"purviewCollection\":\"qbqqwxr\",\"privateLinksEnabled\":\"Disabled\",\"currentMinorVersion\":\"llnwsubi\"}}") - .toObject(DataProductUpdate.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("tkftutqxlngx", model.tags().get("efgugnxk")); - Assertions.assertEquals("lzevgbmqjqab", model.properties().owners().get(0)); - Assertions.assertEquals("nlebxetqgtzxd", model.properties().purviewAccount()); - Assertions.assertEquals("qbqqwxr", model.properties().purviewCollection()); - Assertions.assertEquals(ControlState.DISABLED, model.properties().privateLinksEnabled()); - Assertions.assertEquals("llnwsubi", model.properties().currentMinorVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataProductUpdate model = new DataProductUpdate().withIdentity(new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("igdtopbob", new UserAssignedIdentity(), "hm", new UserAssignedIdentity(), - "a", new UserAssignedIdentity(), "hrzayvvtpgvdf", new UserAssignedIdentity()))) - .withTags(mapOf("efgugnxk", "tkftutqxlngx", "hjybigehoqfbo", "xdqmidtthzrvqdra", "zlcuiywgqywgndrv", - "skanyk", "ocpecfvmmco", "nhzgpphrcgyn")) - .withProperties(new DataProductUpdateProperties() - .withOwners(Arrays.asList("lzevgbmqjqab", "y", "mivkwlzuvcc", "wnfnbacf")) - .withPurviewAccount("nlebxetqgtzxd").withPurviewCollection("qbqqwxr") - .withPrivateLinksEnabled(ControlState.DISABLED).withCurrentMinorVersion("llnwsubi")); - model = BinaryData.fromObject(model).toObject(DataProductUpdate.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("tkftutqxlngx", model.tags().get("efgugnxk")); - Assertions.assertEquals("lzevgbmqjqab", model.properties().owners().get(0)); - Assertions.assertEquals("nlebxetqgtzxd", model.properties().purviewAccount()); - Assertions.assertEquals("qbqqwxr", model.properties().purviewCollection()); - Assertions.assertEquals(ControlState.DISABLED, model.properties().privateLinksEnabled()); - Assertions.assertEquals("llnwsubi", model.properties().currentMinorVersion()); - } - - // 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/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductVersionTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductVersionTests.java deleted file mode 100644 index cd244665bdce..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductVersionTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.models.DataProductVersion; -import org.junit.jupiter.api.Assertions; - -public final class DataProductVersionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataProductVersion model = BinaryData.fromString("{\"version\":\"xmqci\"}").toObject(DataProductVersion.class); - Assertions.assertEquals("xmqci", model.version()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataProductVersion model = new DataProductVersion().withVersion("xmqci"); - model = BinaryData.fromObject(model).toObject(DataProductVersion.class); - Assertions.assertEquals("xmqci", model.version()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsAddUserRoleWithResponseMockTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsAddUserRoleWithResponseMockTests.java deleted file mode 100644 index aaa5dbf7a114..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsAddUserRoleWithResponseMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager; -import com.azure.resourcemanager.networkanalytics.models.DataProductUserRole; -import com.azure.resourcemanager.networkanalytics.models.RoleAssignmentCommonProperties; -import com.azure.resourcemanager.networkanalytics.models.RoleAssignmentDetail; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataProductsAddUserRoleWithResponseMockTests { - @Test - public void testAddUserRoleWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"roleId\":\"rhdwbavxbniw\",\"principalId\":\"jswztsdbpg\",\"userName\":\"xytxhpzxbz\",\"dataTypeScope\":[\"zabglcuhxwt\"],\"principalType\":\"tyq\",\"role\":\"Reader\",\"roleAssignmentId\":\"lbbovplw\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NetworkAnalyticsManager manager = NetworkAnalyticsManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RoleAssignmentDetail response = manager.dataProducts() - .addUserRoleWithResponse("babphlwrqlfk", "sthsu", - new RoleAssignmentCommonProperties().withRoleId("ocmnyyazttbtwwrq").withPrincipalId("uedck") - .withUsername("ywbiexzfeyueax").withDataTypeScope(Arrays.asList("xujwbhqwalmuzyo")) - .withPrincipalType("aepdkzjanc").withRole(DataProductUserRole.SENSITIVE_READER), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("rhdwbavxbniw", response.roleId()); - Assertions.assertEquals("jswztsdbpg", response.principalId()); - Assertions.assertEquals("xytxhpzxbz", response.username()); - Assertions.assertEquals("zabglcuhxwt", response.dataTypeScope().get(0)); - Assertions.assertEquals("tyq", response.principalType()); - Assertions.assertEquals(DataProductUserRole.READER, response.role()); - Assertions.assertEquals("lbbovplw", response.roleAssignmentId()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogInnerTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogInnerTests.java deleted file mode 100644 index 1384aa42e6b3..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogInnerTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.fluent.models.DataProductsCatalogInner; -import com.azure.resourcemanager.networkanalytics.models.DataProductInformation; -import com.azure.resourcemanager.networkanalytics.models.DataProductVersion; -import com.azure.resourcemanager.networkanalytics.models.DataProductsCatalogProperties; -import com.azure.resourcemanager.networkanalytics.models.PublisherInformation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DataProductsCatalogInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataProductsCatalogInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Provisioning\",\"publishers\":[{\"publisherName\":\"uizga\",\"dataProducts\":[{\"dataProductName\":\"ufizuckyf\",\"description\":\"hr\",\"dataProductVersions\":[{\"version\":\"dfvzwdzuhty\"}]}]}]},\"id\":\"isdkfthwxmnteiw\",\"name\":\"opvkmijcm\",\"type\":\"xdcu\"}") - .toObject(DataProductsCatalogInner.class); - Assertions.assertEquals("uizga", model.properties().publishers().get(0).publisherName()); - Assertions.assertEquals("ufizuckyf", - model.properties().publishers().get(0).dataProducts().get(0).dataProductName()); - Assertions.assertEquals("hr", model.properties().publishers().get(0).dataProducts().get(0).description()); - Assertions.assertEquals("dfvzwdzuhty", - model.properties().publishers().get(0).dataProducts().get(0).dataProductVersions().get(0).version()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataProductsCatalogInner model = new DataProductsCatalogInner() - .withProperties(new DataProductsCatalogProperties().withPublishers(Arrays.asList(new PublisherInformation() - .withPublisherName("uizga") - .withDataProducts(Arrays.asList(new DataProductInformation().withDataProductName("ufizuckyf") - .withDescription("hr") - .withDataProductVersions(Arrays.asList(new DataProductVersion().withVersion("dfvzwdzuhty")))))))); - model = BinaryData.fromObject(model).toObject(DataProductsCatalogInner.class); - Assertions.assertEquals("uizga", model.properties().publishers().get(0).publisherName()); - Assertions.assertEquals("ufizuckyf", - model.properties().publishers().get(0).dataProducts().get(0).dataProductName()); - Assertions.assertEquals("hr", model.properties().publishers().get(0).dataProducts().get(0).description()); - Assertions.assertEquals("dfvzwdzuhty", - model.properties().publishers().get(0).dataProducts().get(0).dataProductVersions().get(0).version()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogListResultTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogListResultTests.java deleted file mode 100644 index 1c51e0a49da8..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogListResultTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.fluent.models.DataProductsCatalogInner; -import com.azure.resourcemanager.networkanalytics.models.DataProductInformation; -import com.azure.resourcemanager.networkanalytics.models.DataProductsCatalogListResult; -import com.azure.resourcemanager.networkanalytics.models.DataProductsCatalogProperties; -import com.azure.resourcemanager.networkanalytics.models.PublisherInformation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DataProductsCatalogListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataProductsCatalogListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Accepted\",\"publishers\":[{\"publisherName\":\"w\",\"dataProducts\":[{\"dataProductName\":\"lryplwckbasyy\",\"description\":\"nddhsgcbacph\",\"dataProductVersions\":[]},{\"dataProductName\":\"jkot\",\"description\":\"nqgoulzndli\",\"dataProductVersions\":[]},{\"dataProductName\":\"wyqkgfgibm\",\"description\":\"dgak\",\"dataProductVersions\":[]}]},{\"publisherName\":\"qsrxybzqqed\",\"dataProducts\":[{\"dataProductName\":\"tbciqfouflmm\",\"description\":\"kzsmodm\",\"dataProductVersions\":[]}]}]},\"id\":\"ougpbkwt\",\"name\":\"utduqktapspwgcu\",\"type\":\"rtumkdosvq\"},{\"properties\":{\"provisioningState\":\"Updating\",\"publishers\":[{\"publisherName\":\"gbbjfddgmbmbe\",\"dataProducts\":[{\"dataProductName\":\"pbhtqqrolfpfpsa\",\"description\":\"gbquxigj\",\"dataProductVersions\":[]},{\"dataProductName\":\"jgzjaoyfhrtx\",\"description\":\"lnerkujysvleju\",\"dataProductVersions\":[]},{\"dataProductName\":\"fqawrlyxw\",\"description\":\"kcprbnw\",\"dataProductVersions\":[]}]}]},\"id\":\"gjvtbv\",\"name\":\"ysszdnrujqguh\",\"type\":\"uouq\"}],\"nextLink\":\"rwzwbng\"}") - .toObject(DataProductsCatalogListResult.class); - Assertions.assertEquals("w", model.value().get(0).properties().publishers().get(0).publisherName()); - Assertions.assertEquals("lryplwckbasyy", - model.value().get(0).properties().publishers().get(0).dataProducts().get(0).dataProductName()); - Assertions.assertEquals("nddhsgcbacph", - model.value().get(0).properties().publishers().get(0).dataProducts().get(0).description()); - Assertions.assertEquals("rwzwbng", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataProductsCatalogListResult model = new DataProductsCatalogListResult().withValue(Arrays.asList( - new DataProductsCatalogInner() - .withProperties(new DataProductsCatalogProperties().withPublishers(Arrays.asList( - new PublisherInformation().withPublisherName("w") - .withDataProducts(Arrays.asList( - new DataProductInformation().withDataProductName("lryplwckbasyy") - .withDescription("nddhsgcbacph").withDataProductVersions(Arrays.asList()), - new DataProductInformation().withDataProductName("jkot").withDescription("nqgoulzndli") - .withDataProductVersions(Arrays.asList()), - new DataProductInformation().withDataProductName("wyqkgfgibm").withDescription("dgak") - .withDataProductVersions(Arrays.asList()))), - new PublisherInformation().withPublisherName("qsrxybzqqed") - .withDataProducts(Arrays.asList(new DataProductInformation().withDataProductName("tbciqfouflmm") - .withDescription("kzsmodm").withDataProductVersions(Arrays.asList())))))), - new DataProductsCatalogInner().withProperties(new DataProductsCatalogProperties() - .withPublishers(Arrays.asList(new PublisherInformation().withPublisherName("gbbjfddgmbmbe") - .withDataProducts(Arrays.asList( - new DataProductInformation().withDataProductName("pbhtqqrolfpfpsa").withDescription("gbquxigj") - .withDataProductVersions(Arrays.asList()), - new DataProductInformation().withDataProductName("jgzjaoyfhrtx") - .withDescription("lnerkujysvleju").withDataProductVersions(Arrays.asList()), - new DataProductInformation().withDataProductName("fqawrlyxw").withDescription("kcprbnw") - .withDataProductVersions(Arrays.asList())))))))) - .withNextLink("rwzwbng"); - model = BinaryData.fromObject(model).toObject(DataProductsCatalogListResult.class); - Assertions.assertEquals("w", model.value().get(0).properties().publishers().get(0).publisherName()); - Assertions.assertEquals("lryplwckbasyy", - model.value().get(0).properties().publishers().get(0).dataProducts().get(0).dataProductName()); - Assertions.assertEquals("nddhsgcbacph", - model.value().get(0).properties().publishers().get(0).dataProducts().get(0).description()); - Assertions.assertEquals("rwzwbng", model.nextLink()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogPropertiesTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogPropertiesTests.java deleted file mode 100644 index 47bd230cdd34..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogPropertiesTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.models.DataProductInformation; -import com.azure.resourcemanager.networkanalytics.models.DataProductVersion; -import com.azure.resourcemanager.networkanalytics.models.DataProductsCatalogProperties; -import com.azure.resourcemanager.networkanalytics.models.PublisherInformation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DataProductsCatalogPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataProductsCatalogProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Failed\",\"publishers\":[{\"publisherName\":\"rpymzidnsez\",\"dataProducts\":[{\"dataProductName\":\"tbzsgfyccs\",\"description\":\"ewmdw\",\"dataProductVersions\":[{\"version\":\"eiachboosflnr\"},{\"version\":\"sfqpteehz\"},{\"version\":\"vypyqrimzinpv\"}]},{\"dataProductName\":\"wjdk\",\"description\":\"rsoodqxhcrmnoh\",\"dataProductVersions\":[{\"version\":\"ckwhds\"}]},{\"dataProductName\":\"ifiyipjxsqwpgrj\",\"description\":\"znorcj\",\"dataProductVersions\":[{\"version\":\"snb\"}]},{\"dataProductName\":\"xqabnmocpcysh\",\"description\":\"rzafbljjgpbtoqcj\",\"dataProductVersions\":[{\"version\":\"ljavbqid\"}]}]}]}") - .toObject(DataProductsCatalogProperties.class); - Assertions.assertEquals("rpymzidnsez", model.publishers().get(0).publisherName()); - Assertions.assertEquals("tbzsgfyccs", model.publishers().get(0).dataProducts().get(0).dataProductName()); - Assertions.assertEquals("ewmdw", model.publishers().get(0).dataProducts().get(0).description()); - Assertions.assertEquals("eiachboosflnr", - model.publishers().get(0).dataProducts().get(0).dataProductVersions().get(0).version()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataProductsCatalogProperties model = new DataProductsCatalogProperties().withPublishers( - Arrays.asList(new PublisherInformation().withPublisherName("rpymzidnsez").withDataProducts(Arrays.asList( - new DataProductInformation().withDataProductName("tbzsgfyccs").withDescription("ewmdw") - .withDataProductVersions(Arrays.asList(new DataProductVersion().withVersion("eiachboosflnr"), - new DataProductVersion().withVersion("sfqpteehz"), - new DataProductVersion().withVersion("vypyqrimzinpv"))), - new DataProductInformation().withDataProductName("wjdk").withDescription("rsoodqxhcrmnoh") - .withDataProductVersions(Arrays.asList(new DataProductVersion().withVersion("ckwhds"))), - new DataProductInformation().withDataProductName("ifiyipjxsqwpgrj").withDescription("znorcj") - .withDataProductVersions(Arrays.asList(new DataProductVersion().withVersion("snb"))), - new DataProductInformation().withDataProductName("xqabnmocpcysh").withDescription("rzafbljjgpbtoqcj") - .withDataProductVersions(Arrays.asList(new DataProductVersion().withVersion("ljavbqid"))))))); - model = BinaryData.fromObject(model).toObject(DataProductsCatalogProperties.class); - Assertions.assertEquals("rpymzidnsez", model.publishers().get(0).publisherName()); - Assertions.assertEquals("tbzsgfyccs", model.publishers().get(0).dataProducts().get(0).dataProductName()); - Assertions.assertEquals("ewmdw", model.publishers().get(0).dataProducts().get(0).description()); - Assertions.assertEquals("eiachboosflnr", - model.publishers().get(0).dataProducts().get(0).dataProductVersions().get(0).version()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogsGetByResourceGroupWithResponseMockTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 39cbc8836074..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager; -import com.azure.resourcemanager.networkanalytics.models.DataProductsCatalog; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataProductsCatalogsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"properties\":{\"provisioningState\":\"Failed\",\"publishers\":[{\"publisherName\":\"qzvszjf\",\"dataProducts\":[{\"dataProductName\":\"vjfdx\",\"description\":\"ivetvtcq\",\"dataProductVersions\":[]},{\"dataProductName\":\"qtdo\",\"description\":\"mcbxvwvxysl\",\"dataProductVersions\":[]},{\"dataProductName\":\"bhsfxob\",\"description\":\"ytkblmpew\",\"dataProductVersions\":[]}]},{\"publisherName\":\"wfbkrvrns\",\"dataProducts\":[{\"dataProductName\":\"hqjohxcrsbfova\",\"description\":\"rruvwbhsq\",\"dataProductVersions\":[]},{\"dataProductName\":\"sub\",\"description\":\"gjb\",\"dataProductVersions\":[]},{\"dataProductName\":\"rxbpyb\",\"description\":\"rfbjf\",\"dataProductVersions\":[]}]},{\"publisherName\":\"twss\",\"dataProducts\":[{\"dataProductName\":\"ftpvjzbexil\",\"description\":\"znfqqnvwpmqtar\",\"dataProductVersions\":[]}]}]},\"id\":\"ujmkcjhwqy\",\"name\":\"jrybnwjewgdrjer\",\"type\":\"naenqpehindo\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NetworkAnalyticsManager manager = NetworkAnalyticsManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DataProductsCatalog response = manager.dataProductsCatalogs() - .getByResourceGroupWithResponse("vkr", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("qzvszjf", response.properties().publishers().get(0).publisherName()); - Assertions.assertEquals("vjfdx", - response.properties().publishers().get(0).dataProducts().get(0).dataProductName()); - Assertions.assertEquals("ivetvtcq", - response.properties().publishers().get(0).dataProducts().get(0).description()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogsListByResourceGroupMockTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogsListByResourceGroupMockTests.java deleted file mode 100644 index 509530a4af7a..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogsListByResourceGroupMockTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager; -import com.azure.resourcemanager.networkanalytics.models.DataProductsCatalog; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataProductsCatalogsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Accepted\",\"publishers\":[{\"publisherName\":\"xwyjsflhhc\",\"dataProducts\":[{\"dataProductName\":\"lnjixisxya\",\"description\":\"joya\",\"dataProductVersions\":[]}]},{\"publisherName\":\"cslyjpk\",\"dataProducts\":[{\"dataProductName\":\"dzyexznelixh\",\"description\":\"rzt\",\"dataProductVersions\":[]},{\"dataProductName\":\"o\",\"description\":\"hb\",\"dataProductVersions\":[]},{\"dataProductName\":\"xknalaulppg\",\"description\":\"dtpnapnyiropuhp\",\"dataProductVersions\":[]},{\"dataProductName\":\"gvpgy\",\"description\":\"gqgitxmedjvcsl\",\"dataProductVersions\":[]}]},{\"publisherName\":\"n\",\"dataProducts\":[{\"dataProductName\":\"wncwzzhxgktrmg\",\"description\":\"cnapkteoell\",\"dataProductVersions\":[]},{\"dataProductName\":\"pt\",\"description\":\"d\",\"dataProductVersions\":[]},{\"dataProductName\":\"gpfqbuace\",\"description\":\"pzfqrhhuaoppp\",\"dataProductVersions\":[]}]},{\"publisherName\":\"qeqxo\",\"dataProducts\":[{\"dataProductName\":\"dahzxctobg\",\"description\":\"kdmoi\",\"dataProductVersions\":[]}]}]},\"id\":\"ostmgrcf\",\"name\":\"unrmfqjhhkxb\",\"type\":\"vjymjhxxjyngud\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NetworkAnalyticsManager manager = NetworkAnalyticsManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.dataProductsCatalogs().listByResourceGroup("dttouwaboekqvkel", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("xwyjsflhhc", - response.iterator().next().properties().publishers().get(0).publisherName()); - Assertions.assertEquals("lnjixisxya", - response.iterator().next().properties().publishers().get(0).dataProducts().get(0).dataProductName()); - Assertions.assertEquals("joya", - response.iterator().next().properties().publishers().get(0).dataProducts().get(0).description()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogsListMockTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogsListMockTests.java deleted file mode 100644 index ec416ee7e5e7..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsCatalogsListMockTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager; -import com.azure.resourcemanager.networkanalytics.models.DataProductsCatalog; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataProductsCatalogsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"publishers\":[{\"publisherName\":\"bpbewtghfgb\",\"dataProducts\":[{\"dataProductName\":\"gw\",\"description\":\"zvlvqhjkbegib\",\"dataProductVersions\":[]}]},{\"publisherName\":\"nmxiebwwaloayqc\",\"dataProducts\":[{\"dataProductName\":\"rtzju\",\"description\":\"gwyzm\",\"dataProductVersions\":[]}]},{\"publisherName\":\"txon\",\"dataProducts\":[{\"dataProductName\":\"ts\",\"description\":\"vjcbpwxqpsrknf\",\"dataProductVersions\":[]},{\"dataProductName\":\"guvriuhprwmd\",\"description\":\"vxqtayriwwroyqbe\",\"dataProductVersions\":[]},{\"dataProductName\":\"rmcqiby\",\"description\":\"nojvknmefqsg\",\"dataProductVersions\":[]},{\"dataProductName\":\"vah\",\"description\":\"pjyzhpv\",\"dataProductVersions\":[]}]},{\"publisherName\":\"qzcjrvxdj\",\"dataProducts\":[{\"dataProductName\":\"mwlxk\",\"description\":\"ug\",\"dataProductVersions\":[]},{\"dataProductName\":\"hzovawjvzunlut\",\"description\":\"nnprn\",\"dataProductVersions\":[]},{\"dataProductName\":\"i\",\"description\":\"eilpjzuaejxdu\",\"dataProductVersions\":[]},{\"dataProductName\":\"tskzbbtdzumveek\",\"description\":\"pwo\",\"dataProductVersions\":[]}]}]},\"id\":\"hkfpbs\",\"name\":\"yofd\",\"type\":\"luu\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NetworkAnalyticsManager manager = NetworkAnalyticsManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.dataProductsCatalogs().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("bpbewtghfgb", - response.iterator().next().properties().publishers().get(0).publisherName()); - Assertions.assertEquals("gw", - response.iterator().next().properties().publishers().get(0).dataProducts().get(0).dataProductName()); - Assertions.assertEquals("zvlvqhjkbegib", - response.iterator().next().properties().publishers().get(0).dataProducts().get(0).description()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsListRolesAssignmentsWithResponseMockTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsListRolesAssignmentsWithResponseMockTests.java deleted file mode 100644 index f5e15c8574bf..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsListRolesAssignmentsWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager; -import com.azure.resourcemanager.networkanalytics.models.DataProductUserRole; -import com.azure.resourcemanager.networkanalytics.models.ListRoleAssignments; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataProductsListRolesAssignmentsWithResponseMockTests { - @Test - public void testListRolesAssignmentsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"count\":611656940,\"roleAssignmentResponse\":[{\"roleId\":\"psiebtfhvpes\",\"principalId\":\"pskrdqmh\",\"userName\":\"jdhtldwkyzxu\",\"dataTypeScope\":[\"kn\",\"ws\"],\"principalType\":\"wsvlxotogtwrupqs\",\"role\":\"Reader\",\"roleAssignmentId\":\"nmic\"},{\"roleId\":\"kvceoveilovnotyf\",\"principalId\":\"fcnj\",\"userName\":\"k\",\"dataTypeScope\":[\"x\",\"hbttkphyw\"],\"principalType\":\"nv\",\"role\":\"Reader\",\"roleAssignmentId\":\"oqnermclfpl\"},{\"roleId\":\"hoxus\",\"principalId\":\"rpabg\",\"userName\":\"epsbjtazqu\",\"dataTypeScope\":[\"ywpmueefjzwfqkq\",\"jidsuyonobglaoc\",\"xtccmg\",\"udxytlmoyrx\"],\"principalType\":\"wfudwpzntxhdzhl\",\"role\":\"Reader\",\"roleAssignmentId\":\"jbhckfrlhr\"},{\"roleId\":\"sbkyvpycanuzbp\",\"principalId\":\"kafkuwbcrnwbm\",\"userName\":\"hhseyv\",\"dataTypeScope\":[\"srtslhspkdeem\"],\"principalType\":\"ofmxagkvtmelmqkr\",\"role\":\"SensitiveReader\",\"roleAssignmentId\":\"hvljuahaquh\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NetworkAnalyticsManager manager = NetworkAnalyticsManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ListRoleAssignments response = manager.dataProducts().listRolesAssignmentsWithResponse("wiyighxpkdw", - "baiuebbaumny", "dataupedeojnabckhs", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals(611656940, response.count()); - Assertions.assertEquals("psiebtfhvpes", response.roleAssignmentResponse().get(0).roleId()); - Assertions.assertEquals("pskrdqmh", response.roleAssignmentResponse().get(0).principalId()); - Assertions.assertEquals("jdhtldwkyzxu", response.roleAssignmentResponse().get(0).username()); - Assertions.assertEquals("kn", response.roleAssignmentResponse().get(0).dataTypeScope().get(0)); - Assertions.assertEquals("wsvlxotogtwrupqs", response.roleAssignmentResponse().get(0).principalType()); - Assertions.assertEquals(DataProductUserRole.READER, response.roleAssignmentResponse().get(0).role()); - Assertions.assertEquals("nmic", response.roleAssignmentResponse().get(0).roleAssignmentId()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsRemoveUserRoleWithResponseMockTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsRemoveUserRoleWithResponseMockTests.java deleted file mode 100644 index 69f019919774..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataProductsRemoveUserRoleWithResponseMockTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager; -import com.azure.resourcemanager.networkanalytics.fluent.models.RoleAssignmentDetailInner; -import com.azure.resourcemanager.networkanalytics.models.DataProductUserRole; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataProductsRemoveUserRoleWithResponseMockTests { - @Test - public void testRemoveUserRoleWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NetworkAnalyticsManager manager = NetworkAnalyticsManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.dataProducts().removeUserRoleWithResponse("dhmdua", "aex", - new RoleAssignmentDetailInner().withRoleId("pvfadmwsrcr").withPrincipalId("vxpvgomz").withUsername("fmisg") - .withDataTypeScope(Arrays.asList("nbbelda", "k", "baliourqhakauha")).withPrincipalType("hsfwxosowzxcug") - .withRole(DataProductUserRole.SENSITIVE_READER).withRoleAssignmentId("jooxdjebw"), - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypeInnerTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypeInnerTests.java deleted file mode 100644 index a6f4efdca999..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypeInnerTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.fluent.models.DataTypeInner; -import com.azure.resourcemanager.networkanalytics.models.DataTypeProperties; -import com.azure.resourcemanager.networkanalytics.models.DataTypeState; -import org.junit.jupiter.api.Assertions; - -public final class DataTypeInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataTypeInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Canceled\",\"state\":\"Stopped\",\"stateReason\":\"ulexxbczwtr\",\"storageOutputRetention\":1083545989,\"databaseCacheRetention\":299344741,\"databaseRetention\":1177469779,\"visualizationUrl\":\"vsovmyokac\"},\"id\":\"kwlhzdo\",\"name\":\"pxjmflbvvnchr\",\"type\":\"cciw\"}") - .toObject(DataTypeInner.class); - Assertions.assertEquals(DataTypeState.STOPPED, model.properties().state()); - Assertions.assertEquals(1083545989, model.properties().storageOutputRetention()); - Assertions.assertEquals(299344741, model.properties().databaseCacheRetention()); - Assertions.assertEquals(1177469779, model.properties().databaseRetention()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataTypeInner model = new DataTypeInner().withProperties( - new DataTypeProperties().withState(DataTypeState.STOPPED).withStorageOutputRetention(1083545989) - .withDatabaseCacheRetention(299344741).withDatabaseRetention(1177469779)); - model = BinaryData.fromObject(model).toObject(DataTypeInner.class); - Assertions.assertEquals(DataTypeState.STOPPED, model.properties().state()); - Assertions.assertEquals(1083545989, model.properties().storageOutputRetention()); - Assertions.assertEquals(299344741, model.properties().databaseCacheRetention()); - Assertions.assertEquals(1177469779, model.properties().databaseRetention()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypeListResultTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypeListResultTests.java deleted file mode 100644 index 29652ff115c3..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypeListResultTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.fluent.models.DataTypeInner; -import com.azure.resourcemanager.networkanalytics.models.DataTypeListResult; -import com.azure.resourcemanager.networkanalytics.models.DataTypeProperties; -import com.azure.resourcemanager.networkanalytics.models.DataTypeState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DataTypeListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataTypeListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"state\":\"Running\",\"stateReason\":\"dcsi\",\"storageOutputRetention\":1906498488,\"databaseCacheRetention\":1750107554,\"databaseRetention\":1611277697,\"visualizationUrl\":\"ectehf\"},\"id\":\"scjeypv\",\"name\":\"ezrkgqhcjrefo\",\"type\":\"gm\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"state\":\"Running\",\"stateReason\":\"vxyqjpkcattpngjc\",\"storageOutputRetention\":183805680,\"databaseCacheRetention\":957799467,\"databaseRetention\":822789925,\"visualizationUrl\":\"hvmdajvnysounq\"},\"id\":\"a\",\"name\":\"oaeupfhyhltrpmo\",\"type\":\"jmcmatuokthfu\"},{\"properties\":{\"provisioningState\":\"Failed\",\"state\":\"Running\",\"stateReason\":\"cpkvxodp\",\"storageOutputRetention\":182574553,\"databaseCacheRetention\":1621494681,\"databaseRetention\":466984415,\"visualizationUrl\":\"agfuaxbezyiu\"},\"id\":\"ktwh\",\"name\":\"dxwzywqsmbsurexi\",\"type\":\"o\"},{\"properties\":{\"provisioningState\":\"Accepted\",\"state\":\"Stopped\",\"stateReason\":\"ksymd\",\"storageOutputRetention\":830050857,\"databaseCacheRetention\":1193107670,\"databaseRetention\":980316888,\"visualizationUrl\":\"xhqyudxorrqnb\"},\"id\":\"czvyifq\",\"name\":\"vkd\",\"type\":\"jsllrmv\"}],\"nextLink\":\"f\"}") - .toObject(DataTypeListResult.class); - Assertions.assertEquals(DataTypeState.RUNNING, model.value().get(0).properties().state()); - Assertions.assertEquals(1906498488, model.value().get(0).properties().storageOutputRetention()); - Assertions.assertEquals(1750107554, model.value().get(0).properties().databaseCacheRetention()); - Assertions.assertEquals(1611277697, model.value().get(0).properties().databaseRetention()); - Assertions.assertEquals("f", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataTypeListResult model = new DataTypeListResult().withValue(Arrays.asList( - new DataTypeInner().withProperties( - new DataTypeProperties().withState(DataTypeState.RUNNING).withStorageOutputRetention(1906498488) - .withDatabaseCacheRetention(1750107554).withDatabaseRetention(1611277697)), - new DataTypeInner().withProperties( - new DataTypeProperties().withState(DataTypeState.RUNNING).withStorageOutputRetention(183805680) - .withDatabaseCacheRetention(957799467).withDatabaseRetention(822789925)), - new DataTypeInner().withProperties( - new DataTypeProperties().withState(DataTypeState.RUNNING).withStorageOutputRetention(182574553) - .withDatabaseCacheRetention(1621494681).withDatabaseRetention(466984415)), - new DataTypeInner().withProperties( - new DataTypeProperties().withState(DataTypeState.STOPPED).withStorageOutputRetention(830050857) - .withDatabaseCacheRetention(1193107670).withDatabaseRetention(980316888)))) - .withNextLink("f"); - model = BinaryData.fromObject(model).toObject(DataTypeListResult.class); - Assertions.assertEquals(DataTypeState.RUNNING, model.value().get(0).properties().state()); - Assertions.assertEquals(1906498488, model.value().get(0).properties().storageOutputRetention()); - Assertions.assertEquals(1750107554, model.value().get(0).properties().databaseCacheRetention()); - Assertions.assertEquals(1611277697, model.value().get(0).properties().databaseRetention()); - Assertions.assertEquals("f", model.nextLink()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypePropertiesTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypePropertiesTests.java deleted file mode 100644 index 052e86d837a5..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypePropertiesTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.models.DataTypeProperties; -import com.azure.resourcemanager.networkanalytics.models.DataTypeState; -import org.junit.jupiter.api.Assertions; - -public final class DataTypePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataTypeProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Canceled\",\"state\":\"Stopped\",\"stateReason\":\"hrsajiwkuofo\",\"storageOutputRetention\":1637974204,\"databaseCacheRetention\":1623882899,\"databaseRetention\":1515601233,\"visualizationUrl\":\"imjm\"}") - .toObject(DataTypeProperties.class); - Assertions.assertEquals(DataTypeState.STOPPED, model.state()); - Assertions.assertEquals(1637974204, model.storageOutputRetention()); - Assertions.assertEquals(1623882899, model.databaseCacheRetention()); - Assertions.assertEquals(1515601233, model.databaseRetention()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataTypeProperties model - = new DataTypeProperties().withState(DataTypeState.STOPPED).withStorageOutputRetention(1637974204) - .withDatabaseCacheRetention(1623882899).withDatabaseRetention(1515601233); - model = BinaryData.fromObject(model).toObject(DataTypeProperties.class); - Assertions.assertEquals(DataTypeState.STOPPED, model.state()); - Assertions.assertEquals(1637974204, model.storageOutputRetention()); - Assertions.assertEquals(1623882899, model.databaseCacheRetention()); - Assertions.assertEquals(1515601233, model.databaseRetention()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypeUpdatePropertiesTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypeUpdatePropertiesTests.java deleted file mode 100644 index 22f3d3f9dc21..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypeUpdatePropertiesTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.models.DataTypeState; -import com.azure.resourcemanager.networkanalytics.models.DataTypeUpdateProperties; -import org.junit.jupiter.api.Assertions; - -public final class DataTypeUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataTypeUpdateProperties model = BinaryData.fromString( - "{\"state\":\"Running\",\"storageOutputRetention\":1166674819,\"databaseCacheRetention\":857489891,\"databaseRetention\":786534004}") - .toObject(DataTypeUpdateProperties.class); - Assertions.assertEquals(DataTypeState.RUNNING, model.state()); - Assertions.assertEquals(1166674819, model.storageOutputRetention()); - Assertions.assertEquals(857489891, model.databaseCacheRetention()); - Assertions.assertEquals(786534004, model.databaseRetention()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataTypeUpdateProperties model - = new DataTypeUpdateProperties().withState(DataTypeState.RUNNING).withStorageOutputRetention(1166674819) - .withDatabaseCacheRetention(857489891).withDatabaseRetention(786534004); - model = BinaryData.fromObject(model).toObject(DataTypeUpdateProperties.class); - Assertions.assertEquals(DataTypeState.RUNNING, model.state()); - Assertions.assertEquals(1166674819, model.storageOutputRetention()); - Assertions.assertEquals(857489891, model.databaseCacheRetention()); - Assertions.assertEquals(786534004, model.databaseRetention()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypeUpdateTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypeUpdateTests.java deleted file mode 100644 index 5604a73085a2..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypeUpdateTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.models.DataTypeState; -import com.azure.resourcemanager.networkanalytics.models.DataTypeUpdate; -import com.azure.resourcemanager.networkanalytics.models.DataTypeUpdateProperties; -import org.junit.jupiter.api.Assertions; - -public final class DataTypeUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataTypeUpdate model = BinaryData.fromString( - "{\"properties\":{\"state\":\"Stopped\",\"storageOutputRetention\":825029486,\"databaseCacheRetention\":2070328561,\"databaseRetention\":1007558597}}") - .toObject(DataTypeUpdate.class); - Assertions.assertEquals(DataTypeState.STOPPED, model.properties().state()); - Assertions.assertEquals(825029486, model.properties().storageOutputRetention()); - Assertions.assertEquals(2070328561, model.properties().databaseCacheRetention()); - Assertions.assertEquals(1007558597, model.properties().databaseRetention()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataTypeUpdate model = new DataTypeUpdate().withProperties( - new DataTypeUpdateProperties().withState(DataTypeState.STOPPED).withStorageOutputRetention(825029486) - .withDatabaseCacheRetention(2070328561).withDatabaseRetention(1007558597)); - model = BinaryData.fromObject(model).toObject(DataTypeUpdate.class); - Assertions.assertEquals(DataTypeState.STOPPED, model.properties().state()); - Assertions.assertEquals(825029486, model.properties().storageOutputRetention()); - Assertions.assertEquals(2070328561, model.properties().databaseCacheRetention()); - Assertions.assertEquals(1007558597, model.properties().databaseRetention()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesCreateMockTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesCreateMockTests.java deleted file mode 100644 index b741d51a3113..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesCreateMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager; -import com.azure.resourcemanager.networkanalytics.models.DataType; -import com.azure.resourcemanager.networkanalytics.models.DataTypeProperties; -import com.azure.resourcemanager.networkanalytics.models.DataTypeState; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataTypesCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"state\":\"Running\",\"stateReason\":\"zxb\",\"storageOutputRetention\":623062887,\"databaseCacheRetention\":1983379457,\"databaseRetention\":473319481,\"visualizationUrl\":\"zmuvpbttdumorppx\"},\"id\":\"mnzb\",\"name\":\"bhjpglkfgohdne\",\"type\":\"el\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NetworkAnalyticsManager manager = NetworkAnalyticsManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DataType response = manager.dataTypes().define("bqdxbx").withExistingDataProduct("fzxmhhvhgureodkw", "bdagxt") - .withProperties( - new DataTypeProperties().withState(DataTypeState.RUNNING).withStorageOutputRetention(144807252) - .withDatabaseCacheRetention(1090180987).withDatabaseRetention(1185146175)) - .create(); - - Assertions.assertEquals(DataTypeState.RUNNING, response.properties().state()); - Assertions.assertEquals(623062887, response.properties().storageOutputRetention()); - Assertions.assertEquals(1983379457, response.properties().databaseCacheRetention()); - Assertions.assertEquals(473319481, response.properties().databaseRetention()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesGetWithResponseMockTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesGetWithResponseMockTests.java deleted file mode 100644 index 3ce3845b80cd..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesGetWithResponseMockTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager; -import com.azure.resourcemanager.networkanalytics.models.DataType; -import com.azure.resourcemanager.networkanalytics.models.DataTypeState; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataTypesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"properties\":{\"provisioningState\":\"Accepted\",\"state\":\"Stopped\",\"stateReason\":\"t\",\"storageOutputRetention\":1008975068,\"databaseCacheRetention\":1072156994,\"databaseRetention\":2060062752,\"visualizationUrl\":\"ygtdsslswt\"},\"id\":\"eriofzpyqs\",\"name\":\"mwabnetshhszhedp\",\"type\":\"vwiwubmwmbesld\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NetworkAnalyticsManager manager = NetworkAnalyticsManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DataType response = manager.dataTypes() - .getWithResponse("mnvdfzn", "daodvxzbncblyl", "stdbhhxsrzdzu", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals(DataTypeState.STOPPED, response.properties().state()); - Assertions.assertEquals(1008975068, response.properties().storageOutputRetention()); - Assertions.assertEquals(1072156994, response.properties().databaseCacheRetention()); - Assertions.assertEquals(2060062752, response.properties().databaseRetention()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesListByDataProductMockTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesListByDataProductMockTests.java deleted file mode 100644 index 10cf093253a8..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/DataTypesListByDataProductMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager; -import com.azure.resourcemanager.networkanalytics.models.DataType; -import com.azure.resourcemanager.networkanalytics.models.DataTypeState; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DataTypesListByDataProductMockTests { - @Test - public void testListByDataProduct() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"state\":\"Running\",\"stateReason\":\"humaqolbgyc\",\"storageOutputRetention\":1405569741,\"databaseCacheRetention\":178501813,\"databaseRetention\":1300588551,\"visualizationUrl\":\"cym\"},\"id\":\"olpsslqlf\",\"name\":\"mdnbbglzpswiy\",\"type\":\"mcwyhzdxssadb\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NetworkAnalyticsManager manager = NetworkAnalyticsManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.dataTypes().listByDataProduct("gmifthnzd", "dslgnayqigynduh", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(DataTypeState.RUNNING, response.iterator().next().properties().state()); - Assertions.assertEquals(1405569741, response.iterator().next().properties().storageOutputRetention()); - Assertions.assertEquals(178501813, response.iterator().next().properties().databaseCacheRetention()); - Assertions.assertEquals(1300588551, response.iterator().next().properties().databaseRetention()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/IpRulesTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/IpRulesTests.java deleted file mode 100644 index 13642990ca6c..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/IpRulesTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.models.IpRules; -import org.junit.jupiter.api.Assertions; - -public final class IpRulesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpRules model - = BinaryData.fromString("{\"value\":\"dkwt\",\"action\":\"hxbnjbiksqrg\"}").toObject(IpRules.class); - Assertions.assertEquals("dkwt", model.value()); - Assertions.assertEquals("hxbnjbiksqrg", model.action()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpRules model = new IpRules().withValue("dkwt").withAction("hxbnjbiksqrg"); - model = BinaryData.fromObject(model).toObject(IpRules.class); - Assertions.assertEquals("dkwt", model.value()); - Assertions.assertEquals("hxbnjbiksqrg", model.action()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/ListRoleAssignmentsInnerTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/ListRoleAssignmentsInnerTests.java deleted file mode 100644 index 8b4f8c2511af..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/ListRoleAssignmentsInnerTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.fluent.models.ListRoleAssignmentsInner; -import com.azure.resourcemanager.networkanalytics.fluent.models.RoleAssignmentDetailInner; -import com.azure.resourcemanager.networkanalytics.models.DataProductUserRole; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ListRoleAssignmentsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ListRoleAssignmentsInner model = BinaryData.fromString( - "{\"count\":1235353776,\"roleAssignmentResponse\":[{\"roleId\":\"eiithlvmez\",\"principalId\":\"v\",\"userName\":\"hxmzsbbzoggig\",\"dataTypeScope\":[\"wburvjxxjnspydpt\",\"oenkouknvudwti\",\"kbldngkpocipa\"],\"principalType\":\"yxoegukgjnp\",\"role\":\"SensitiveReader\",\"roleAssignmentId\":\"cgygev\"},{\"roleId\":\"zntypmrb\",\"principalId\":\"izcdrqjsd\",\"userName\":\"ydnfyhxdeoejz\",\"dataTypeScope\":[\"w\"],\"principalType\":\"fsj\",\"role\":\"SensitiveReader\",\"roleAssignmentId\":\"gzfbishcbk\"},{\"roleId\":\"ajdeyeamdphaga\",\"principalId\":\"pbuxwgipwhon\",\"userName\":\"wkgshwa\",\"dataTypeScope\":[\"ixzbinjeputtmryw\"],\"principalType\":\"uzoqft\",\"role\":\"SensitiveReader\",\"roleAssignmentId\":\"qzrnkcqvyxlwhz\"}]}") - .toObject(ListRoleAssignmentsInner.class); - Assertions.assertEquals(1235353776, model.count()); - Assertions.assertEquals("eiithlvmez", model.roleAssignmentResponse().get(0).roleId()); - Assertions.assertEquals("v", model.roleAssignmentResponse().get(0).principalId()); - Assertions.assertEquals("hxmzsbbzoggig", model.roleAssignmentResponse().get(0).username()); - Assertions.assertEquals("wburvjxxjnspydpt", model.roleAssignmentResponse().get(0).dataTypeScope().get(0)); - Assertions.assertEquals("yxoegukgjnp", model.roleAssignmentResponse().get(0).principalType()); - Assertions.assertEquals(DataProductUserRole.SENSITIVE_READER, model.roleAssignmentResponse().get(0).role()); - Assertions.assertEquals("cgygev", model.roleAssignmentResponse().get(0).roleAssignmentId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ListRoleAssignmentsInner model - = new ListRoleAssignmentsInner() - .withCount( - 1235353776) - .withRoleAssignmentResponse(Arrays.asList( - new RoleAssignmentDetailInner().withRoleId("eiithlvmez").withPrincipalId("v") - .withUsername("hxmzsbbzoggig") - .withDataTypeScope(Arrays.asList("wburvjxxjnspydpt", "oenkouknvudwti", "kbldngkpocipa")) - .withPrincipalType("yxoegukgjnp").withRole(DataProductUserRole.SENSITIVE_READER) - .withRoleAssignmentId("cgygev"), - new RoleAssignmentDetailInner().withRoleId("zntypmrb").withPrincipalId("izcdrqjsd") - .withUsername("ydnfyhxdeoejz").withDataTypeScope(Arrays.asList("w")).withPrincipalType("fsj") - .withRole(DataProductUserRole.SENSITIVE_READER).withRoleAssignmentId("gzfbishcbk"), - new RoleAssignmentDetailInner().withRoleId("ajdeyeamdphaga").withPrincipalId("pbuxwgipwhon") - .withUsername("wkgshwa").withDataTypeScope(Arrays.asList("ixzbinjeputtmryw")) - .withPrincipalType("uzoqft").withRole(DataProductUserRole.SENSITIVE_READER) - .withRoleAssignmentId("qzrnkcqvyxlwhz"))); - model = BinaryData.fromObject(model).toObject(ListRoleAssignmentsInner.class); - Assertions.assertEquals(1235353776, model.count()); - Assertions.assertEquals("eiithlvmez", model.roleAssignmentResponse().get(0).roleId()); - Assertions.assertEquals("v", model.roleAssignmentResponse().get(0).principalId()); - Assertions.assertEquals("hxmzsbbzoggig", model.roleAssignmentResponse().get(0).username()); - Assertions.assertEquals("wburvjxxjnspydpt", model.roleAssignmentResponse().get(0).dataTypeScope().get(0)); - Assertions.assertEquals("yxoegukgjnp", model.roleAssignmentResponse().get(0).principalType()); - Assertions.assertEquals(DataProductUserRole.SENSITIVE_READER, model.roleAssignmentResponse().get(0).role()); - Assertions.assertEquals("cgygev", model.roleAssignmentResponse().get(0).roleAssignmentId()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/ManagedResourceGroupConfigurationTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/ManagedResourceGroupConfigurationTests.java deleted file mode 100644 index 5f7048c24185..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/ManagedResourceGroupConfigurationTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.models.ManagedResourceGroupConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class ManagedResourceGroupConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedResourceGroupConfiguration model - = BinaryData.fromString("{\"name\":\"ssainqpjwnzll\",\"location\":\"fmppe\"}") - .toObject(ManagedResourceGroupConfiguration.class); - Assertions.assertEquals("ssainqpjwnzll", model.name()); - Assertions.assertEquals("fmppe", model.location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedResourceGroupConfiguration model - = new ManagedResourceGroupConfiguration().withName("ssainqpjwnzll").withLocation("fmppe"); - model = BinaryData.fromObject(model).toObject(ManagedResourceGroupConfiguration.class); - Assertions.assertEquals("ssainqpjwnzll", model.name()); - Assertions.assertEquals("fmppe", model.location()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/ManagedServiceIdentityTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/ManagedServiceIdentityTests.java deleted file mode 100644 index fb1ad2987e0c..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/ManagedServiceIdentityTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.models.ManagedServiceIdentity; -import com.azure.resourcemanager.networkanalytics.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.networkanalytics.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ManagedServiceIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedServiceIdentity model = BinaryData.fromString( - "{\"principalId\":\"4fcef1a9-72e4-4043-91e6-c47e058fc563\",\"tenantId\":\"57aefc45-bc4f-421d-9558-b51f2d19a9e7\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"oc\":{\"principalId\":\"142fe27d-018d-4656-b8fd-251eb325d9a3\",\"clientId\":\"2e766b34-c45e-432d-b0bd-adcf59a42bd1\"},\"ablgphuticndvk\":{\"principalId\":\"d086e8dc-d66b-4bcd-bebb-6848d6885a40\",\"clientId\":\"7a4a85a1-5f4f-45f7-bf25-cb2cb5f0e347\"},\"wyiftyhxhur\":{\"principalId\":\"e3e5eff6-610a-4c35-b02e-f7c80d1034c3\",\"clientId\":\"0e9b742b-a9e8-4040-b0e5-4d9f198f51d3\"},\"tyxolniwpwc\":{\"principalId\":\"de3770fe-33b1-448c-a5dc-3abaa379a8b6\",\"clientId\":\"88aee310-aca9-44fa-88cd-00c4e77b349a\"}}}") - .toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities( - mapOf("oc", new UserAssignedIdentity(), "ablgphuticndvk", new UserAssignedIdentity(), "wyiftyhxhur", - new UserAssignedIdentity(), "tyxolniwpwc", new UserAssignedIdentity())); - model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/OperationDisplayTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/OperationDisplayTests.java deleted file mode 100644 index eed2cb8dbb92..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/OperationDisplayTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"yrtih\",\"resource\":\"tijbpzvgnwzsymgl\",\"operation\":\"fcyzkohdbihanufh\",\"description\":\"bj\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/OperationInnerTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/OperationInnerTests.java deleted file mode 100644 index 903ca8280c13..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/OperationInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.fluent.models.OperationInner; -import com.azure.resourcemanager.networkanalytics.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = BinaryData.fromString( - "{\"name\":\"usarhmofc\",\"isDataAction\":false,\"display\":{\"provider\":\"urkdtmlx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/OperationListResultTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/OperationListResultTests.java deleted file mode 100644 index 7150c689d9df..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/OperationListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"izhwlrxy\",\"isDataAction\":false,\"display\":{\"provider\":\"ijgkdm\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"rifkwm\",\"isDataAction\":true,\"display\":{\"provider\":\"izntocipao\",\"resource\":\"jpsq\",\"operation\":\"mpoyfd\",\"description\":\"ogknygjofjdd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upewnwreitjzy\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/OperationsListMockTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/OperationsListMockTests.java deleted file mode 100644 index 93b9c6c64038..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/OperationsListMockTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.networkanalytics.NetworkAnalyticsManager; -import com.azure.resourcemanager.networkanalytics.models.Operation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"value\":[{\"name\":\"w\",\"isDataAction\":false,\"display\":{\"provider\":\"mmqhgyxzkonocuk\",\"resource\":\"lyaxuc\",\"operation\":\"uqszfk\",\"description\":\"ypewrmjmwvvjekt\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - NetworkAnalyticsManager manager = NetworkAnalyticsManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/PublisherInformationTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/PublisherInformationTests.java deleted file mode 100644 index 8e4adbb76afe..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/PublisherInformationTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.models.DataProductInformation; -import com.azure.resourcemanager.networkanalytics.models.DataProductVersion; -import com.azure.resourcemanager.networkanalytics.models.PublisherInformation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PublisherInformationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PublisherInformation model = BinaryData.fromString( - "{\"publisherName\":\"qajzyulpkudjkr\",\"dataProducts\":[{\"dataProductName\":\"hbzhfepg\",\"description\":\"gqexzlocxs\",\"dataProductVersions\":[{\"version\":\"aierhhb\"},{\"version\":\"sglumma\"}]},{\"dataProductName\":\"tjaodxobnb\",\"description\":\"xkqpxo\",\"dataProductVersions\":[{\"version\":\"jionpimexgstxgc\"},{\"version\":\"odgmaajrmvdjwz\"},{\"version\":\"lovmclwhijcoe\"},{\"version\":\"ctbzaq\"}]},{\"dataProductName\":\"qsycbkbfkgu\",\"description\":\"dkexxppofm\",\"dataProductVersions\":[{\"version\":\"x\"},{\"version\":\"fjpgddtocjjxhvp\"},{\"version\":\"o\"},{\"version\":\"exhd\"}]}]}") - .toObject(PublisherInformation.class); - Assertions.assertEquals("qajzyulpkudjkr", model.publisherName()); - Assertions.assertEquals("hbzhfepg", model.dataProducts().get(0).dataProductName()); - Assertions.assertEquals("gqexzlocxs", model.dataProducts().get(0).description()); - Assertions.assertEquals("aierhhb", model.dataProducts().get(0).dataProductVersions().get(0).version()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PublisherInformation model - = new PublisherInformation().withPublisherName("qajzyulpkudjkr") - .withDataProducts(Arrays.asList( - new DataProductInformation().withDataProductName("hbzhfepg").withDescription("gqexzlocxs") - .withDataProductVersions(Arrays.asList(new DataProductVersion().withVersion("aierhhb"), - new DataProductVersion().withVersion("sglumma"))), - new DataProductInformation().withDataProductName("tjaodxobnb").withDescription("xkqpxo") - .withDataProductVersions(Arrays.asList(new DataProductVersion().withVersion("jionpimexgstxgc"), - new DataProductVersion().withVersion("odgmaajrmvdjwz"), - new DataProductVersion().withVersion("lovmclwhijcoe"), - new DataProductVersion().withVersion("ctbzaq"))), - new DataProductInformation().withDataProductName("qsycbkbfkgu").withDescription("dkexxppofm") - .withDataProductVersions(Arrays.asList(new DataProductVersion().withVersion("x"), - new DataProductVersion().withVersion("fjpgddtocjjxhvp"), - new DataProductVersion().withVersion("o"), new DataProductVersion().withVersion("exhd"))))); - model = BinaryData.fromObject(model).toObject(PublisherInformation.class); - Assertions.assertEquals("qajzyulpkudjkr", model.publisherName()); - Assertions.assertEquals("hbzhfepg", model.dataProducts().get(0).dataProductName()); - Assertions.assertEquals("gqexzlocxs", model.dataProducts().get(0).description()); - Assertions.assertEquals("aierhhb", model.dataProducts().get(0).dataProductVersions().get(0).version()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/RoleAssignmentCommonPropertiesTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/RoleAssignmentCommonPropertiesTests.java deleted file mode 100644 index b1d88aaa9900..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/RoleAssignmentCommonPropertiesTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.models.DataProductUserRole; -import com.azure.resourcemanager.networkanalytics.models.RoleAssignmentCommonProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RoleAssignmentCommonPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RoleAssignmentCommonProperties model = BinaryData.fromString( - "{\"roleId\":\"masxazjpqyegu\",\"principalId\":\"lhbxxhejjzzvdud\",\"userName\":\"wdslfhotwmcy\",\"dataTypeScope\":[\"wlbjnpgacftade\",\"xnltyfsoppu\"],\"principalType\":\"uesnzwdejbavo\",\"role\":\"SensitiveReader\"}") - .toObject(RoleAssignmentCommonProperties.class); - Assertions.assertEquals("masxazjpqyegu", model.roleId()); - Assertions.assertEquals("lhbxxhejjzzvdud", model.principalId()); - Assertions.assertEquals("wdslfhotwmcy", model.username()); - Assertions.assertEquals("wlbjnpgacftade", model.dataTypeScope().get(0)); - Assertions.assertEquals("uesnzwdejbavo", model.principalType()); - Assertions.assertEquals(DataProductUserRole.SENSITIVE_READER, model.role()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RoleAssignmentCommonProperties model - = new RoleAssignmentCommonProperties().withRoleId("masxazjpqyegu").withPrincipalId("lhbxxhejjzzvdud") - .withUsername("wdslfhotwmcy").withDataTypeScope(Arrays.asList("wlbjnpgacftade", "xnltyfsoppu")) - .withPrincipalType("uesnzwdejbavo").withRole(DataProductUserRole.SENSITIVE_READER); - model = BinaryData.fromObject(model).toObject(RoleAssignmentCommonProperties.class); - Assertions.assertEquals("masxazjpqyegu", model.roleId()); - Assertions.assertEquals("lhbxxhejjzzvdud", model.principalId()); - Assertions.assertEquals("wdslfhotwmcy", model.username()); - Assertions.assertEquals("wlbjnpgacftade", model.dataTypeScope().get(0)); - Assertions.assertEquals("uesnzwdejbavo", model.principalType()); - Assertions.assertEquals(DataProductUserRole.SENSITIVE_READER, model.role()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/RoleAssignmentDetailInnerTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/RoleAssignmentDetailInnerTests.java deleted file mode 100644 index 17048fb8efa3..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/RoleAssignmentDetailInnerTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.fluent.models.RoleAssignmentDetailInner; -import com.azure.resourcemanager.networkanalytics.models.DataProductUserRole; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RoleAssignmentDetailInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RoleAssignmentDetailInner model = BinaryData.fromString( - "{\"roleId\":\"zdmohctbqvu\",\"principalId\":\"wxdndnvowgujjug\",\"userName\":\"dkcglhsl\",\"dataTypeScope\":[\"jdyggdtji\"],\"principalType\":\"hbkuofqwey\",\"role\":\"SensitiveReader\",\"roleAssignmentId\":\"menevfyexfwh\"}") - .toObject(RoleAssignmentDetailInner.class); - Assertions.assertEquals("zdmohctbqvu", model.roleId()); - Assertions.assertEquals("wxdndnvowgujjug", model.principalId()); - Assertions.assertEquals("dkcglhsl", model.username()); - Assertions.assertEquals("jdyggdtji", model.dataTypeScope().get(0)); - Assertions.assertEquals("hbkuofqwey", model.principalType()); - Assertions.assertEquals(DataProductUserRole.SENSITIVE_READER, model.role()); - Assertions.assertEquals("menevfyexfwh", model.roleAssignmentId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RoleAssignmentDetailInner model - = new RoleAssignmentDetailInner().withRoleId("zdmohctbqvu").withPrincipalId("wxdndnvowgujjug") - .withUsername("dkcglhsl").withDataTypeScope(Arrays.asList("jdyggdtji")).withPrincipalType("hbkuofqwey") - .withRole(DataProductUserRole.SENSITIVE_READER).withRoleAssignmentId("menevfyexfwh"); - model = BinaryData.fromObject(model).toObject(RoleAssignmentDetailInner.class); - Assertions.assertEquals("zdmohctbqvu", model.roleId()); - Assertions.assertEquals("wxdndnvowgujjug", model.principalId()); - Assertions.assertEquals("dkcglhsl", model.username()); - Assertions.assertEquals("jdyggdtji", model.dataTypeScope().get(0)); - Assertions.assertEquals("hbkuofqwey", model.principalType()); - Assertions.assertEquals(DataProductUserRole.SENSITIVE_READER, model.role()); - Assertions.assertEquals("menevfyexfwh", model.roleAssignmentId()); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/UserAssignedIdentityTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/UserAssignedIdentityTests.java deleted file mode 100644 index 84e9cb33060b..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/UserAssignedIdentityTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.models.UserAssignedIdentity; - -public final class UserAssignedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserAssignedIdentity model = BinaryData.fromString( - "{\"principalId\":\"b4a69e1d-2c1d-421a-9885-4629eb07c93f\",\"clientId\":\"3380f17a-b577-447e-be7d-835ca603b8f2\"}") - .toObject(UserAssignedIdentity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentity model = new UserAssignedIdentity(); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - } -} diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/VirtualNetworkRuleTests.java b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/VirtualNetworkRuleTests.java deleted file mode 100644 index 9e8609637f5b..000000000000 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/src/test/java/com/azure/resourcemanager/networkanalytics/generated/VirtualNetworkRuleTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// 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.util.BinaryData; -import com.azure.resourcemanager.networkanalytics.models.VirtualNetworkRule; -import org.junit.jupiter.api.Assertions; - -public final class VirtualNetworkRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualNetworkRule model - = BinaryData.fromString("{\"id\":\"bkzgcwrwclx\",\"action\":\"rljdouskcqv\",\"state\":\"cr\"}") - .toObject(VirtualNetworkRule.class); - Assertions.assertEquals("bkzgcwrwclx", model.id()); - Assertions.assertEquals("rljdouskcqv", model.action()); - Assertions.assertEquals("cr", model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualNetworkRule model - = new VirtualNetworkRule().withId("bkzgcwrwclx").withAction("rljdouskcqv").withState("cr"); - model = BinaryData.fromObject(model).toObject(VirtualNetworkRule.class); - Assertions.assertEquals("bkzgcwrwclx", model.id()); - Assertions.assertEquals("rljdouskcqv", model.action()); - Assertions.assertEquals("cr", model.state()); - } -}