diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/CHANGELOG.md b/sdk/datalakestore/azure-resourcemanager-datalakestore/CHANGELOG.md index d8aa77f643055..422d2442a7a9a 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/CHANGELOG.md +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/CHANGELOG.md @@ -1,7 +1,41 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.2 (2023-01-16) +- Azure Resource Manager DataLakeStore client library for Java. This package contains Microsoft Azure SDK for DataLakeStore Management SDK. Creates an Azure Data Lake Store account management client. Package tag package-2016-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +### Breaking Changes + +* `models.DataLakeStoreAccountPropertiesBasic` was removed + +* `models.DataLakeStoreAccountProperties` was removed + +### Features Added + +#### `models.FirewallRule` was modified + +* `resourceGroupName()` was added + +#### `DataLakeStoreManager$Configurable` was modified + +* `withRetryOptions(com.azure.core.http.policy.RetryOptions)` was added +* `withScope(java.lang.String)` was added + +#### `models.DataLakeStoreAccount` was modified + +* `resourceGroupName()` was added + +#### `models.VirtualNetworkRule` was modified + +* `resourceGroupName()` was added + +#### `DataLakeStoreManager` was modified + +* `authenticate(com.azure.core.http.HttpPipeline,com.azure.core.management.profile.AzureProfile)` was added + +#### `models.TrustedIdProvider` was modified + +* `resourceGroupName()` was added ## 1.0.0-beta.1 (2021-04-22) diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/README.md b/sdk/datalakestore/azure-resourcemanager-datalakestore/README.md index 6e5cf2300b3a2..72eb7861540bf 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/README.md +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-datalakestore - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. ### Authentication -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. - `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -74,19 +74,22 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/datalakestore/azure-resourcemanager-datalakestore/SAMPLE.md) + + ## Troubleshooting ## Next steps ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS @@ -97,3 +100,6 @@ For details on contributing to this repository, see the [contributing guide](htt [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/SAMPLE.md b/sdk/datalakestore/azure-resourcemanager-datalakestore/SAMPLE.md new file mode 100644 index 0000000000000..bed7903eac978 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/SAMPLE.md @@ -0,0 +1,743 @@ +# Code snippets and samples + + +## Accounts + +- [CheckNameAvailability](#accounts_checknameavailability) +- [Create](#accounts_create) +- [Delete](#accounts_delete) +- [EnableKeyVault](#accounts_enablekeyvault) +- [GetByResourceGroup](#accounts_getbyresourcegroup) +- [List](#accounts_list) +- [ListByResourceGroup](#accounts_listbyresourcegroup) +- [Update](#accounts_update) + +## FirewallRules + +- [CreateOrUpdate](#firewallrules_createorupdate) +- [Delete](#firewallrules_delete) +- [Get](#firewallrules_get) +- [ListByAccount](#firewallrules_listbyaccount) +- [Update](#firewallrules_update) + +## Locations + +- [GetCapability](#locations_getcapability) +- [GetUsage](#locations_getusage) + +## Operations + +- [List](#operations_list) + +## TrustedIdProviders + +- [CreateOrUpdate](#trustedidproviders_createorupdate) +- [Delete](#trustedidproviders_delete) +- [Get](#trustedidproviders_get) +- [ListByAccount](#trustedidproviders_listbyaccount) +- [Update](#trustedidproviders_update) + +## VirtualNetworkRules + +- [CreateOrUpdate](#virtualnetworkrules_createorupdate) +- [Delete](#virtualnetworkrules_delete) +- [Get](#virtualnetworkrules_get) +- [ListByAccount](#virtualnetworkrules_listbyaccount) +- [Update](#virtualnetworkrules_update) +### Accounts_CheckNameAvailability + +```java +import com.azure.resourcemanager.datalakestore.models.CheckNameAvailabilityParameters; + +/** Samples for Accounts CheckNameAvailability. */ +public final class AccountsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Accounts_CheckNameAvailability.json + */ + /** + * Sample code: Checks whether the specified account name is available or taken. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void checksWhetherTheSpecifiedAccountNameIsAvailableOrTaken( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .accounts() + .checkNameAvailabilityWithResponse( + "EastUS2", + new CheckNameAvailabilityParameters().withName("contosoadla"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Accounts_Create + +```java +import com.azure.resourcemanager.datalakestore.models.CreateFirewallRuleWithAccountParameters; +import com.azure.resourcemanager.datalakestore.models.CreateTrustedIdProviderWithAccountParameters; +import com.azure.resourcemanager.datalakestore.models.EncryptionConfig; +import com.azure.resourcemanager.datalakestore.models.EncryptionConfigType; +import com.azure.resourcemanager.datalakestore.models.EncryptionIdentity; +import com.azure.resourcemanager.datalakestore.models.EncryptionState; +import com.azure.resourcemanager.datalakestore.models.FirewallAllowAzureIpsState; +import com.azure.resourcemanager.datalakestore.models.FirewallState; +import com.azure.resourcemanager.datalakestore.models.KeyVaultMetaInfo; +import com.azure.resourcemanager.datalakestore.models.TierType; +import com.azure.resourcemanager.datalakestore.models.TrustedIdProviderState; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Accounts Create. */ +public final class AccountsCreateSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Accounts_Create.json + */ + /** + * Sample code: Creates the specified Data Lake Store account. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void createsTheSpecifiedDataLakeStoreAccount( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .accounts() + .define("contosoadla") + .withRegion("eastus2") + .withExistingResourceGroup("contosorg") + .withTags(mapOf("test_key", "test_value")) + .withIdentity(new EncryptionIdentity()) + .withDefaultGroup("test_default_group") + .withEncryptionConfig( + new EncryptionConfig() + .withType(EncryptionConfigType.USER_MANAGED) + .withKeyVaultMetaInfo( + new KeyVaultMetaInfo() + .withKeyVaultResourceId("fakeTokenPlaceholder") + .withEncryptionKeyName("fakeTokenPlaceholder") + .withEncryptionKeyVersion("fakeTokenPlaceholder"))) + .withEncryptionState(EncryptionState.ENABLED) + .withFirewallRules( + Arrays + .asList( + new CreateFirewallRuleWithAccountParameters() + .withName("test_rule") + .withStartIpAddress("1.1.1.1") + .withEndIpAddress("2.2.2.2"))) + .withFirewallState(FirewallState.ENABLED) + .withFirewallAllowAzureIps(FirewallAllowAzureIpsState.ENABLED) + .withTrustedIdProviders( + Arrays + .asList( + new CreateTrustedIdProviderWithAccountParameters() + .withName("test_trusted_id_provider_name") + .withIdProvider("https://sts.windows.net/ea9ec534-a3e3-4e45-ad36-3afc5bb291c1"))) + .withTrustedIdProviderState(TrustedIdProviderState.ENABLED) + .withNewTier(TierType.CONSUMPTION) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Accounts_Delete + +```java +/** Samples for Accounts Delete. */ +public final class AccountsDeleteSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Accounts_Delete.json + */ + /** + * Sample code: Deletes the specified Data Lake Store account. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void deletesTheSpecifiedDataLakeStoreAccount( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager.accounts().delete("contosorg", "contosoadla", com.azure.core.util.Context.NONE); + } +} +``` + +### Accounts_EnableKeyVault + +```java +/** Samples for Accounts EnableKeyVault. */ +public final class AccountsEnableKeyVaultSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Accounts_EnableKeyVault.json + */ + /** + * Sample code: Attempts to enable a user managed Key Vault for encryption of the specified Data Lake Store account. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void attemptsToEnableAUserManagedKeyVaultForEncryptionOfTheSpecifiedDataLakeStoreAccount( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager.accounts().enableKeyVaultWithResponse("contosorg", "contosoadla", com.azure.core.util.Context.NONE); + } +} +``` + +### Accounts_GetByResourceGroup + +```java +/** Samples for Accounts GetByResourceGroup. */ +public final class AccountsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Accounts_Get.json + */ + /** + * Sample code: Gets the specified Data Lake Store account. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void getsTheSpecifiedDataLakeStoreAccount( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager.accounts().getByResourceGroupWithResponse("contosorg", "contosoadla", com.azure.core.util.Context.NONE); + } +} +``` + +### Accounts_List + +```java +/** Samples for Accounts List. */ +public final class AccountsListSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Accounts_List.json + */ + /** + * Sample code: Lists the Data Lake Store accounts within the subscription. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void listsTheDataLakeStoreAccountsWithinTheSubscription( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .accounts() + .list("test_filter", 1, 1, "test_select", "test_orderby", false, com.azure.core.util.Context.NONE); + } +} +``` + +### Accounts_ListByResourceGroup + +```java +/** Samples for Accounts ListByResourceGroup. */ +public final class AccountsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Accounts_ListByResourceGroup.json + */ + /** + * Sample code: Lists the Data Lake Store accounts within a specific resource group. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void listsTheDataLakeStoreAccountsWithinASpecificResourceGroup( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .accounts() + .listByResourceGroup( + "contosorg", + "test_filter", + 1, + 1, + "test_select", + "test_orderby", + false, + com.azure.core.util.Context.NONE); + } +} +``` + +### Accounts_Update + +```java +import com.azure.resourcemanager.datalakestore.models.DataLakeStoreAccount; +import com.azure.resourcemanager.datalakestore.models.FirewallAllowAzureIpsState; +import com.azure.resourcemanager.datalakestore.models.FirewallState; +import com.azure.resourcemanager.datalakestore.models.TierType; +import com.azure.resourcemanager.datalakestore.models.TrustedIdProviderState; +import com.azure.resourcemanager.datalakestore.models.UpdateEncryptionConfig; +import com.azure.resourcemanager.datalakestore.models.UpdateKeyVaultMetaInfo; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Accounts Update. */ +public final class AccountsUpdateSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Accounts_Update.json + */ + /** + * Sample code: Updates the specified Data Lake Store account information. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void updatesTheSpecifiedDataLakeStoreAccountInformation( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + DataLakeStoreAccount resource = + manager + .accounts() + .getByResourceGroupWithResponse("contosorg", "contosoadla", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("test_key", "test_value")) + .withDefaultGroup("test_default_group") + .withEncryptionConfig( + new UpdateEncryptionConfig() + .withKeyVaultMetaInfo( + new UpdateKeyVaultMetaInfo().withEncryptionKeyVersion("fakeTokenPlaceholder"))) + .withFirewallState(FirewallState.ENABLED) + .withFirewallAllowAzureIps(FirewallAllowAzureIpsState.ENABLED) + .withTrustedIdProviderState(TrustedIdProviderState.ENABLED) + .withNewTier(TierType.CONSUMPTION) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### FirewallRules_CreateOrUpdate + +```java +/** Samples for FirewallRules CreateOrUpdate. */ +public final class FirewallRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/FirewallRules_CreateOrUpdate.json + */ + /** + * Sample code: Creates or updates the specified firewall rule. During update, the firewall rule with the specified + * name will be replaced with this new firewall rule. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void + createsOrUpdatesTheSpecifiedFirewallRuleDuringUpdateTheFirewallRuleWithTheSpecifiedNameWillBeReplacedWithThisNewFirewallRule( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .firewallRules() + .define("test_rule") + .withExistingAccount("contosorg", "contosoadla") + .withStartIpAddress("1.1.1.1") + .withEndIpAddress("2.2.2.2") + .create(); + } +} +``` + +### FirewallRules_Delete + +```java +/** Samples for FirewallRules Delete. */ +public final class FirewallRulesDeleteSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/FirewallRules_Delete.json + */ + /** + * Sample code: Deletes the specified firewall rule from the specified Data Lake Store account. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void deletesTheSpecifiedFirewallRuleFromTheSpecifiedDataLakeStoreAccount( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .firewallRules() + .deleteWithResponse("contosorg", "contosoadla", "test_rule", com.azure.core.util.Context.NONE); + } +} +``` + +### FirewallRules_Get + +```java +/** Samples for FirewallRules Get. */ +public final class FirewallRulesGetSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/FirewallRules_Get.json + */ + /** + * Sample code: Gets the specified Data Lake Store firewall rule. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void getsTheSpecifiedDataLakeStoreFirewallRule( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .firewallRules() + .getWithResponse("contosorg", "contosoadla", "test_rule", com.azure.core.util.Context.NONE); + } +} +``` + +### FirewallRules_ListByAccount + +```java +/** Samples for FirewallRules ListByAccount. */ +public final class FirewallRulesListByAccountSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/FirewallRules_ListByAccount.json + */ + /** + * Sample code: Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void listsTheDataLakeStoreFirewallRulesWithinTheSpecifiedDataLakeStoreAccount( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager.firewallRules().listByAccount("contosorg", "contosoadla", com.azure.core.util.Context.NONE); + } +} +``` + +### FirewallRules_Update + +```java +import com.azure.resourcemanager.datalakestore.models.FirewallRule; + +/** Samples for FirewallRules Update. */ +public final class FirewallRulesUpdateSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/FirewallRules_Update.json + */ + /** + * Sample code: Updates the specified firewall rule. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void updatesTheSpecifiedFirewallRule( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + FirewallRule resource = + manager + .firewallRules() + .getWithResponse("contosorg", "contosoadla", "test_rule", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withStartIpAddress("1.1.1.1").withEndIpAddress("2.2.2.2").apply(); + } +} +``` + +### Locations_GetCapability + +```java +/** Samples for Locations GetCapability. */ +public final class LocationsGetCapabilitySamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Locations_GetCapability.json + */ + /** + * Sample code: Gets subscription-level properties and limits for Data Lake Store specified by resource location. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void getsSubscriptionLevelPropertiesAndLimitsForDataLakeStoreSpecifiedByResourceLocation( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager.locations().getCapabilityWithResponse("EastUS2", com.azure.core.util.Context.NONE); + } +} +``` + +### Locations_GetUsage + +```java +/** Samples for Locations GetUsage. */ +public final class LocationsGetUsageSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Locations_GetUsage.json + */ + /** + * Sample code: UsageList. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void usageList(com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager.locations().getUsage("WestUS", com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Operations_List.json + */ + /** + * Sample code: Lists all of the available Data Lake Store REST API operations. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void listsAllOfTheAvailableDataLakeStoreRESTAPIOperations( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager.operations().listWithResponse(com.azure.core.util.Context.NONE); + } +} +``` + +### TrustedIdProviders_CreateOrUpdate + +```java +/** Samples for TrustedIdProviders CreateOrUpdate. */ +public final class TrustedIdProvidersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/TrustedIdProviders_CreateOrUpdate.json + */ + /** + * Sample code: Creates or updates the specified trusted identity provider. During update, the trusted identity + * provider with the specified name will be replaced with this new provider. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void + createsOrUpdatesTheSpecifiedTrustedIdentityProviderDuringUpdateTheTrustedIdentityProviderWithTheSpecifiedNameWillBeReplacedWithThisNewProvider( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .trustedIdProviders() + .define("test_trusted_id_provider_name") + .withExistingAccount("contosorg", "contosoadla") + .withIdProvider("https://sts.windows.net/ea9ec534-a3e3-4e45-ad36-3afc5bb291c1") + .create(); + } +} +``` + +### TrustedIdProviders_Delete + +```java +/** Samples for TrustedIdProviders Delete. */ +public final class TrustedIdProvidersDeleteSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/TrustedIdProviders_Delete.json + */ + /** + * Sample code: Deletes the specified trusted identity provider from the specified Data Lake Store account. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void deletesTheSpecifiedTrustedIdentityProviderFromTheSpecifiedDataLakeStoreAccount( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .trustedIdProviders() + .deleteWithResponse( + "contosorg", "contosoadla", "test_trusted_id_provider_name", com.azure.core.util.Context.NONE); + } +} +``` + +### TrustedIdProviders_Get + +```java +/** Samples for TrustedIdProviders Get. */ +public final class TrustedIdProvidersGetSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/TrustedIdProviders_Get.json + */ + /** + * Sample code: Gets the specified Data Lake Store trusted identity provider. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void getsTheSpecifiedDataLakeStoreTrustedIdentityProvider( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .trustedIdProviders() + .getWithResponse( + "contosorg", "contosoadla", "test_trusted_id_provider_name", com.azure.core.util.Context.NONE); + } +} +``` + +### TrustedIdProviders_ListByAccount + +```java +/** Samples for TrustedIdProviders ListByAccount. */ +public final class TrustedIdProvidersListByAccountSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/TrustedIdProviders_ListByAccount.json + */ + /** + * Sample code: Lists the Data Lake Store trusted identity providers within the specified Data Lake Store account. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void listsTheDataLakeStoreTrustedIdentityProvidersWithinTheSpecifiedDataLakeStoreAccount( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager.trustedIdProviders().listByAccount("contosorg", "contosoadla", com.azure.core.util.Context.NONE); + } +} +``` + +### TrustedIdProviders_Update + +```java +import com.azure.resourcemanager.datalakestore.models.TrustedIdProvider; + +/** Samples for TrustedIdProviders Update. */ +public final class TrustedIdProvidersUpdateSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/TrustedIdProviders_Update.json + */ + /** + * Sample code: Updates the specified trusted identity provider. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void updatesTheSpecifiedTrustedIdentityProvider( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + TrustedIdProvider resource = + manager + .trustedIdProviders() + .getWithResponse( + "contosorg", "contosoadla", "test_trusted_id_provider_name", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withIdProvider("https://sts.windows.net/ea9ec534-a3e3-4e45-ad36-3afc5bb291c1").apply(); + } +} +``` + +### VirtualNetworkRules_CreateOrUpdate + +```java +/** Samples for VirtualNetworkRules CreateOrUpdate. */ +public final class VirtualNetworkRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/VirtualNetworkRules_CreateOrUpdate.json + */ + /** + * Sample code: Creates or updates the specified virtual network rule. During update, the virtual network rule with + * the specified name will be replaced with this new virtual network rule. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void + createsOrUpdatesTheSpecifiedVirtualNetworkRuleDuringUpdateTheVirtualNetworkRuleWithTheSpecifiedNameWillBeReplacedWithThisNewVirtualNetworkRule( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .virtualNetworkRules() + .define("test_virtual_network_rules_name") + .withExistingAccount("contosorg", "contosoadla") + .withSubnetId("test_subnetId") + .create(); + } +} +``` + +### VirtualNetworkRules_Delete + +```java +/** Samples for VirtualNetworkRules Delete. */ +public final class VirtualNetworkRulesDeleteSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/VirtualNetworkRules_Delete.json + */ + /** + * Sample code: Deletes the specified virtual network rule from the specified Data Lake Store account. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void deletesTheSpecifiedVirtualNetworkRuleFromTheSpecifiedDataLakeStoreAccount( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .virtualNetworkRules() + .deleteWithResponse( + "contosorg", "contosoadla", "test_virtual_network_rules_name", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkRules_Get + +```java +/** Samples for VirtualNetworkRules Get. */ +public final class VirtualNetworkRulesGetSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/VirtualNetworkRules_Get.json + */ + /** + * Sample code: Gets the specified Data Lake Store virtual network rule. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void getsTheSpecifiedDataLakeStoreVirtualNetworkRule( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .virtualNetworkRules() + .getWithResponse( + "contosorg", "contosoadla", "test_virtual_network_rules_name", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkRules_ListByAccount + +```java +/** Samples for VirtualNetworkRules ListByAccount. */ +public final class VirtualNetworkRulesListByAccountSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/VirtualNetworkRules_ListByAccount.json + */ + /** + * Sample code: Lists the Data Lake Store virtual network rules within the specified Data Lake Store account. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void listsTheDataLakeStoreVirtualNetworkRulesWithinTheSpecifiedDataLakeStoreAccount( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager.virtualNetworkRules().listByAccount("contosorg", "contosoadla", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkRules_Update + +```java +import com.azure.resourcemanager.datalakestore.models.VirtualNetworkRule; + +/** Samples for VirtualNetworkRules Update. */ +public final class VirtualNetworkRulesUpdateSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/VirtualNetworkRules_Update.json + */ + /** + * Sample code: Updates the specified virtual network rule. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void updatesTheSpecifiedVirtualNetworkRule( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + VirtualNetworkRule resource = + manager + .virtualNetworkRules() + .getWithResponse( + "contosorg", "contosoadla", "test_virtual_network_rules_name", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withSubnetId("test_subnetId").apply(); + } +} +``` + diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/pom.xml b/sdk/datalakestore/azure-resourcemanager-datalakestore/pom.xml index 7feac7e37a8e2..afcc85a4f1e9b 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/pom.xml +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/pom.xml @@ -1,55 +1,91 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-datalakestore - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-datalakestore + 1.0.0-beta.2 + jar - Microsoft Azure SDK for DataLakeStore Management - This package contains Microsoft Azure SDK for DataLakeStore Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Creates an Azure Data Lake Store account management client. Package tag package-2016-11. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for DataLakeStore Management + This package contains Microsoft Azure SDK for DataLakeStore Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Creates an Azure Data Lake Store account management client. Package tag package-2016-11. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - true - - - - com.azure - azure-core - 1.35.0 - - - com.azure - azure-core-management - 1.10.0 - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.35.0 + + + com.azure + azure-core-management + 1.10.0 + + + com.azure + azure-core-test + 1.14.0 + test + + + com.azure + azure-identity + 1.7.3 + test + + + org.junit.jupiter + junit-jupiter-api + 5.9.1 + test + + + org.junit.jupiter + junit-jupiter-engine + 5.9.1 + test + + + org.mockito + mockito-core + 4.5.1 + test + + + org.slf4j + slf4j-simple + 1.7.36 + test + + diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/DataLakeStoreManager.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/DataLakeStoreManager.java index dde6dec3d8f0f..82985a1bc1e75 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/DataLakeStoreManager.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/DataLakeStoreManager.java @@ -8,15 +8,18 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -39,6 +42,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to DataLakeStoreManager. Creates an Azure Data Lake Store account management client. */ public final class DataLakeStoreManager { @@ -81,6 +85,19 @@ public static DataLakeStoreManager authenticate(TokenCredential credential, Azur return configure().authenticate(credential, profile); } + /** + * Creates an instance of DataLakeStore service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the DataLakeStore service API instance. + */ + public static DataLakeStoreManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new DataLakeStoreManager(httpPipeline, profile, null); + } + /** * Gets a Configurable instance that can be used to create DataLakeStoreManager with optional configuration. * @@ -92,12 +109,14 @@ public static Configurable configure() { /** The Configurable allowing configurations to be set. */ public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; + private RetryOptions retryOptions; private Duration defaultPollInterval; private Configurable() { @@ -136,6 +155,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -147,6 +177,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { return this; } + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + /** * Sets the default poll interval, used when service does not provide "Retry-After" header. * @@ -154,9 +197,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); } return this; } @@ -178,7 +223,7 @@ public DataLakeStoreManager authenticate(TokenCredential credential, AzureProfil .append("-") .append("com.azure.resourcemanager.datalakestore") .append("/") - .append("1.0.0-beta.1"); + .append("1.0.0-beta.2"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -192,20 +237,38 @@ public DataLakeStoreManager authenticate(TokenCredential credential, AzureProfil userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); - policies.addAll(this.policies); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = @@ -217,7 +280,11 @@ public DataLakeStoreManager authenticate(TokenCredential credential, AzureProfil } } - /** @return Resource collection API of Accounts. */ + /** + * Gets the resource collection API of Accounts. It manages DataLakeStoreAccount. + * + * @return Resource collection API of Accounts. + */ public Accounts accounts() { if (this.accounts == null) { this.accounts = new AccountsImpl(clientObject.getAccounts(), this); @@ -225,7 +292,11 @@ public Accounts accounts() { return accounts; } - /** @return Resource collection API of FirewallRules. */ + /** + * Gets the resource collection API of FirewallRules. It manages FirewallRule. + * + * @return Resource collection API of FirewallRules. + */ public FirewallRules firewallRules() { if (this.firewallRules == null) { this.firewallRules = new FirewallRulesImpl(clientObject.getFirewallRules(), this); @@ -233,7 +304,11 @@ public FirewallRules firewallRules() { return firewallRules; } - /** @return Resource collection API of VirtualNetworkRules. */ + /** + * Gets the resource collection API of VirtualNetworkRules. It manages VirtualNetworkRule. + * + * @return Resource collection API of VirtualNetworkRules. + */ public VirtualNetworkRules virtualNetworkRules() { if (this.virtualNetworkRules == null) { this.virtualNetworkRules = new VirtualNetworkRulesImpl(clientObject.getVirtualNetworkRules(), this); @@ -241,7 +316,11 @@ public VirtualNetworkRules virtualNetworkRules() { return virtualNetworkRules; } - /** @return Resource collection API of TrustedIdProviders. */ + /** + * Gets the resource collection API of TrustedIdProviders. It manages TrustedIdProvider. + * + * @return Resource collection API of TrustedIdProviders. + */ public TrustedIdProviders trustedIdProviders() { if (this.trustedIdProviders == null) { this.trustedIdProviders = new TrustedIdProvidersImpl(clientObject.getTrustedIdProviders(), this); @@ -249,7 +328,11 @@ public TrustedIdProviders trustedIdProviders() { return trustedIdProviders; } - /** @return Resource collection API of Operations. */ + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ public Operations operations() { if (this.operations == null) { this.operations = new OperationsImpl(clientObject.getOperations(), this); @@ -257,7 +340,11 @@ public Operations operations() { return operations; } - /** @return Resource collection API of Locations. */ + /** + * Gets the resource collection API of Locations. + * + * @return Resource collection API of Locations. + */ public Locations locations() { if (this.locations == null) { this.locations = new LocationsImpl(clientObject.getLocations(), this); diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/AccountsClient.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/AccountsClient.java index ec08e4b5bd1cf..2d8b2cf199991 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/AccountsClient.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/AccountsClient.java @@ -26,7 +26,7 @@ public interface AccountsClient { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -49,7 +49,7 @@ public interface AccountsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( @@ -63,7 +63,7 @@ PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -87,7 +87,7 @@ PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup( @@ -109,9 +109,9 @@ PagedIterable listByResourceGroup( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account information. + * @return the {@link SyncPoller} for polling of data Lake Store account information. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DataLakeStoreAccountInner> beginCreate( String resourceGroupName, String accountName, CreateDataLakeStoreAccountParameters parameters); @@ -125,9 +125,9 @@ SyncPoller, DataLakeStoreAccountInner> beg * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account information. + * @return the {@link SyncPoller} for polling of data Lake Store account information. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DataLakeStoreAccountInner> beginCreate( String resourceGroupName, String accountName, CreateDataLakeStoreAccountParameters parameters, Context context); @@ -167,28 +167,28 @@ DataLakeStoreAccountInner create( * * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store account. + * @return the specified Data Lake Store account along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - DataLakeStoreAccountInner getByResourceGroup(String resourceGroupName, String accountName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context); /** * Gets the specified Data Lake Store account. * * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified Data Lake Store account. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String accountName, Context context); + DataLakeStoreAccountInner getByResourceGroup(String resourceGroupName, String accountName); /** * Updates the specified Data Lake Store account information. @@ -199,9 +199,9 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account information. + * @return the {@link SyncPoller} for polling of data Lake Store account information. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DataLakeStoreAccountInner> beginUpdate( String resourceGroupName, String accountName, UpdateDataLakeStoreAccountParameters parameters); @@ -215,9 +215,9 @@ SyncPoller, DataLakeStoreAccountInner> beg * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account information. + * @return the {@link SyncPoller} for polling of data Lake Store account information. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DataLakeStoreAccountInner> beginUpdate( String resourceGroupName, String accountName, UpdateDataLakeStoreAccountParameters parameters, Context context); @@ -260,9 +260,9 @@ DataLakeStoreAccountInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String accountName); /** @@ -274,9 +274,9 @@ DataLakeStoreAccountInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, Context context); /** @@ -309,52 +309,52 @@ DataLakeStoreAccountInner update( * * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void enableKeyVault(String resourceGroupName, String accountName); + Response enableKeyVaultWithResponse(String resourceGroupName, String accountName, Context context); /** * Attempts to enable a user managed Key Vault for encryption of the specified Data Lake Store account. * * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response enableKeyVaultWithResponse(String resourceGroupName, String accountName, Context context); + void enableKeyVault(String resourceGroupName, String accountName); /** * Checks whether the specified account name is available or taken. * * @param location The resource location without whitespace. * @param parameters Parameters supplied to check the Data Lake Store account name availability. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account name availability result information. + * @return data Lake Store account name availability result information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - NameAvailabilityInformationInner checkNameAvailability(String location, CheckNameAvailabilityParameters parameters); + Response checkNameAvailabilityWithResponse( + String location, CheckNameAvailabilityParameters parameters, Context context); /** * Checks whether the specified account name is available or taken. * * @param location The resource location without whitespace. * @param parameters Parameters supplied to check the Data Lake Store account name availability. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data Lake Store account name availability result information. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityWithResponse( - String location, CheckNameAvailabilityParameters parameters, Context context); + NameAvailabilityInformationInner checkNameAvailability(String location, CheckNameAvailabilityParameters parameters); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/FirewallRulesClient.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/FirewallRulesClient.java index c305c33e79bbc..8d3c8d84fa0b7 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/FirewallRulesClient.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/FirewallRulesClient.java @@ -23,7 +23,7 @@ public interface FirewallRulesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store firewall rule list information. + * @return data Lake Store firewall rule list information as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByAccount(String resourceGroupName, String accountName); @@ -37,7 +37,7 @@ public interface FirewallRulesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store firewall rule list information. + * @return data Lake Store firewall rule list information as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByAccount(String resourceGroupName, String accountName, Context context); @@ -50,17 +50,19 @@ public interface FirewallRulesClient { * @param accountName The name of the Data Lake Store account. * @param firewallRuleName The name of the firewall rule to create or update. * @param parameters Parameters supplied to create or update the firewall rule. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store firewall rule information. + * @return data Lake Store firewall rule information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - FirewallRuleInner createOrUpdate( + Response createOrUpdateWithResponse( String resourceGroupName, String accountName, String firewallRuleName, - CreateOrUpdateFirewallRuleParameters parameters); + CreateOrUpdateFirewallRuleParameters parameters, + Context context); /** * Creates or updates the specified firewall rule. During update, the firewall rule with the specified name will be @@ -70,19 +72,17 @@ FirewallRuleInner createOrUpdate( * @param accountName The name of the Data Lake Store account. * @param firewallRuleName The name of the firewall rule to create or update. * @param parameters Parameters supplied to create or update the firewall rule. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data Lake Store firewall rule information. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( + FirewallRuleInner createOrUpdate( String resourceGroupName, String accountName, String firewallRuleName, - CreateOrUpdateFirewallRuleParameters parameters, - Context context); + CreateOrUpdateFirewallRuleParameters parameters); /** * Gets the specified Data Lake Store firewall rule. @@ -90,13 +90,15 @@ Response createOrUpdateWithResponse( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param firewallRuleName The name of the firewall rule to retrieve. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store firewall rule. + * @return the specified Data Lake Store firewall rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - FirewallRuleInner get(String resourceGroupName, String accountName, String firewallRuleName); + Response getWithResponse( + String resourceGroupName, String accountName, String firewallRuleName, Context context); /** * Gets the specified Data Lake Store firewall rule. @@ -104,15 +106,13 @@ Response createOrUpdateWithResponse( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param firewallRuleName The name of the firewall rule to retrieve. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified Data Lake Store firewall rule. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String accountName, String firewallRuleName, Context context); + FirewallRuleInner get(String resourceGroupName, String accountName, String firewallRuleName); /** * Updates the specified firewall rule. @@ -120,13 +120,20 @@ Response getWithResponse( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param firewallRuleName The name of the firewall rule to update. + * @param parameters Parameters supplied to update the firewall rule. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store firewall rule information. + * @return data Lake Store firewall rule information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - FirewallRuleInner update(String resourceGroupName, String accountName, String firewallRuleName); + Response updateWithResponse( + String resourceGroupName, + String accountName, + String firewallRuleName, + UpdateFirewallRuleParameters parameters, + Context context); /** * Updates the specified firewall rule. @@ -134,20 +141,13 @@ Response getWithResponse( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param firewallRuleName The name of the firewall rule to update. - * @param parameters Parameters supplied to update the firewall rule. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data Lake Store firewall rule information. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String accountName, - String firewallRuleName, - UpdateFirewallRuleParameters parameters, - Context context); + FirewallRuleInner update(String resourceGroupName, String accountName, String firewallRuleName); /** * Deletes the specified firewall rule from the specified Data Lake Store account. @@ -155,12 +155,15 @@ Response updateWithResponse( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param firewallRuleName The name of the firewall rule to delete. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, String firewallRuleName); + Response deleteWithResponse( + String resourceGroupName, String accountName, String firewallRuleName, Context context); /** * Deletes the specified firewall rule from the specified Data Lake Store account. @@ -168,13 +171,10 @@ Response updateWithResponse( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param firewallRuleName The name of the firewall rule to delete. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String accountName, String firewallRuleName, Context context); + void delete(String resourceGroupName, String accountName, String firewallRuleName); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/LocationsClient.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/LocationsClient.java index 9a5ce8d12fa81..c97df9a9eb4b7 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/LocationsClient.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/LocationsClient.java @@ -18,26 +18,27 @@ public interface LocationsClient { * Gets subscription-level properties and limits for Data Lake Store specified by resource location. * * @param location The resource location without whitespace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription-level properties and limits for Data Lake Store specified by resource location. + * @return subscription-level properties and limits for Data Lake Store specified by resource location along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - CapabilityInformationInner getCapability(String location); + Response getCapabilityWithResponse(String location, Context context); /** * Gets subscription-level properties and limits for Data Lake Store specified by resource location. * * @param location The resource location without whitespace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return subscription-level properties and limits for Data Lake Store specified by resource location. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getCapabilityWithResponse(String location, Context context); + CapabilityInformationInner getCapability(String location); /** * Gets the current usage count and the limit for the resources of the location under the subscription. @@ -46,7 +47,8 @@ public interface LocationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current usage count and the limit for the resources of the location under the subscription. + * @return the current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable getUsage(String location); @@ -59,7 +61,8 @@ public interface LocationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current usage count and the limit for the resources of the location under the subscription. + * @return the current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable getUsage(String location, Context context); diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/OperationsClient.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/OperationsClient.java index 9bea2aa0b1cbe..d3fa5bbd90bb1 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/OperationsClient.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/OperationsClient.java @@ -15,22 +15,22 @@ public interface OperationsClient { /** * Lists all of the available Data Lake Store REST API operations. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available operations for Data Lake Store. + * @return the list of available operations for Data Lake Store along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationListResultInner list(); + Response listWithResponse(Context context); /** * Lists all of the available Data Lake Store REST API operations. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of available operations for Data Lake Store. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); + OperationListResultInner list(); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/TrustedIdProvidersClient.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/TrustedIdProvidersClient.java index 053699721a726..2576b36da3534 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/TrustedIdProvidersClient.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/TrustedIdProvidersClient.java @@ -23,7 +23,8 @@ public interface TrustedIdProvidersClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store trusted identity provider list information. + * @return data Lake Store trusted identity provider list information as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByAccount(String resourceGroupName, String accountName); @@ -37,7 +38,8 @@ public interface TrustedIdProvidersClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store trusted identity provider list information. + * @return data Lake Store trusted identity provider list information as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByAccount(String resourceGroupName, String accountName, Context context); @@ -51,17 +53,19 @@ public interface TrustedIdProvidersClient { * @param trustedIdProviderName The name of the trusted identity provider. This is used for differentiation of * providers in the account. * @param parameters Parameters supplied to create or replace the trusted identity provider. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store trusted identity provider information. + * @return data Lake Store trusted identity provider information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - TrustedIdProviderInner createOrUpdate( + Response createOrUpdateWithResponse( String resourceGroupName, String accountName, String trustedIdProviderName, - CreateOrUpdateTrustedIdProviderParameters parameters); + CreateOrUpdateTrustedIdProviderParameters parameters, + Context context); /** * Creates or updates the specified trusted identity provider. During update, the trusted identity provider with the @@ -72,19 +76,17 @@ TrustedIdProviderInner createOrUpdate( * @param trustedIdProviderName The name of the trusted identity provider. This is used for differentiation of * providers in the account. * @param parameters Parameters supplied to create or replace the trusted identity provider. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data Lake Store trusted identity provider information. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( + TrustedIdProviderInner createOrUpdate( String resourceGroupName, String accountName, String trustedIdProviderName, - CreateOrUpdateTrustedIdProviderParameters parameters, - Context context); + CreateOrUpdateTrustedIdProviderParameters parameters); /** * Gets the specified Data Lake Store trusted identity provider. @@ -92,13 +94,15 @@ Response createOrUpdateWithResponse( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param trustedIdProviderName The name of the trusted identity provider to retrieve. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store trusted identity provider. + * @return the specified Data Lake Store trusted identity provider along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - TrustedIdProviderInner get(String resourceGroupName, String accountName, String trustedIdProviderName); + Response getWithResponse( + String resourceGroupName, String accountName, String trustedIdProviderName, Context context); /** * Gets the specified Data Lake Store trusted identity provider. @@ -106,15 +110,13 @@ Response createOrUpdateWithResponse( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param trustedIdProviderName The name of the trusted identity provider to retrieve. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified Data Lake Store trusted identity provider. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String accountName, String trustedIdProviderName, Context context); + TrustedIdProviderInner get(String resourceGroupName, String accountName, String trustedIdProviderName); /** * Updates the specified trusted identity provider. @@ -123,13 +125,20 @@ Response getWithResponse( * @param accountName The name of the Data Lake Store account. * @param trustedIdProviderName The name of the trusted identity provider. This is used for differentiation of * providers in the account. + * @param parameters Parameters supplied to update the trusted identity provider. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store trusted identity provider information. + * @return data Lake Store trusted identity provider information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - TrustedIdProviderInner update(String resourceGroupName, String accountName, String trustedIdProviderName); + Response updateWithResponse( + String resourceGroupName, + String accountName, + String trustedIdProviderName, + UpdateTrustedIdProviderParameters parameters, + Context context); /** * Updates the specified trusted identity provider. @@ -138,20 +147,13 @@ Response getWithResponse( * @param accountName The name of the Data Lake Store account. * @param trustedIdProviderName The name of the trusted identity provider. This is used for differentiation of * providers in the account. - * @param parameters Parameters supplied to update the trusted identity provider. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data Lake Store trusted identity provider information. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String accountName, - String trustedIdProviderName, - UpdateTrustedIdProviderParameters parameters, - Context context); + TrustedIdProviderInner update(String resourceGroupName, String accountName, String trustedIdProviderName); /** * Deletes the specified trusted identity provider from the specified Data Lake Store account. @@ -159,12 +161,15 @@ Response updateWithResponse( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param trustedIdProviderName The name of the trusted identity provider to delete. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, String trustedIdProviderName); + Response deleteWithResponse( + String resourceGroupName, String accountName, String trustedIdProviderName, Context context); /** * Deletes the specified trusted identity provider from the specified Data Lake Store account. @@ -172,13 +177,10 @@ Response updateWithResponse( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param trustedIdProviderName The name of the trusted identity provider to delete. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String accountName, String trustedIdProviderName, Context context); + void delete(String resourceGroupName, String accountName, String trustedIdProviderName); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/VirtualNetworkRulesClient.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/VirtualNetworkRulesClient.java index e6c92f4ae20db..58aad33637fb3 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/VirtualNetworkRulesClient.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/VirtualNetworkRulesClient.java @@ -23,7 +23,7 @@ public interface VirtualNetworkRulesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store virtual network rule list information. + * @return data Lake Store virtual network rule list information as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByAccount(String resourceGroupName, String accountName); @@ -37,7 +37,7 @@ public interface VirtualNetworkRulesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store virtual network rule list information. + * @return data Lake Store virtual network rule list information as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByAccount(String resourceGroupName, String accountName, Context context); @@ -50,17 +50,19 @@ public interface VirtualNetworkRulesClient { * @param accountName The name of the Data Lake Store account. * @param virtualNetworkRuleName The name of the virtual network rule to create or update. * @param parameters Parameters supplied to create or update the virtual network rule. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store virtual network rule information. + * @return data Lake Store virtual network rule information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkRuleInner createOrUpdate( + Response createOrUpdateWithResponse( String resourceGroupName, String accountName, String virtualNetworkRuleName, - CreateOrUpdateVirtualNetworkRuleParameters parameters); + CreateOrUpdateVirtualNetworkRuleParameters parameters, + Context context); /** * Creates or updates the specified virtual network rule. During update, the virtual network rule with the specified @@ -70,19 +72,17 @@ VirtualNetworkRuleInner createOrUpdate( * @param accountName The name of the Data Lake Store account. * @param virtualNetworkRuleName The name of the virtual network rule to create or update. * @param parameters Parameters supplied to create or update the virtual network rule. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data Lake Store virtual network rule information. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( + VirtualNetworkRuleInner createOrUpdate( String resourceGroupName, String accountName, String virtualNetworkRuleName, - CreateOrUpdateVirtualNetworkRuleParameters parameters, - Context context); + CreateOrUpdateVirtualNetworkRuleParameters parameters); /** * Gets the specified Data Lake Store virtual network rule. @@ -90,13 +90,15 @@ Response createOrUpdateWithResponse( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param virtualNetworkRuleName The name of the virtual network rule to retrieve. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store virtual network rule. + * @return the specified Data Lake Store virtual network rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkRuleInner get(String resourceGroupName, String accountName, String virtualNetworkRuleName); + Response getWithResponse( + String resourceGroupName, String accountName, String virtualNetworkRuleName, Context context); /** * Gets the specified Data Lake Store virtual network rule. @@ -104,15 +106,13 @@ Response createOrUpdateWithResponse( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param virtualNetworkRuleName The name of the virtual network rule to retrieve. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified Data Lake Store virtual network rule. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String accountName, String virtualNetworkRuleName, Context context); + VirtualNetworkRuleInner get(String resourceGroupName, String accountName, String virtualNetworkRuleName); /** * Updates the specified virtual network rule. @@ -120,13 +120,20 @@ Response getWithResponse( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param virtualNetworkRuleName The name of the virtual network rule to update. + * @param parameters Parameters supplied to update the virtual network rule. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store virtual network rule information. + * @return data Lake Store virtual network rule information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkRuleInner update(String resourceGroupName, String accountName, String virtualNetworkRuleName); + Response updateWithResponse( + String resourceGroupName, + String accountName, + String virtualNetworkRuleName, + UpdateVirtualNetworkRuleParameters parameters, + Context context); /** * Updates the specified virtual network rule. @@ -134,20 +141,13 @@ Response getWithResponse( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param virtualNetworkRuleName The name of the virtual network rule to update. - * @param parameters Parameters supplied to update the virtual network rule. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data Lake Store virtual network rule information. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String accountName, - String virtualNetworkRuleName, - UpdateVirtualNetworkRuleParameters parameters, - Context context); + VirtualNetworkRuleInner update(String resourceGroupName, String accountName, String virtualNetworkRuleName); /** * Deletes the specified virtual network rule from the specified Data Lake Store account. @@ -155,12 +155,15 @@ Response updateWithResponse( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param virtualNetworkRuleName The name of the virtual network rule to delete. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, String virtualNetworkRuleName); + Response deleteWithResponse( + String resourceGroupName, String accountName, String virtualNetworkRuleName, Context context); /** * Deletes the specified virtual network rule from the specified Data Lake Store account. @@ -168,13 +171,10 @@ Response updateWithResponse( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param virtualNetworkRuleName The name of the virtual network rule to delete. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String accountName, String virtualNetworkRuleName, Context context); + void delete(String resourceGroupName, String accountName, String virtualNetworkRuleName); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/CapabilityInformationInner.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/CapabilityInformationInner.java index 82adf704a57ff..ba41edede7580 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/CapabilityInformationInner.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/CapabilityInformationInner.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.datalakestore.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datalakestore.models.SubscriptionState; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.UUID; /** Subscription-level properties and limits for Data Lake Store. */ @Immutable public final class CapabilityInformationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CapabilityInformationInner.class); - /* * The subscription credentials that uniquely identifies the subscription. */ @@ -46,6 +42,10 @@ public final class CapabilityInformationInner { @JsonProperty(value = "migrationState", access = JsonProperty.Access.WRITE_ONLY) private Boolean migrationState; + /** Creates an instance of CapabilityInformationInner class. */ + public CapabilityInformationInner() { + } + /** * Get the subscriptionId property: The subscription credentials that uniquely identifies the subscription. * diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/CreateDataLakeStoreAccountProperties.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/CreateDataLakeStoreAccountProperties.java new file mode 100644 index 0000000000000..2f61f49d7ff42 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/CreateDataLakeStoreAccountProperties.java @@ -0,0 +1,322 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.datalakestore.models.CreateFirewallRuleWithAccountParameters; +import com.azure.resourcemanager.datalakestore.models.CreateTrustedIdProviderWithAccountParameters; +import com.azure.resourcemanager.datalakestore.models.CreateVirtualNetworkRuleWithAccountParameters; +import com.azure.resourcemanager.datalakestore.models.EncryptionConfig; +import com.azure.resourcemanager.datalakestore.models.EncryptionState; +import com.azure.resourcemanager.datalakestore.models.FirewallAllowAzureIpsState; +import com.azure.resourcemanager.datalakestore.models.FirewallState; +import com.azure.resourcemanager.datalakestore.models.TierType; +import com.azure.resourcemanager.datalakestore.models.TrustedIdProviderState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The CreateDataLakeStoreAccountProperties model. */ +@Fluent +public final class CreateDataLakeStoreAccountProperties { + /* + * The default owner group for all new folders and files created in the Data Lake Store account. + */ + @JsonProperty(value = "defaultGroup") + private String defaultGroup; + + /* + * The Key Vault encryption configuration. + */ + @JsonProperty(value = "encryptionConfig") + private EncryptionConfig encryptionConfig; + + /* + * The current state of encryption for this Data Lake Store account. + */ + @JsonProperty(value = "encryptionState") + private EncryptionState encryptionState; + + /* + * The list of firewall rules associated with this Data Lake Store account. + */ + @JsonProperty(value = "firewallRules") + private List firewallRules; + + /* + * The list of virtual network rules associated with this Data Lake Store account. + */ + @JsonProperty(value = "virtualNetworkRules") + private List virtualNetworkRules; + + /* + * The current state of the IP address firewall for this Data Lake Store account. + */ + @JsonProperty(value = "firewallState") + private FirewallState firewallState; + + /* + * The current state of allowing or disallowing IPs originating within Azure through the firewall. If the firewall + * is disabled, this is not enforced. + */ + @JsonProperty(value = "firewallAllowAzureIps") + private FirewallAllowAzureIpsState firewallAllowAzureIps; + + /* + * The list of trusted identity providers associated with this Data Lake Store account. + */ + @JsonProperty(value = "trustedIdProviders") + private List trustedIdProviders; + + /* + * The current state of the trusted identity provider feature for this Data Lake Store account. + */ + @JsonProperty(value = "trustedIdProviderState") + private TrustedIdProviderState trustedIdProviderState; + + /* + * The commitment tier to use for next month. + */ + @JsonProperty(value = "newTier") + private TierType newTier; + + /** Creates an instance of CreateDataLakeStoreAccountProperties class. */ + public CreateDataLakeStoreAccountProperties() { + } + + /** + * Get the defaultGroup property: The default owner group for all new folders and files created in the Data Lake + * Store account. + * + * @return the defaultGroup value. + */ + public String defaultGroup() { + return this.defaultGroup; + } + + /** + * Set the defaultGroup property: The default owner group for all new folders and files created in the Data Lake + * Store account. + * + * @param defaultGroup the defaultGroup value to set. + * @return the CreateDataLakeStoreAccountProperties object itself. + */ + public CreateDataLakeStoreAccountProperties withDefaultGroup(String defaultGroup) { + this.defaultGroup = defaultGroup; + return this; + } + + /** + * Get the encryptionConfig property: The Key Vault encryption configuration. + * + * @return the encryptionConfig value. + */ + public EncryptionConfig encryptionConfig() { + return this.encryptionConfig; + } + + /** + * Set the encryptionConfig property: The Key Vault encryption configuration. + * + * @param encryptionConfig the encryptionConfig value to set. + * @return the CreateDataLakeStoreAccountProperties object itself. + */ + public CreateDataLakeStoreAccountProperties withEncryptionConfig(EncryptionConfig encryptionConfig) { + this.encryptionConfig = encryptionConfig; + return this; + } + + /** + * Get the encryptionState property: The current state of encryption for this Data Lake Store account. + * + * @return the encryptionState value. + */ + public EncryptionState encryptionState() { + return this.encryptionState; + } + + /** + * Set the encryptionState property: The current state of encryption for this Data Lake Store account. + * + * @param encryptionState the encryptionState value to set. + * @return the CreateDataLakeStoreAccountProperties object itself. + */ + public CreateDataLakeStoreAccountProperties withEncryptionState(EncryptionState encryptionState) { + this.encryptionState = encryptionState; + return this; + } + + /** + * Get the firewallRules property: The list of firewall rules associated with this Data Lake Store account. + * + * @return the firewallRules value. + */ + public List firewallRules() { + return this.firewallRules; + } + + /** + * Set the firewallRules property: The list of firewall rules associated with this Data Lake Store account. + * + * @param firewallRules the firewallRules value to set. + * @return the CreateDataLakeStoreAccountProperties object itself. + */ + public CreateDataLakeStoreAccountProperties withFirewallRules( + List firewallRules) { + this.firewallRules = firewallRules; + return this; + } + + /** + * Get the virtualNetworkRules property: The list of virtual network rules associated with this Data Lake Store + * account. + * + * @return the virtualNetworkRules value. + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Set the virtualNetworkRules property: The list of virtual network rules associated with this Data Lake Store + * account. + * + * @param virtualNetworkRules the virtualNetworkRules value to set. + * @return the CreateDataLakeStoreAccountProperties object itself. + */ + public CreateDataLakeStoreAccountProperties withVirtualNetworkRules( + List virtualNetworkRules) { + this.virtualNetworkRules = virtualNetworkRules; + return this; + } + + /** + * Get the firewallState property: The current state of the IP address firewall for this Data Lake Store account. + * + * @return the firewallState value. + */ + public FirewallState firewallState() { + return this.firewallState; + } + + /** + * Set the firewallState property: The current state of the IP address firewall for this Data Lake Store account. + * + * @param firewallState the firewallState value to set. + * @return the CreateDataLakeStoreAccountProperties object itself. + */ + public CreateDataLakeStoreAccountProperties withFirewallState(FirewallState firewallState) { + this.firewallState = firewallState; + return this; + } + + /** + * Get the firewallAllowAzureIps property: The current state of allowing or disallowing IPs originating within Azure + * through the firewall. If the firewall is disabled, this is not enforced. + * + * @return the firewallAllowAzureIps value. + */ + public FirewallAllowAzureIpsState firewallAllowAzureIps() { + return this.firewallAllowAzureIps; + } + + /** + * Set the firewallAllowAzureIps property: The current state of allowing or disallowing IPs originating within Azure + * through the firewall. If the firewall is disabled, this is not enforced. + * + * @param firewallAllowAzureIps the firewallAllowAzureIps value to set. + * @return the CreateDataLakeStoreAccountProperties object itself. + */ + public CreateDataLakeStoreAccountProperties withFirewallAllowAzureIps( + FirewallAllowAzureIpsState firewallAllowAzureIps) { + this.firewallAllowAzureIps = firewallAllowAzureIps; + return this; + } + + /** + * Get the trustedIdProviders property: The list of trusted identity providers associated with this Data Lake Store + * account. + * + * @return the trustedIdProviders value. + */ + public List trustedIdProviders() { + return this.trustedIdProviders; + } + + /** + * Set the trustedIdProviders property: The list of trusted identity providers associated with this Data Lake Store + * account. + * + * @param trustedIdProviders the trustedIdProviders value to set. + * @return the CreateDataLakeStoreAccountProperties object itself. + */ + public CreateDataLakeStoreAccountProperties withTrustedIdProviders( + List trustedIdProviders) { + this.trustedIdProviders = trustedIdProviders; + return this; + } + + /** + * Get the trustedIdProviderState property: The current state of the trusted identity provider feature for this Data + * Lake Store account. + * + * @return the trustedIdProviderState value. + */ + public TrustedIdProviderState trustedIdProviderState() { + return this.trustedIdProviderState; + } + + /** + * Set the trustedIdProviderState property: The current state of the trusted identity provider feature for this Data + * Lake Store account. + * + * @param trustedIdProviderState the trustedIdProviderState value to set. + * @return the CreateDataLakeStoreAccountProperties object itself. + */ + public CreateDataLakeStoreAccountProperties withTrustedIdProviderState( + TrustedIdProviderState trustedIdProviderState) { + this.trustedIdProviderState = trustedIdProviderState; + return this; + } + + /** + * Get the newTier property: The commitment tier to use for next month. + * + * @return the newTier value. + */ + public TierType newTier() { + return this.newTier; + } + + /** + * Set the newTier property: The commitment tier to use for next month. + * + * @param newTier the newTier value to set. + * @return the CreateDataLakeStoreAccountProperties object itself. + */ + public CreateDataLakeStoreAccountProperties withNewTier(TierType newTier) { + this.newTier = newTier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (encryptionConfig() != null) { + encryptionConfig().validate(); + } + if (firewallRules() != null) { + firewallRules().forEach(e -> e.validate()); + } + if (virtualNetworkRules() != null) { + virtualNetworkRules().forEach(e -> e.validate()); + } + if (trustedIdProviders() != null) { + trustedIdProviders().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/CreateOrUpdateFirewallRuleProperties.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/CreateOrUpdateFirewallRuleProperties.java new file mode 100644 index 0000000000000..345d939d58543 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/CreateOrUpdateFirewallRuleProperties.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The firewall rule properties to use when creating a new firewall rule. */ +@Fluent +public final class CreateOrUpdateFirewallRuleProperties { + /* + * The start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + */ + @JsonProperty(value = "startIpAddress", required = true) + private String startIpAddress; + + /* + * The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + */ + @JsonProperty(value = "endIpAddress", required = true) + private String endIpAddress; + + /** Creates an instance of CreateOrUpdateFirewallRuleProperties class. */ + public CreateOrUpdateFirewallRuleProperties() { + } + + /** + * Get the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6. + * Start and End should be in the same protocol. + * + * @return the startIpAddress value. + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Set the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6. + * Start and End should be in the same protocol. + * + * @param startIpAddress the startIpAddress value to set. + * @return the CreateOrUpdateFirewallRuleProperties object itself. + */ + public CreateOrUpdateFirewallRuleProperties withStartIpAddress(String startIpAddress) { + this.startIpAddress = startIpAddress; + return this; + } + + /** + * Get the endIpAddress property: The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start + * and End should be in the same protocol. + * + * @return the endIpAddress value. + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Set the endIpAddress property: The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start + * and End should be in the same protocol. + * + * @param endIpAddress the endIpAddress value to set. + * @return the CreateOrUpdateFirewallRuleProperties object itself. + */ + public CreateOrUpdateFirewallRuleProperties withEndIpAddress(String endIpAddress) { + this.endIpAddress = endIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (startIpAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property startIpAddress in model CreateOrUpdateFirewallRuleProperties")); + } + if (endIpAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property endIpAddress in model CreateOrUpdateFirewallRuleProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CreateOrUpdateFirewallRuleProperties.class); +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/CreateOrUpdateTrustedIdProviderProperties.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/CreateOrUpdateTrustedIdProviderProperties.java new file mode 100644 index 0000000000000..664d4428defa6 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/CreateOrUpdateTrustedIdProviderProperties.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The trusted identity provider properties to use when creating a new trusted identity provider. */ +@Fluent +public final class CreateOrUpdateTrustedIdProviderProperties { + /* + * The URL of this trusted identity provider. + */ + @JsonProperty(value = "idProvider", required = true) + private String idProvider; + + /** Creates an instance of CreateOrUpdateTrustedIdProviderProperties class. */ + public CreateOrUpdateTrustedIdProviderProperties() { + } + + /** + * Get the idProvider property: The URL of this trusted identity provider. + * + * @return the idProvider value. + */ + public String idProvider() { + return this.idProvider; + } + + /** + * Set the idProvider property: The URL of this trusted identity provider. + * + * @param idProvider the idProvider value to set. + * @return the CreateOrUpdateTrustedIdProviderProperties object itself. + */ + public CreateOrUpdateTrustedIdProviderProperties withIdProvider(String idProvider) { + this.idProvider = idProvider; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (idProvider() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property idProvider in model CreateOrUpdateTrustedIdProviderProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CreateOrUpdateTrustedIdProviderProperties.class); +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/CreateOrUpdateVirtualNetworkRuleProperties.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/CreateOrUpdateVirtualNetworkRuleProperties.java new file mode 100644 index 0000000000000..c14497d6b4581 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/CreateOrUpdateVirtualNetworkRuleProperties.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The virtual network rule properties to use when creating a new virtual network rule. */ +@Fluent +public final class CreateOrUpdateVirtualNetworkRuleProperties { + /* + * The resource identifier for the subnet. + */ + @JsonProperty(value = "subnetId", required = true) + private String subnetId; + + /** Creates an instance of CreateOrUpdateVirtualNetworkRuleProperties class. */ + public CreateOrUpdateVirtualNetworkRuleProperties() { + } + + /** + * Get the subnetId property: The resource identifier for the subnet. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The resource identifier for the subnet. + * + * @param subnetId the subnetId value to set. + * @return the CreateOrUpdateVirtualNetworkRuleProperties object itself. + */ + public CreateOrUpdateVirtualNetworkRuleProperties withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnetId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property subnetId in model CreateOrUpdateVirtualNetworkRuleProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CreateOrUpdateVirtualNetworkRuleProperties.class); +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/DataLakeStoreAccountBasicInner.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/DataLakeStoreAccountBasicInner.java index 3447ce14f6b4d..45ed7efda62c8 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/DataLakeStoreAccountBasicInner.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/DataLakeStoreAccountBasicInner.java @@ -4,59 +4,50 @@ package com.azure.resourcemanager.datalakestore.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datalakestore.models.DataLakeStoreAccountState; import com.azure.resourcemanager.datalakestore.models.DataLakeStoreAccountStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.Map; import java.util.UUID; /** Basic Data Lake Store account information, returned on list calls. */ -@JsonFlatten -@Immutable -public class DataLakeStoreAccountBasicInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataLakeStoreAccountBasicInner.class); - - /* - * The unique identifier associated with this Data Lake Store account. - */ - @JsonProperty(value = "properties.accountId", access = JsonProperty.Access.WRITE_ONLY) - private UUID accountId; - +@Fluent +public final class DataLakeStoreAccountBasicInner extends Resource { /* - * The provisioning status of the Data Lake Store account. + * The basic Data Lake Store account properties. */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private DataLakeStoreAccountStatus provisioningState; + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private DataLakeStoreAccountPropertiesBasic innerProperties; - /* - * The state of the Data Lake Store account. - */ - @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) - private DataLakeStoreAccountState state; + /** Creates an instance of DataLakeStoreAccountBasicInner class. */ + public DataLakeStoreAccountBasicInner() { + } - /* - * The account creation time. + /** + * Get the innerProperties property: The basic Data Lake Store account properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime creationTime; + private DataLakeStoreAccountPropertiesBasic innerProperties() { + return this.innerProperties; + } - /* - * The account last modified time. - */ - @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastModifiedTime; + /** {@inheritDoc} */ + @Override + public DataLakeStoreAccountBasicInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * The full CName endpoint for this account. - */ - @JsonProperty(value = "properties.endpoint", access = JsonProperty.Access.WRITE_ONLY) - private String endpoint; + /** {@inheritDoc} */ + @Override + public DataLakeStoreAccountBasicInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the accountId property: The unique identifier associated with this Data Lake Store account. @@ -64,7 +55,7 @@ public class DataLakeStoreAccountBasicInner extends Resource { * @return the accountId value. */ public UUID accountId() { - return this.accountId; + return this.innerProperties() == null ? null : this.innerProperties().accountId(); } /** @@ -73,7 +64,7 @@ public UUID accountId() { * @return the provisioningState value. */ public DataLakeStoreAccountStatus provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -82,7 +73,7 @@ public DataLakeStoreAccountStatus provisioningState() { * @return the state value. */ public DataLakeStoreAccountState state() { - return this.state; + return this.innerProperties() == null ? null : this.innerProperties().state(); } /** @@ -91,7 +82,7 @@ public DataLakeStoreAccountState state() { * @return the creationTime value. */ public OffsetDateTime creationTime() { - return this.creationTime; + return this.innerProperties() == null ? null : this.innerProperties().creationTime(); } /** @@ -100,7 +91,7 @@ public OffsetDateTime creationTime() { * @return the lastModifiedTime value. */ public OffsetDateTime lastModifiedTime() { - return this.lastModifiedTime; + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime(); } /** @@ -109,21 +100,7 @@ public OffsetDateTime lastModifiedTime() { * @return the endpoint value. */ public String endpoint() { - return this.endpoint; - } - - /** {@inheritDoc} */ - @Override - public DataLakeStoreAccountBasicInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public DataLakeStoreAccountBasicInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().endpoint(); } /** @@ -132,5 +109,8 @@ public DataLakeStoreAccountBasicInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/DataLakeStoreAccountInner.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/DataLakeStoreAccountInner.java index 9ba1a9868f203..b0a07815e820d 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/DataLakeStoreAccountInner.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/DataLakeStoreAccountInner.java @@ -4,10 +4,8 @@ package com.azure.resourcemanager.datalakestore.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datalakestore.models.DataLakeStoreAccountState; import com.azure.resourcemanager.datalakestore.models.DataLakeStoreAccountStatus; import com.azure.resourcemanager.datalakestore.models.EncryptionConfig; @@ -18,7 +16,6 @@ import com.azure.resourcemanager.datalakestore.models.FirewallState; import com.azure.resourcemanager.datalakestore.models.TierType; import com.azure.resourcemanager.datalakestore.models.TrustedIdProviderState; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.List; @@ -26,11 +23,8 @@ import java.util.UUID; /** Data Lake Store account information. */ -@JsonFlatten -@Immutable -public class DataLakeStoreAccountInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataLakeStoreAccountInner.class); - +@Fluent +public final class DataLakeStoreAccountInner extends Resource { /* * The Key Vault encryption identity, if any. */ @@ -38,120 +32,14 @@ public class DataLakeStoreAccountInner extends Resource { private EncryptionIdentity identity; /* - * The unique identifier associated with this Data Lake Store account. - */ - @JsonProperty(value = "properties.accountId", access = JsonProperty.Access.WRITE_ONLY) - private UUID accountId; - - /* - * The provisioning status of the Data Lake Store account. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private DataLakeStoreAccountStatus provisioningState; - - /* - * The state of the Data Lake Store account. - */ - @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) - private DataLakeStoreAccountState state; - - /* - * The account creation time. - */ - @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime creationTime; - - /* - * The account last modified time. - */ - @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastModifiedTime; - - /* - * The full CName endpoint for this account. - */ - @JsonProperty(value = "properties.endpoint", access = JsonProperty.Access.WRITE_ONLY) - private String endpoint; - - /* - * The default owner group for all new folders and files created in the - * Data Lake Store account. - */ - @JsonProperty(value = "properties.defaultGroup", access = JsonProperty.Access.WRITE_ONLY) - private String defaultGroup; - - /* - * The Key Vault encryption configuration. - */ - @JsonProperty(value = "properties.encryptionConfig", access = JsonProperty.Access.WRITE_ONLY) - private EncryptionConfig encryptionConfig; - - /* - * The current state of encryption for this Data Lake Store account. - */ - @JsonProperty(value = "properties.encryptionState", access = JsonProperty.Access.WRITE_ONLY) - private EncryptionState encryptionState; - - /* - * The current state of encryption provisioning for this Data Lake Store - * account. - */ - @JsonProperty(value = "properties.encryptionProvisioningState", access = JsonProperty.Access.WRITE_ONLY) - private EncryptionProvisioningState encryptionProvisioningState; - - /* - * The list of firewall rules associated with this Data Lake Store account. - */ - @JsonProperty(value = "properties.firewallRules", access = JsonProperty.Access.WRITE_ONLY) - private List firewallRules; - - /* - * The list of virtual network rules associated with this Data Lake Store - * account. - */ - @JsonProperty(value = "properties.virtualNetworkRules", access = JsonProperty.Access.WRITE_ONLY) - private List virtualNetworkRules; - - /* - * The current state of the IP address firewall for this Data Lake Store - * account. - */ - @JsonProperty(value = "properties.firewallState", access = JsonProperty.Access.WRITE_ONLY) - private FirewallState firewallState; - - /* - * The current state of allowing or disallowing IPs originating within - * Azure through the firewall. If the firewall is disabled, this is not - * enforced. - */ - @JsonProperty(value = "properties.firewallAllowAzureIps", access = JsonProperty.Access.WRITE_ONLY) - private FirewallAllowAzureIpsState firewallAllowAzureIps; - - /* - * The list of trusted identity providers associated with this Data Lake - * Store account. + * The Data Lake Store account properties. */ - @JsonProperty(value = "properties.trustedIdProviders", access = JsonProperty.Access.WRITE_ONLY) - private List trustedIdProviders; + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private DataLakeStoreAccountProperties innerProperties; - /* - * The current state of the trusted identity provider feature for this Data - * Lake Store account. - */ - @JsonProperty(value = "properties.trustedIdProviderState", access = JsonProperty.Access.WRITE_ONLY) - private TrustedIdProviderState trustedIdProviderState; - - /* - * The commitment tier to use for next month. - */ - @JsonProperty(value = "properties.newTier", access = JsonProperty.Access.WRITE_ONLY) - private TierType newTier; - - /* - * The commitment tier in use for the current month. - */ - @JsonProperty(value = "properties.currentTier", access = JsonProperty.Access.WRITE_ONLY) - private TierType currentTier; + /** Creates an instance of DataLakeStoreAccountInner class. */ + public DataLakeStoreAccountInner() { + } /** * Get the identity property: The Key Vault encryption identity, if any. @@ -163,57 +51,26 @@ public EncryptionIdentity identity() { } /** - * Get the accountId property: The unique identifier associated with this Data Lake Store account. + * Get the innerProperties property: The Data Lake Store account properties. * - * @return the accountId value. + * @return the innerProperties value. */ - public UUID accountId() { - return this.accountId; + private DataLakeStoreAccountProperties innerProperties() { + return this.innerProperties; } - /** - * Get the provisioningState property: The provisioning status of the Data Lake Store account. - * - * @return the provisioningState value. - */ - public DataLakeStoreAccountStatus provisioningState() { - return this.provisioningState; - } - - /** - * Get the state property: The state of the Data Lake Store account. - * - * @return the state value. - */ - public DataLakeStoreAccountState state() { - return this.state; - } - - /** - * Get the creationTime property: The account creation time. - * - * @return the creationTime value. - */ - public OffsetDateTime creationTime() { - return this.creationTime; - } - - /** - * Get the lastModifiedTime property: The account last modified time. - * - * @return the lastModifiedTime value. - */ - public OffsetDateTime lastModifiedTime() { - return this.lastModifiedTime; + /** {@inheritDoc} */ + @Override + public DataLakeStoreAccountInner withLocation(String location) { + super.withLocation(location); + return this; } - /** - * Get the endpoint property: The full CName endpoint for this account. - * - * @return the endpoint value. - */ - public String endpoint() { - return this.endpoint; + /** {@inheritDoc} */ + @Override + public DataLakeStoreAccountInner withTags(Map tags) { + super.withTags(tags); + return this; } /** @@ -223,7 +80,7 @@ public String endpoint() { * @return the defaultGroup value. */ public String defaultGroup() { - return this.defaultGroup; + return this.innerProperties() == null ? null : this.innerProperties().defaultGroup(); } /** @@ -232,7 +89,7 @@ public String defaultGroup() { * @return the encryptionConfig value. */ public EncryptionConfig encryptionConfig() { - return this.encryptionConfig; + return this.innerProperties() == null ? null : this.innerProperties().encryptionConfig(); } /** @@ -241,7 +98,7 @@ public EncryptionConfig encryptionConfig() { * @return the encryptionState value. */ public EncryptionState encryptionState() { - return this.encryptionState; + return this.innerProperties() == null ? null : this.innerProperties().encryptionState(); } /** @@ -251,7 +108,7 @@ public EncryptionState encryptionState() { * @return the encryptionProvisioningState value. */ public EncryptionProvisioningState encryptionProvisioningState() { - return this.encryptionProvisioningState; + return this.innerProperties() == null ? null : this.innerProperties().encryptionProvisioningState(); } /** @@ -260,7 +117,7 @@ public EncryptionProvisioningState encryptionProvisioningState() { * @return the firewallRules value. */ public List firewallRules() { - return this.firewallRules; + return this.innerProperties() == null ? null : this.innerProperties().firewallRules(); } /** @@ -270,7 +127,7 @@ public List firewallRules() { * @return the virtualNetworkRules value. */ public List virtualNetworkRules() { - return this.virtualNetworkRules; + return this.innerProperties() == null ? null : this.innerProperties().virtualNetworkRules(); } /** @@ -279,7 +136,7 @@ public List virtualNetworkRules() { * @return the firewallState value. */ public FirewallState firewallState() { - return this.firewallState; + return this.innerProperties() == null ? null : this.innerProperties().firewallState(); } /** @@ -289,7 +146,7 @@ public FirewallState firewallState() { * @return the firewallAllowAzureIps value. */ public FirewallAllowAzureIpsState firewallAllowAzureIps() { - return this.firewallAllowAzureIps; + return this.innerProperties() == null ? null : this.innerProperties().firewallAllowAzureIps(); } /** @@ -299,7 +156,7 @@ public FirewallAllowAzureIpsState firewallAllowAzureIps() { * @return the trustedIdProviders value. */ public List trustedIdProviders() { - return this.trustedIdProviders; + return this.innerProperties() == null ? null : this.innerProperties().trustedIdProviders(); } /** @@ -309,7 +166,7 @@ public List trustedIdProviders() { * @return the trustedIdProviderState value. */ public TrustedIdProviderState trustedIdProviderState() { - return this.trustedIdProviderState; + return this.innerProperties() == null ? null : this.innerProperties().trustedIdProviderState(); } /** @@ -318,7 +175,7 @@ public TrustedIdProviderState trustedIdProviderState() { * @return the newTier value. */ public TierType newTier() { - return this.newTier; + return this.innerProperties() == null ? null : this.innerProperties().newTier(); } /** @@ -327,21 +184,61 @@ public TierType newTier() { * @return the currentTier value. */ public TierType currentTier() { - return this.currentTier; + return this.innerProperties() == null ? null : this.innerProperties().currentTier(); } - /** {@inheritDoc} */ - @Override - public DataLakeStoreAccountInner withLocation(String location) { - super.withLocation(location); - return this; + /** + * Get the accountId property: The unique identifier associated with this Data Lake Store account. + * + * @return the accountId value. + */ + public UUID accountId() { + return this.innerProperties() == null ? null : this.innerProperties().accountId(); } - /** {@inheritDoc} */ - @Override - public DataLakeStoreAccountInner withTags(Map tags) { - super.withTags(tags); - return this; + /** + * Get the provisioningState property: The provisioning status of the Data Lake Store account. + * + * @return the provisioningState value. + */ + public DataLakeStoreAccountStatus provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the state property: The state of the Data Lake Store account. + * + * @return the state value. + */ + public DataLakeStoreAccountState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Get the creationTime property: The account creation time. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.innerProperties() == null ? null : this.innerProperties().creationTime(); + } + + /** + * Get the lastModifiedTime property: The account last modified time. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime(); + } + + /** + * Get the endpoint property: The full CName endpoint for this account. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.innerProperties() == null ? null : this.innerProperties().endpoint(); } /** @@ -353,17 +250,8 @@ public void validate() { if (identity() != null) { identity().validate(); } - if (encryptionConfig() != null) { - encryptionConfig().validate(); - } - if (firewallRules() != null) { - firewallRules().forEach(e -> e.validate()); - } - if (virtualNetworkRules() != null) { - virtualNetworkRules().forEach(e -> e.validate()); - } - if (trustedIdProviders() != null) { - trustedIdProviders().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/DataLakeStoreAccountProperties.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/DataLakeStoreAccountProperties.java similarity index 87% rename from sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/DataLakeStoreAccountProperties.java rename to sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/DataLakeStoreAccountProperties.java index 301a87fa0d2ff..18bc19938d799 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/DataLakeStoreAccountProperties.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/DataLakeStoreAccountProperties.java @@ -2,25 +2,24 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.datalakestore.models; +package com.azure.resourcemanager.datalakestore.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.datalakestore.fluent.models.FirewallRuleInner; -import com.azure.resourcemanager.datalakestore.fluent.models.TrustedIdProviderInner; -import com.azure.resourcemanager.datalakestore.fluent.models.VirtualNetworkRuleInner; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.datalakestore.models.EncryptionConfig; +import com.azure.resourcemanager.datalakestore.models.EncryptionProvisioningState; +import com.azure.resourcemanager.datalakestore.models.EncryptionState; +import com.azure.resourcemanager.datalakestore.models.FirewallAllowAzureIpsState; +import com.azure.resourcemanager.datalakestore.models.FirewallState; +import com.azure.resourcemanager.datalakestore.models.TierType; +import com.azure.resourcemanager.datalakestore.models.TrustedIdProviderState; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Data Lake Store account properties information. */ @Immutable public final class DataLakeStoreAccountProperties extends DataLakeStoreAccountPropertiesBasic { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataLakeStoreAccountProperties.class); - /* - * The default owner group for all new folders and files created in the - * Data Lake Store account. + * The default owner group for all new folders and files created in the Data Lake Store account. */ @JsonProperty(value = "defaultGroup", access = JsonProperty.Access.WRITE_ONLY) private String defaultGroup; @@ -38,8 +37,7 @@ public final class DataLakeStoreAccountProperties extends DataLakeStoreAccountPr private EncryptionState encryptionState; /* - * The current state of encryption provisioning for this Data Lake Store - * account. + * The current state of encryption provisioning for this Data Lake Store account. */ @JsonProperty(value = "encryptionProvisioningState", access = JsonProperty.Access.WRITE_ONLY) private EncryptionProvisioningState encryptionProvisioningState; @@ -51,37 +49,32 @@ public final class DataLakeStoreAccountProperties extends DataLakeStoreAccountPr private List firewallRules; /* - * The list of virtual network rules associated with this Data Lake Store - * account. + * The list of virtual network rules associated with this Data Lake Store account. */ @JsonProperty(value = "virtualNetworkRules", access = JsonProperty.Access.WRITE_ONLY) private List virtualNetworkRules; /* - * The current state of the IP address firewall for this Data Lake Store - * account. + * The current state of the IP address firewall for this Data Lake Store account. */ @JsonProperty(value = "firewallState", access = JsonProperty.Access.WRITE_ONLY) private FirewallState firewallState; /* - * The current state of allowing or disallowing IPs originating within - * Azure through the firewall. If the firewall is disabled, this is not - * enforced. + * The current state of allowing or disallowing IPs originating within Azure through the firewall. If the firewall + * is disabled, this is not enforced. */ @JsonProperty(value = "firewallAllowAzureIps", access = JsonProperty.Access.WRITE_ONLY) private FirewallAllowAzureIpsState firewallAllowAzureIps; /* - * The list of trusted identity providers associated with this Data Lake - * Store account. + * The list of trusted identity providers associated with this Data Lake Store account. */ @JsonProperty(value = "trustedIdProviders", access = JsonProperty.Access.WRITE_ONLY) private List trustedIdProviders; /* - * The current state of the trusted identity provider feature for this Data - * Lake Store account. + * The current state of the trusted identity provider feature for this Data Lake Store account. */ @JsonProperty(value = "trustedIdProviderState", access = JsonProperty.Access.WRITE_ONLY) private TrustedIdProviderState trustedIdProviderState; @@ -98,6 +91,10 @@ public final class DataLakeStoreAccountProperties extends DataLakeStoreAccountPr @JsonProperty(value = "currentTier", access = JsonProperty.Access.WRITE_ONLY) private TierType currentTier; + /** Creates an instance of DataLakeStoreAccountProperties class. */ + public DataLakeStoreAccountProperties() { + } + /** * Get the defaultGroup property: The default owner group for all new folders and files created in the Data Lake * Store account. diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/DataLakeStoreAccountPropertiesBasic.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/DataLakeStoreAccountPropertiesBasic.java similarity index 89% rename from sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/DataLakeStoreAccountPropertiesBasic.java rename to sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/DataLakeStoreAccountPropertiesBasic.java index 99aa551f14347..590eed8c94948 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/DataLakeStoreAccountPropertiesBasic.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/DataLakeStoreAccountPropertiesBasic.java @@ -2,11 +2,11 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.datalakestore.models; +package com.azure.resourcemanager.datalakestore.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.datalakestore.models.DataLakeStoreAccountState; +import com.azure.resourcemanager.datalakestore.models.DataLakeStoreAccountStatus; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.UUID; @@ -14,8 +14,6 @@ /** The basic account specific properties that are associated with an underlying Data Lake Store account. */ @Immutable public class DataLakeStoreAccountPropertiesBasic { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataLakeStoreAccountPropertiesBasic.class); - /* * The unique identifier associated with this Data Lake Store account. */ @@ -52,6 +50,10 @@ public class DataLakeStoreAccountPropertiesBasic { @JsonProperty(value = "endpoint", access = JsonProperty.Access.WRITE_ONLY) private String endpoint; + /** Creates an instance of DataLakeStoreAccountPropertiesBasic class. */ + public DataLakeStoreAccountPropertiesBasic() { + } + /** * Get the accountId property: The unique identifier associated with this Data Lake Store account. * diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/FirewallRuleInner.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/FirewallRuleInner.java index 4b891317fd4c5..54ee522630059 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/FirewallRuleInner.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/FirewallRuleInner.java @@ -4,32 +4,18 @@ package com.azure.resourcemanager.datalakestore.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Data Lake Store firewall rule information. */ -@JsonFlatten -@Immutable -public class FirewallRuleInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallRuleInner.class); - +@Fluent +public final class FirewallRuleInner extends SubResource { /* - * The start IP address for the firewall rule. This can be either ipv4 or - * ipv6. Start and End should be in the same protocol. + * The firewall rule properties. */ - @JsonProperty(value = "properties.startIpAddress", access = JsonProperty.Access.WRITE_ONLY) - private String startIpAddress; - - /* - * The end IP address for the firewall rule. This can be either ipv4 or - * ipv6. Start and End should be in the same protocol. - */ - @JsonProperty(value = "properties.endIpAddress", access = JsonProperty.Access.WRITE_ONLY) - private String endIpAddress; + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private FirewallRuleProperties innerProperties; /* * The resource name. @@ -43,24 +29,17 @@ public class FirewallRuleInner extends SubResource { @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; - /** - * Get the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6. - * Start and End should be in the same protocol. - * - * @return the startIpAddress value. - */ - public String startIpAddress() { - return this.startIpAddress; + /** Creates an instance of FirewallRuleInner class. */ + public FirewallRuleInner() { } /** - * Get the endIpAddress property: The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start - * and End should be in the same protocol. + * Get the innerProperties property: The firewall rule properties. * - * @return the endIpAddress value. + * @return the innerProperties value. */ - public String endIpAddress() { - return this.endIpAddress; + private FirewallRuleProperties innerProperties() { + return this.innerProperties; } /** @@ -88,11 +67,34 @@ public FirewallRuleInner withId(String id) { return this; } + /** + * Get the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6. + * Start and End should be in the same protocol. + * + * @return the startIpAddress value. + */ + public String startIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().startIpAddress(); + } + + /** + * Get the endIpAddress property: The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start + * and End should be in the same protocol. + * + * @return the endIpAddress value. + */ + public String endIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().endIpAddress(); + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/FirewallRuleProperties.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/FirewallRuleProperties.java new file mode 100644 index 0000000000000..9e93cba91c227 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/FirewallRuleProperties.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The firewall rule properties. */ +@Immutable +public final class FirewallRuleProperties { + /* + * The start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + */ + @JsonProperty(value = "startIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String startIpAddress; + + /* + * The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + */ + @JsonProperty(value = "endIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String endIpAddress; + + /** Creates an instance of FirewallRuleProperties class. */ + public FirewallRuleProperties() { + } + + /** + * Get the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6. + * Start and End should be in the same protocol. + * + * @return the startIpAddress value. + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Get the endIpAddress property: The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start + * and End should be in the same protocol. + * + * @return the endIpAddress value. + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/NameAvailabilityInformationInner.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/NameAvailabilityInformationInner.java index 1a3571bd27453..2cf59853d20cb 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/NameAvailabilityInformationInner.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/NameAvailabilityInformationInner.java @@ -5,36 +5,33 @@ package com.azure.resourcemanager.datalakestore.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Data Lake Store account name availability result information. */ @Immutable public final class NameAvailabilityInformationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NameAvailabilityInformationInner.class); - /* - * The Boolean value of true or false to indicate whether the Data Lake - * Store account name is available or not. + * The Boolean value of true or false to indicate whether the Data Lake Store account name is available or not. */ @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) private Boolean nameAvailable; /* - * The reason why the Data Lake Store account name is not available, if - * nameAvailable is false. + * The reason why the Data Lake Store account name is not available, if nameAvailable is false. */ @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) private String reason; /* - * The message describing why the Data Lake Store account name is not - * available, if nameAvailable is false. + * The message describing why the Data Lake Store account name is not available, if nameAvailable is false. */ @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) private String message; + /** Creates an instance of NameAvailabilityInformationInner class. */ + public NameAvailabilityInformationInner() { + } + /** * Get the nameAvailable property: The Boolean value of true or false to indicate whether the Data Lake Store * account name is available or not. diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/OperationListResultInner.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/OperationListResultInner.java index b7adb2293b132..0886a8483b433 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/OperationListResultInner.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/OperationListResultInner.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.datalakestore.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datalakestore.models.Operation; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The list of available operations for Data Lake Store. */ @Immutable public final class OperationListResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResultInner.class); - /* * The results of the list operation. */ @@ -28,6 +24,10 @@ public final class OperationListResultInner { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of OperationListResultInner class. */ + public OperationListResultInner() { + } + /** * Get the value property: The results of the list operation. * diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/TrustedIdProviderInner.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/TrustedIdProviderInner.java index 253bc3e4d28ed..79065bcd1a345 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/TrustedIdProviderInner.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/TrustedIdProviderInner.java @@ -4,24 +4,18 @@ package com.azure.resourcemanager.datalakestore.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Data Lake Store trusted identity provider information. */ -@JsonFlatten -@Immutable -public class TrustedIdProviderInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TrustedIdProviderInner.class); - +@Fluent +public final class TrustedIdProviderInner extends SubResource { /* - * The URL of this trusted identity provider. + * The trusted identity provider properties. */ - @JsonProperty(value = "properties.idProvider", access = JsonProperty.Access.WRITE_ONLY) - private String idProvider; + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private TrustedIdProviderProperties innerProperties; /* * The resource name. @@ -35,13 +29,17 @@ public class TrustedIdProviderInner extends SubResource { @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; + /** Creates an instance of TrustedIdProviderInner class. */ + public TrustedIdProviderInner() { + } + /** - * Get the idProvider property: The URL of this trusted identity provider. + * Get the innerProperties property: The trusted identity provider properties. * - * @return the idProvider value. + * @return the innerProperties value. */ - public String idProvider() { - return this.idProvider; + private TrustedIdProviderProperties innerProperties() { + return this.innerProperties; } /** @@ -69,11 +67,23 @@ public TrustedIdProviderInner withId(String id) { return this; } + /** + * Get the idProvider property: The URL of this trusted identity provider. + * + * @return the idProvider value. + */ + public String idProvider() { + return this.innerProperties() == null ? null : this.innerProperties().idProvider(); + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/TrustedIdProviderProperties.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/TrustedIdProviderProperties.java new file mode 100644 index 0000000000000..95821ac6ef2a9 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/TrustedIdProviderProperties.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The trusted identity provider properties. */ +@Immutable +public final class TrustedIdProviderProperties { + /* + * The URL of this trusted identity provider. + */ + @JsonProperty(value = "idProvider", access = JsonProperty.Access.WRITE_ONLY) + private String idProvider; + + /** Creates an instance of TrustedIdProviderProperties class. */ + public TrustedIdProviderProperties() { + } + + /** + * Get the idProvider property: The URL of this trusted identity provider. + * + * @return the idProvider value. + */ + public String idProvider() { + return this.idProvider; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/UpdateDataLakeStoreAccountProperties.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/UpdateDataLakeStoreAccountProperties.java new file mode 100644 index 0000000000000..f8434717ab4c9 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/UpdateDataLakeStoreAccountProperties.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.datalakestore.models.FirewallAllowAzureIpsState; +import com.azure.resourcemanager.datalakestore.models.FirewallState; +import com.azure.resourcemanager.datalakestore.models.TierType; +import com.azure.resourcemanager.datalakestore.models.TrustedIdProviderState; +import com.azure.resourcemanager.datalakestore.models.UpdateEncryptionConfig; +import com.azure.resourcemanager.datalakestore.models.UpdateFirewallRuleWithAccountParameters; +import com.azure.resourcemanager.datalakestore.models.UpdateTrustedIdProviderWithAccountParameters; +import com.azure.resourcemanager.datalakestore.models.UpdateVirtualNetworkRuleWithAccountParameters; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Data Lake Store account properties information to be updated. */ +@Fluent +public final class UpdateDataLakeStoreAccountProperties { + /* + * The default owner group for all new folders and files created in the Data Lake Store account. + */ + @JsonProperty(value = "defaultGroup") + private String defaultGroup; + + /* + * Used for rotation of user managed Key Vault keys. Can only be used to rotate a user managed encryption Key Vault + * key. + */ + @JsonProperty(value = "encryptionConfig") + private UpdateEncryptionConfig encryptionConfig; + + /* + * The list of firewall rules associated with this Data Lake Store account. + */ + @JsonProperty(value = "firewallRules") + private List firewallRules; + + /* + * The list of virtual network rules associated with this Data Lake Store account. + */ + @JsonProperty(value = "virtualNetworkRules") + private List virtualNetworkRules; + + /* + * The current state of the IP address firewall for this Data Lake Store account. Disabling the firewall does not + * remove existing rules, they will just be ignored until the firewall is re-enabled. + */ + @JsonProperty(value = "firewallState") + private FirewallState firewallState; + + /* + * The current state of allowing or disallowing IPs originating within Azure through the firewall. If the firewall + * is disabled, this is not enforced. + */ + @JsonProperty(value = "firewallAllowAzureIps") + private FirewallAllowAzureIpsState firewallAllowAzureIps; + + /* + * The list of trusted identity providers associated with this Data Lake Store account. + */ + @JsonProperty(value = "trustedIdProviders") + private List trustedIdProviders; + + /* + * The current state of the trusted identity provider feature for this Data Lake Store account. Disabling trusted + * identity provider functionality does not remove the providers, they will just be ignored until this feature is + * re-enabled. + */ + @JsonProperty(value = "trustedIdProviderState") + private TrustedIdProviderState trustedIdProviderState; + + /* + * The commitment tier to use for next month. + */ + @JsonProperty(value = "newTier") + private TierType newTier; + + /** Creates an instance of UpdateDataLakeStoreAccountProperties class. */ + public UpdateDataLakeStoreAccountProperties() { + } + + /** + * Get the defaultGroup property: The default owner group for all new folders and files created in the Data Lake + * Store account. + * + * @return the defaultGroup value. + */ + public String defaultGroup() { + return this.defaultGroup; + } + + /** + * Set the defaultGroup property: The default owner group for all new folders and files created in the Data Lake + * Store account. + * + * @param defaultGroup the defaultGroup value to set. + * @return the UpdateDataLakeStoreAccountProperties object itself. + */ + public UpdateDataLakeStoreAccountProperties withDefaultGroup(String defaultGroup) { + this.defaultGroup = defaultGroup; + return this; + } + + /** + * Get the encryptionConfig property: Used for rotation of user managed Key Vault keys. Can only be used to rotate a + * user managed encryption Key Vault key. + * + * @return the encryptionConfig value. + */ + public UpdateEncryptionConfig encryptionConfig() { + return this.encryptionConfig; + } + + /** + * Set the encryptionConfig property: Used for rotation of user managed Key Vault keys. Can only be used to rotate a + * user managed encryption Key Vault key. + * + * @param encryptionConfig the encryptionConfig value to set. + * @return the UpdateDataLakeStoreAccountProperties object itself. + */ + public UpdateDataLakeStoreAccountProperties withEncryptionConfig(UpdateEncryptionConfig encryptionConfig) { + this.encryptionConfig = encryptionConfig; + return this; + } + + /** + * Get the firewallRules property: The list of firewall rules associated with this Data Lake Store account. + * + * @return the firewallRules value. + */ + public List firewallRules() { + return this.firewallRules; + } + + /** + * Set the firewallRules property: The list of firewall rules associated with this Data Lake Store account. + * + * @param firewallRules the firewallRules value to set. + * @return the UpdateDataLakeStoreAccountProperties object itself. + */ + public UpdateDataLakeStoreAccountProperties withFirewallRules( + List firewallRules) { + this.firewallRules = firewallRules; + return this; + } + + /** + * Get the virtualNetworkRules property: The list of virtual network rules associated with this Data Lake Store + * account. + * + * @return the virtualNetworkRules value. + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Set the virtualNetworkRules property: The list of virtual network rules associated with this Data Lake Store + * account. + * + * @param virtualNetworkRules the virtualNetworkRules value to set. + * @return the UpdateDataLakeStoreAccountProperties object itself. + */ + public UpdateDataLakeStoreAccountProperties withVirtualNetworkRules( + List virtualNetworkRules) { + this.virtualNetworkRules = virtualNetworkRules; + return this; + } + + /** + * Get the firewallState property: The current state of the IP address firewall for this Data Lake Store account. + * Disabling the firewall does not remove existing rules, they will just be ignored until the firewall is + * re-enabled. + * + * @return the firewallState value. + */ + public FirewallState firewallState() { + return this.firewallState; + } + + /** + * Set the firewallState property: The current state of the IP address firewall for this Data Lake Store account. + * Disabling the firewall does not remove existing rules, they will just be ignored until the firewall is + * re-enabled. + * + * @param firewallState the firewallState value to set. + * @return the UpdateDataLakeStoreAccountProperties object itself. + */ + public UpdateDataLakeStoreAccountProperties withFirewallState(FirewallState firewallState) { + this.firewallState = firewallState; + return this; + } + + /** + * Get the firewallAllowAzureIps property: The current state of allowing or disallowing IPs originating within Azure + * through the firewall. If the firewall is disabled, this is not enforced. + * + * @return the firewallAllowAzureIps value. + */ + public FirewallAllowAzureIpsState firewallAllowAzureIps() { + return this.firewallAllowAzureIps; + } + + /** + * Set the firewallAllowAzureIps property: The current state of allowing or disallowing IPs originating within Azure + * through the firewall. If the firewall is disabled, this is not enforced. + * + * @param firewallAllowAzureIps the firewallAllowAzureIps value to set. + * @return the UpdateDataLakeStoreAccountProperties object itself. + */ + public UpdateDataLakeStoreAccountProperties withFirewallAllowAzureIps( + FirewallAllowAzureIpsState firewallAllowAzureIps) { + this.firewallAllowAzureIps = firewallAllowAzureIps; + return this; + } + + /** + * Get the trustedIdProviders property: The list of trusted identity providers associated with this Data Lake Store + * account. + * + * @return the trustedIdProviders value. + */ + public List trustedIdProviders() { + return this.trustedIdProviders; + } + + /** + * Set the trustedIdProviders property: The list of trusted identity providers associated with this Data Lake Store + * account. + * + * @param trustedIdProviders the trustedIdProviders value to set. + * @return the UpdateDataLakeStoreAccountProperties object itself. + */ + public UpdateDataLakeStoreAccountProperties withTrustedIdProviders( + List trustedIdProviders) { + this.trustedIdProviders = trustedIdProviders; + return this; + } + + /** + * Get the trustedIdProviderState property: The current state of the trusted identity provider feature for this Data + * Lake Store account. Disabling trusted identity provider functionality does not remove the providers, they will + * just be ignored until this feature is re-enabled. + * + * @return the trustedIdProviderState value. + */ + public TrustedIdProviderState trustedIdProviderState() { + return this.trustedIdProviderState; + } + + /** + * Set the trustedIdProviderState property: The current state of the trusted identity provider feature for this Data + * Lake Store account. Disabling trusted identity provider functionality does not remove the providers, they will + * just be ignored until this feature is re-enabled. + * + * @param trustedIdProviderState the trustedIdProviderState value to set. + * @return the UpdateDataLakeStoreAccountProperties object itself. + */ + public UpdateDataLakeStoreAccountProperties withTrustedIdProviderState( + TrustedIdProviderState trustedIdProviderState) { + this.trustedIdProviderState = trustedIdProviderState; + return this; + } + + /** + * Get the newTier property: The commitment tier to use for next month. + * + * @return the newTier value. + */ + public TierType newTier() { + return this.newTier; + } + + /** + * Set the newTier property: The commitment tier to use for next month. + * + * @param newTier the newTier value to set. + * @return the UpdateDataLakeStoreAccountProperties object itself. + */ + public UpdateDataLakeStoreAccountProperties withNewTier(TierType newTier) { + this.newTier = newTier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (encryptionConfig() != null) { + encryptionConfig().validate(); + } + if (firewallRules() != null) { + firewallRules().forEach(e -> e.validate()); + } + if (virtualNetworkRules() != null) { + virtualNetworkRules().forEach(e -> e.validate()); + } + if (trustedIdProviders() != null) { + trustedIdProviders().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/UpdateFirewallRuleProperties.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/UpdateFirewallRuleProperties.java new file mode 100644 index 0000000000000..f2cf0f740b88b --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/UpdateFirewallRuleProperties.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The firewall rule properties to use when updating a firewall rule. */ +@Fluent +public final class UpdateFirewallRuleProperties { + /* + * The start IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + */ + @JsonProperty(value = "startIpAddress") + private String startIpAddress; + + /* + * The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and End should be in the same + * protocol. + */ + @JsonProperty(value = "endIpAddress") + private String endIpAddress; + + /** Creates an instance of UpdateFirewallRuleProperties class. */ + public UpdateFirewallRuleProperties() { + } + + /** + * Get the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6. + * Start and End should be in the same protocol. + * + * @return the startIpAddress value. + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Set the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6. + * Start and End should be in the same protocol. + * + * @param startIpAddress the startIpAddress value to set. + * @return the UpdateFirewallRuleProperties object itself. + */ + public UpdateFirewallRuleProperties withStartIpAddress(String startIpAddress) { + this.startIpAddress = startIpAddress; + return this; + } + + /** + * Get the endIpAddress property: The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start + * and End should be in the same protocol. + * + * @return the endIpAddress value. + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Set the endIpAddress property: The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start + * and End should be in the same protocol. + * + * @param endIpAddress the endIpAddress value to set. + * @return the UpdateFirewallRuleProperties object itself. + */ + public UpdateFirewallRuleProperties withEndIpAddress(String endIpAddress) { + this.endIpAddress = endIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/UpdateTrustedIdProviderProperties.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/UpdateTrustedIdProviderProperties.java new file mode 100644 index 0000000000000..a4e12fa381711 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/UpdateTrustedIdProviderProperties.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The trusted identity provider properties to use when updating a trusted identity provider. */ +@Fluent +public final class UpdateTrustedIdProviderProperties { + /* + * The URL of this trusted identity provider. + */ + @JsonProperty(value = "idProvider") + private String idProvider; + + /** Creates an instance of UpdateTrustedIdProviderProperties class. */ + public UpdateTrustedIdProviderProperties() { + } + + /** + * Get the idProvider property: The URL of this trusted identity provider. + * + * @return the idProvider value. + */ + public String idProvider() { + return this.idProvider; + } + + /** + * Set the idProvider property: The URL of this trusted identity provider. + * + * @param idProvider the idProvider value to set. + * @return the UpdateTrustedIdProviderProperties object itself. + */ + public UpdateTrustedIdProviderProperties withIdProvider(String idProvider) { + this.idProvider = idProvider; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/UpdateVirtualNetworkRuleProperties.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/UpdateVirtualNetworkRuleProperties.java new file mode 100644 index 0000000000000..f65900c24aba6 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/UpdateVirtualNetworkRuleProperties.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The virtual network rule properties to use when updating a virtual network rule. */ +@Fluent +public final class UpdateVirtualNetworkRuleProperties { + /* + * The resource identifier for the subnet. + */ + @JsonProperty(value = "subnetId") + private String subnetId; + + /** Creates an instance of UpdateVirtualNetworkRuleProperties class. */ + public UpdateVirtualNetworkRuleProperties() { + } + + /** + * Get the subnetId property: The resource identifier for the subnet. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The resource identifier for the subnet. + * + * @param subnetId the subnetId value to set. + * @return the UpdateVirtualNetworkRuleProperties object itself. + */ + public UpdateVirtualNetworkRuleProperties withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/UsageInner.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/UsageInner.java index 90749ff8122d1..0e300dd3dcfc3 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/UsageInner.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/UsageInner.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.datalakestore.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datalakestore.models.UsageName; import com.azure.resourcemanager.datalakestore.models.UsageUnit; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Describes the Resource Usage. */ @Immutable public final class UsageInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageInner.class); - /* * Gets the unit of measurement. */ @@ -35,8 +31,7 @@ public final class UsageInner { private Integer currentValue; /* - * Gets the maximum count of the resources that can be allocated in the - * subscription. + * Gets the maximum count of the resources that can be allocated in the subscription. */ @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) private Integer limit; @@ -47,6 +42,10 @@ public final class UsageInner { @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private UsageName name; + /** Creates an instance of UsageInner class. */ + public UsageInner() { + } + /** * Get the unit property: Gets the unit of measurement. * diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/VirtualNetworkRuleInner.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/VirtualNetworkRuleInner.java index 31374c60a0d05..f23b4bd1c1ab6 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/VirtualNetworkRuleInner.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/VirtualNetworkRuleInner.java @@ -4,24 +4,18 @@ package com.azure.resourcemanager.datalakestore.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Data Lake Store virtual network rule information. */ -@JsonFlatten -@Immutable -public class VirtualNetworkRuleInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkRuleInner.class); - +@Fluent +public final class VirtualNetworkRuleInner extends SubResource { /* - * The resource identifier for the subnet. + * The virtual network rule properties. */ - @JsonProperty(value = "properties.subnetId", access = JsonProperty.Access.WRITE_ONLY) - private String subnetId; + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkRuleProperties innerProperties; /* * The resource name. @@ -35,13 +29,17 @@ public class VirtualNetworkRuleInner extends SubResource { @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; + /** Creates an instance of VirtualNetworkRuleInner class. */ + public VirtualNetworkRuleInner() { + } + /** - * Get the subnetId property: The resource identifier for the subnet. + * Get the innerProperties property: The virtual network rule properties. * - * @return the subnetId value. + * @return the innerProperties value. */ - public String subnetId() { - return this.subnetId; + private VirtualNetworkRuleProperties innerProperties() { + return this.innerProperties; } /** @@ -69,11 +67,23 @@ public VirtualNetworkRuleInner withId(String id) { return this; } + /** + * Get the subnetId property: The resource identifier for the subnet. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.innerProperties() == null ? null : this.innerProperties().subnetId(); + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/VirtualNetworkRuleProperties.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/VirtualNetworkRuleProperties.java new file mode 100644 index 0000000000000..aef045eedbfcc --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/fluent/models/VirtualNetworkRuleProperties.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The virtual network rule properties. */ +@Immutable +public final class VirtualNetworkRuleProperties { + /* + * The resource identifier for the subnet. + */ + @JsonProperty(value = "subnetId", access = JsonProperty.Access.WRITE_ONLY) + private String subnetId; + + /** Creates an instance of VirtualNetworkRuleProperties class. */ + public VirtualNetworkRuleProperties() { + } + + /** + * Get the subnetId property: The resource identifier for the subnet. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/AccountsClientImpl.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/AccountsClientImpl.java index 1a5e39235b141..ecf8125fb06dc 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/AccountsClientImpl.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/AccountsClientImpl.java @@ -31,7 +31,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.datalakestore.fluent.AccountsClient; @@ -48,8 +47,6 @@ /** An instance of this class provides access to all the operations defined in AccountsClient. */ public final class AccountsClientImpl implements AccountsClient { - private final ClientLogger logger = new ClientLogger(AccountsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final AccountsService service; @@ -72,7 +69,7 @@ public final class AccountsClientImpl implements AccountsClient { */ @Host("{$host}") @ServiceInterface(name = "DataLakeStoreAccount") - private interface AccountsService { + public interface AccountsService { @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DataLakeStore/accounts") @ExpectedResponses({200}) @@ -238,7 +235,8 @@ Mono> listByResourceGroupNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -302,7 +300,8 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -362,7 +361,7 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -378,7 +377,7 @@ private PagedFlux listAsync( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -411,7 +410,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -427,7 +426,7 @@ private PagedFlux listAsync( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -458,7 +457,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( @@ -484,7 +483,8 @@ public PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -560,7 +560,8 @@ private Mono> listByResourceGroupS * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -633,7 +634,7 @@ private Mono> listByResourceGroupS * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync( @@ -657,7 +658,7 @@ private PagedFlux listByResourceGroupAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -691,7 +692,7 @@ private PagedFlux listByResourceGroupAsync(Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync( @@ -718,7 +719,7 @@ private PagedFlux listByResourceGroupAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -751,7 +752,7 @@ public PagedIterable listByResourceGroup(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup( @@ -776,7 +777,7 @@ public PagedIterable listByResourceGroup( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account information. + * @return data Lake Store account information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( @@ -832,7 +833,7 @@ private Mono>> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account information. + * @return data Lake Store account information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( @@ -887,9 +888,9 @@ private Mono>> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account information. + * @return the {@link PollerFlux} for polling of data Lake Store account information. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DataLakeStoreAccountInner> beginCreateAsync( String resourceGroupName, String accountName, CreateDataLakeStoreAccountParameters parameters) { Mono>> mono = createWithResponseAsync(resourceGroupName, accountName, parameters); @@ -900,7 +901,7 @@ private PollerFlux, DataLakeStoreAccountIn this.client.getHttpPipeline(), DataLakeStoreAccountInner.class, DataLakeStoreAccountInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -913,9 +914,9 @@ private PollerFlux, DataLakeStoreAccountIn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account information. + * @return the {@link PollerFlux} for polling of data Lake Store account information. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DataLakeStoreAccountInner> beginCreateAsync( String resourceGroupName, String accountName, @@ -943,12 +944,12 @@ private PollerFlux, DataLakeStoreAccountIn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account information. + * @return the {@link SyncPoller} for polling of data Lake Store account information. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DataLakeStoreAccountInner> beginCreate( String resourceGroupName, String accountName, CreateDataLakeStoreAccountParameters parameters) { - return beginCreateAsync(resourceGroupName, accountName, parameters).getSyncPoller(); + return this.beginCreateAsync(resourceGroupName, accountName, parameters).getSyncPoller(); } /** @@ -961,15 +962,15 @@ public SyncPoller, DataLakeStoreAccountInn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account information. + * @return the {@link SyncPoller} for polling of data Lake Store account information. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DataLakeStoreAccountInner> beginCreate( String resourceGroupName, String accountName, CreateDataLakeStoreAccountParameters parameters, Context context) { - return beginCreateAsync(resourceGroupName, accountName, parameters, context).getSyncPoller(); + return this.beginCreateAsync(resourceGroupName, accountName, parameters, context).getSyncPoller(); } /** @@ -981,7 +982,7 @@ public SyncPoller, DataLakeStoreAccountInn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account information. + * @return data Lake Store account information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -1001,7 +1002,7 @@ private Mono createAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account information. + * @return data Lake Store account information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -1060,7 +1061,8 @@ public DataLakeStoreAccountInner create( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store account. + * @return the specified Data Lake Store account along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -1109,7 +1111,8 @@ private Mono> getByResourceGroupWithResponse * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store account. + * @return the specified Data Lake Store account along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -1154,19 +1157,12 @@ private Mono> getByResourceGroupWithResponse * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store account. + * @return the specified Data Lake Store account on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String accountName) { return getByResourceGroupWithResponseAsync(resourceGroupName, accountName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1174,14 +1170,16 @@ private Mono getByResourceGroupAsync(String resourceG * * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store account. + * @return the specified Data Lake Store account along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DataLakeStoreAccountInner getByResourceGroup(String resourceGroupName, String accountName) { - return getByResourceGroupAsync(resourceGroupName, accountName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, context).block(); } /** @@ -1189,16 +1187,14 @@ public DataLakeStoreAccountInner getByResourceGroup(String resourceGroupName, St * * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified Data Lake Store account. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String accountName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, context).block(); + public DataLakeStoreAccountInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); } /** @@ -1210,7 +1206,7 @@ public Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account information. + * @return data Lake Store account information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -1266,7 +1262,7 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account information. + * @return data Lake Store account information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -1321,9 +1317,9 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account information. + * @return the {@link PollerFlux} for polling of data Lake Store account information. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DataLakeStoreAccountInner> beginUpdateAsync( String resourceGroupName, String accountName, UpdateDataLakeStoreAccountParameters parameters) { Mono>> mono = updateWithResponseAsync(resourceGroupName, accountName, parameters); @@ -1334,7 +1330,7 @@ private PollerFlux, DataLakeStoreAccountIn this.client.getHttpPipeline(), DataLakeStoreAccountInner.class, DataLakeStoreAccountInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -1347,9 +1343,9 @@ private PollerFlux, DataLakeStoreAccountIn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account information. + * @return the {@link PollerFlux} for polling of data Lake Store account information. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DataLakeStoreAccountInner> beginUpdateAsync( String resourceGroupName, String accountName, @@ -1377,12 +1373,12 @@ private PollerFlux, DataLakeStoreAccountIn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account information. + * @return the {@link SyncPoller} for polling of data Lake Store account information. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DataLakeStoreAccountInner> beginUpdate( String resourceGroupName, String accountName, UpdateDataLakeStoreAccountParameters parameters) { - return beginUpdateAsync(resourceGroupName, accountName, parameters).getSyncPoller(); + return this.beginUpdateAsync(resourceGroupName, accountName, parameters).getSyncPoller(); } /** @@ -1395,15 +1391,15 @@ public SyncPoller, DataLakeStoreAccountInn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account information. + * @return the {@link SyncPoller} for polling of data Lake Store account information. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DataLakeStoreAccountInner> beginUpdate( String resourceGroupName, String accountName, UpdateDataLakeStoreAccountParameters parameters, Context context) { - return beginUpdateAsync(resourceGroupName, accountName, parameters, context).getSyncPoller(); + return this.beginUpdateAsync(resourceGroupName, accountName, parameters, context).getSyncPoller(); } /** @@ -1415,7 +1411,7 @@ public SyncPoller, DataLakeStoreAccountInn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account information. + * @return data Lake Store account information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1435,7 +1431,7 @@ private Mono updateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account information. + * @return data Lake Store account information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1494,7 +1490,7 @@ public DataLakeStoreAccountInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName) { @@ -1540,7 +1536,7 @@ private Mono>> deleteWithResponseAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1583,14 +1579,15 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1602,9 +1599,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String accountName, Context context) { context = this.client.mergeContext(context); @@ -1622,11 +1619,11 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName) { - return beginDeleteAsync(resourceGroupName, accountName).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, accountName).getSyncPoller(); } /** @@ -1638,12 +1635,12 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String accountName, Context context) { - return beginDeleteAsync(resourceGroupName, accountName, context).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, accountName, context).getSyncPoller(); } /** @@ -1654,7 +1651,7 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String accountName) { @@ -1670,7 +1667,7 @@ private Mono deleteAsync(String resourceGroupName, String accountName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String accountName, Context context) { @@ -1716,7 +1713,7 @@ public void delete(String resourceGroupName, String accountName, Context context * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> enableKeyVaultWithResponseAsync(String resourceGroupName, String accountName) { @@ -1762,7 +1759,7 @@ private Mono> enableKeyVaultWithResponseAsync(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> enableKeyVaultWithResponseAsync( @@ -1805,12 +1802,11 @@ private Mono> enableKeyVaultWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono enableKeyVaultAsync(String resourceGroupName, String accountName) { - return enableKeyVaultWithResponseAsync(resourceGroupName, accountName) - .flatMap((Response res) -> Mono.empty()); + return enableKeyVaultWithResponseAsync(resourceGroupName, accountName).flatMap(ignored -> Mono.empty()); } /** @@ -1818,13 +1814,15 @@ private Mono enableKeyVaultAsync(String resourceGroupName, String accountN * * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void enableKeyVault(String resourceGroupName, String accountName) { - enableKeyVaultAsync(resourceGroupName, accountName).block(); + public Response enableKeyVaultWithResponse(String resourceGroupName, String accountName, Context context) { + return enableKeyVaultWithResponseAsync(resourceGroupName, accountName, context).block(); } /** @@ -1832,15 +1830,13 @@ public void enableKeyVault(String resourceGroupName, String accountName) { * * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response enableKeyVaultWithResponse(String resourceGroupName, String accountName, Context context) { - return enableKeyVaultWithResponseAsync(resourceGroupName, accountName, context).block(); + public void enableKeyVault(String resourceGroupName, String accountName) { + enableKeyVaultWithResponse(resourceGroupName, accountName, Context.NONE); } /** @@ -1851,7 +1847,8 @@ public Response enableKeyVaultWithResponse(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account name availability result information. + * @return data Lake Store account name availability result information along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityWithResponseAsync( @@ -1901,7 +1898,8 @@ private Mono> checkNameAvailabilityWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account name availability result information. + * @return data Lake Store account name availability result information along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityWithResponseAsync( @@ -1947,20 +1945,13 @@ private Mono> checkNameAvailabilityWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account name availability result information. + * @return data Lake Store account name availability result information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono checkNameAvailabilityAsync( String location, CheckNameAvailabilityParameters parameters) { return checkNameAvailabilityWithResponseAsync(location, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1968,15 +1959,16 @@ private Mono checkNameAvailabilityAsync( * * @param location The resource location without whitespace. * @param parameters Parameters supplied to check the Data Lake Store account name availability. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account name availability result information. + * @return data Lake Store account name availability result information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public NameAvailabilityInformationInner checkNameAvailability( - String location, CheckNameAvailabilityParameters parameters) { - return checkNameAvailabilityAsync(location, parameters).block(); + public Response checkNameAvailabilityWithResponse( + String location, CheckNameAvailabilityParameters parameters, Context context) { + return checkNameAvailabilityWithResponseAsync(location, parameters, context).block(); } /** @@ -1984,26 +1976,27 @@ public NameAvailabilityInformationInner checkNameAvailability( * * @param location The resource location without whitespace. * @param parameters Parameters supplied to check the Data Lake Store account name availability. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data Lake Store account name availability result information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNameAvailabilityWithResponse( - String location, CheckNameAvailabilityParameters parameters, Context context) { - return checkNameAvailabilityWithResponseAsync(location, parameters, context).block(); + public NameAvailabilityInformationInner checkNameAvailability( + String location, CheckNameAvailabilityParameters parameters) { + return checkNameAvailabilityWithResponse(location, parameters, Context.NONE).getValue(); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -2034,12 +2027,14 @@ private Mono> listNextSinglePageAs /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync( @@ -2071,11 +2066,13 @@ private Mono> listNextSinglePageAs /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync( @@ -2108,12 +2105,14 @@ private Mono> listByResourceGroupN /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync( diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/AccountsImpl.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/AccountsImpl.java index 6c9993931326b..2079fa0a20585 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/AccountsImpl.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/AccountsImpl.java @@ -18,10 +18,9 @@ import com.azure.resourcemanager.datalakestore.models.DataLakeStoreAccount; import com.azure.resourcemanager.datalakestore.models.DataLakeStoreAccountBasic; import com.azure.resourcemanager.datalakestore.models.NameAvailabilityInformation; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class AccountsImpl implements Accounts { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AccountsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(AccountsImpl.class); private final AccountsClient innerClient; @@ -67,15 +66,6 @@ public PagedIterable listByResourceGroup( return Utils.mapPage(inner, inner1 -> new DataLakeStoreAccountBasicImpl(inner1, this.manager())); } - public DataLakeStoreAccount getByResourceGroup(String resourceGroupName, String accountName) { - DataLakeStoreAccountInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, accountName); - if (inner != null) { - return new DataLakeStoreAccountImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String accountName, Context context) { Response inner = @@ -91,6 +81,15 @@ public Response getByResourceGroupWithResponse( } } + public DataLakeStoreAccount getByResourceGroup(String resourceGroupName, String accountName) { + DataLakeStoreAccountInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, accountName); + if (inner != null) { + return new DataLakeStoreAccountImpl(inner, this.manager()); + } else { + return null; + } + } + public void deleteByResourceGroup(String resourceGroupName, String accountName) { this.serviceClient().delete(resourceGroupName, accountName); } @@ -99,22 +98,12 @@ public void delete(String resourceGroupName, String accountName, Context context this.serviceClient().delete(resourceGroupName, accountName, context); } - public void enableKeyVault(String resourceGroupName, String accountName) { - this.serviceClient().enableKeyVault(resourceGroupName, accountName); - } - public Response enableKeyVaultWithResponse(String resourceGroupName, String accountName, Context context) { return this.serviceClient().enableKeyVaultWithResponse(resourceGroupName, accountName, context); } - public NameAvailabilityInformation checkNameAvailability( - String location, CheckNameAvailabilityParameters parameters) { - NameAvailabilityInformationInner inner = this.serviceClient().checkNameAvailability(location, parameters); - if (inner != null) { - return new NameAvailabilityInformationImpl(inner, this.manager()); - } else { - return null; - } + public void enableKeyVault(String resourceGroupName, String accountName) { + this.serviceClient().enableKeyVault(resourceGroupName, accountName); } public Response checkNameAvailabilityWithResponse( @@ -132,10 +121,20 @@ public Response checkNameAvailabilityWithResponse( } } + public NameAvailabilityInformation checkNameAvailability( + String location, CheckNameAvailabilityParameters parameters) { + NameAvailabilityInformationInner inner = this.serviceClient().checkNameAvailability(location, parameters); + if (inner != null) { + return new NameAvailabilityInformationImpl(inner, this.manager()); + } else { + return null; + } + } + public DataLakeStoreAccount getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -143,7 +142,7 @@ public DataLakeStoreAccount getById(String id) { } String accountName = Utils.getValueFromIdByName(id, "accounts"); if (accountName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); @@ -154,7 +153,7 @@ public DataLakeStoreAccount getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -162,7 +161,7 @@ public Response getByIdWithResponse(String id, Context con } String accountName = Utils.getValueFromIdByName(id, "accounts"); if (accountName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); @@ -173,7 +172,7 @@ public Response getByIdWithResponse(String id, Context con public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -181,7 +180,7 @@ public void deleteById(String id) { } String accountName = Utils.getValueFromIdByName(id, "accounts"); if (accountName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); @@ -192,7 +191,7 @@ public void deleteById(String id) { public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -200,7 +199,7 @@ public void deleteByIdWithResponse(String id, Context context) { } String accountName = Utils.getValueFromIdByName(id, "accounts"); if (accountName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/DataLakeStoreAccountImpl.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/DataLakeStoreAccountImpl.java index 5eada13f294f4..2629bea8f5356 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/DataLakeStoreAccountImpl.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/DataLakeStoreAccountImpl.java @@ -76,30 +76,6 @@ public EncryptionIdentity identity() { return this.innerModel().identity(); } - public UUID accountId() { - return this.innerModel().accountId(); - } - - public DataLakeStoreAccountStatus provisioningState() { - return this.innerModel().provisioningState(); - } - - public DataLakeStoreAccountState state() { - return this.innerModel().state(); - } - - public OffsetDateTime creationTime() { - return this.innerModel().creationTime(); - } - - public OffsetDateTime lastModifiedTime() { - return this.innerModel().lastModifiedTime(); - } - - public String endpoint() { - return this.innerModel().endpoint(); - } - public String defaultGroup() { return this.innerModel().defaultGroup(); } @@ -178,6 +154,30 @@ public TierType currentTier() { return this.innerModel().currentTier(); } + public UUID accountId() { + return this.innerModel().accountId(); + } + + public DataLakeStoreAccountStatus provisioningState() { + return this.innerModel().provisioningState(); + } + + public DataLakeStoreAccountState state() { + return this.innerModel().state(); + } + + public OffsetDateTime creationTime() { + return this.innerModel().creationTime(); + } + + public OffsetDateTime lastModifiedTime() { + return this.innerModel().lastModifiedTime(); + } + + public String endpoint() { + return this.innerModel().endpoint(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -186,6 +186,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public DataLakeStoreAccountInner innerModel() { return this.innerObject; } @@ -284,14 +288,14 @@ public DataLakeStoreAccount refresh(Context context) { return this; } - public void enableKeyVault() { - serviceManager.accounts().enableKeyVault(resourceGroupName, accountName); - } - public Response enableKeyVaultWithResponse(Context context) { return serviceManager.accounts().enableKeyVaultWithResponse(resourceGroupName, accountName, context); } + public void enableKeyVault() { + serviceManager.accounts().enableKeyVault(resourceGroupName, accountName); + } + public DataLakeStoreAccountImpl withRegion(Region location) { this.createParameters.withLocation(location.toString()); return this; diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/DataLakeStoreAccountManagementClientBuilder.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/DataLakeStoreAccountManagementClientBuilder.java index 20de36a509e6c..cf88269184024 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/DataLakeStoreAccountManagementClientBuilder.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/DataLakeStoreAccountManagementClientBuilder.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.AzureEnvironment; @@ -19,9 +18,8 @@ @ServiceClientBuilder(serviceClients = {DataLakeStoreAccountManagementClientImpl.class}) public final class DataLakeStoreAccountManagementClientBuilder { /* - * Gets subscription credentials which uniquely identify Microsoft Azure - * subscription. The subscription ID forms part of the URI for every - * service call. + * Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. */ private String subscriptionId; @@ -70,34 +68,34 @@ public DataLakeStoreAccountManagementClientBuilder environment(AzureEnvironment } /* - * The default poll interval for long-running operation + * The HTTP pipeline to send requests through */ - private Duration defaultPollInterval; + private HttpPipeline pipeline; /** - * Sets The default poll interval for long-running operation. + * Sets The HTTP pipeline to send requests through. * - * @param defaultPollInterval the defaultPollInterval value. + * @param pipeline the pipeline value. * @return the DataLakeStoreAccountManagementClientBuilder. */ - public DataLakeStoreAccountManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; + public DataLakeStoreAccountManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; return this; } /* - * The HTTP pipeline to send requests through + * The default poll interval for long-running operation */ - private HttpPipeline pipeline; + private Duration defaultPollInterval; /** - * Sets The HTTP pipeline to send requests through. + * Sets The default poll interval for long-running operation. * - * @param pipeline the pipeline value. + * @param defaultPollInterval the defaultPollInterval value. * @return the DataLakeStoreAccountManagementClientBuilder. */ - public DataLakeStoreAccountManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + public DataLakeStoreAccountManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; return this; } @@ -123,27 +121,26 @@ public DataLakeStoreAccountManagementClientBuilder serializerAdapter(SerializerA * @return an instance of DataLakeStoreAccountManagementClientImpl. */ public DataLakeStoreAccountManagementClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); DataLakeStoreAccountManagementClientImpl client = new DataLakeStoreAccountManagementClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); return client; } } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/DataLakeStoreAccountManagementClientImpl.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/DataLakeStoreAccountManagementClientImpl.java index f28020eea0f68..57811af366858 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/DataLakeStoreAccountManagementClientImpl.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/DataLakeStoreAccountManagementClientImpl.java @@ -15,6 +15,7 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; @@ -34,15 +35,12 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.time.Duration; -import java.util.Map; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** Initializes a new instance of the DataLakeStoreAccountManagementClientImpl type. */ @ServiceClient(builder = DataLakeStoreAccountManagementClientBuilder.class) public final class DataLakeStoreAccountManagementClientImpl implements DataLakeStoreAccountManagementClient { - private final ClientLogger logger = new ClientLogger(DataLakeStoreAccountManagementClientImpl.class); - /** * Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms * part of the URI for every service call. @@ -239,10 +237,7 @@ public Context getContext() { * @return the merged context. */ public Context mergeContext(Context context) { - for (Map.Entry entry : this.getContext().getValues().entrySet()) { - context = context.addData(entry.getKey(), entry.getValue()); - } - return context; + return CoreUtils.mergeContexts(this.getContext(), context); } /** @@ -306,7 +301,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -365,4 +360,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(DataLakeStoreAccountManagementClientImpl.class); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/FirewallRuleImpl.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/FirewallRuleImpl.java index 5ee269949eb11..35c97576cc79c 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/FirewallRuleImpl.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/FirewallRuleImpl.java @@ -19,6 +19,14 @@ public String id() { return this.innerModel().id(); } + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + public String startIpAddress() { return this.innerModel().startIpAddress(); } @@ -27,12 +35,8 @@ public String endIpAddress() { return this.innerModel().endIpAddress(); } - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); + public String resourceGroupName() { + return resourceGroupName; } public FirewallRuleInner innerModel() { diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/FirewallRulesClientImpl.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/FirewallRulesClientImpl.java index e7ee0a1337cd1..e4623a1e90f2a 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/FirewallRulesClientImpl.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/FirewallRulesClientImpl.java @@ -29,7 +29,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datalakestore.fluent.FirewallRulesClient; import com.azure.resourcemanager.datalakestore.fluent.models.FirewallRuleInner; import com.azure.resourcemanager.datalakestore.models.CreateOrUpdateFirewallRuleParameters; @@ -39,8 +38,6 @@ /** An instance of this class provides access to all the operations defined in FirewallRulesClient. */ public final class FirewallRulesClientImpl implements FirewallRulesClient { - private final ClientLogger logger = new ClientLogger(FirewallRulesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final FirewallRulesService service; @@ -64,7 +61,7 @@ public final class FirewallRulesClientImpl implements FirewallRulesClient { */ @Host("{$host}") @ServiceInterface(name = "DataLakeStoreAccount") - private interface FirewallRulesService { + public interface FirewallRulesService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore" @@ -164,7 +161,8 @@ Mono> listByAccountNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store firewall rule list information. + * @return data Lake Store firewall rule list information along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByAccountSinglePageAsync( @@ -222,7 +220,8 @@ private Mono> listByAccountSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store firewall rule list information. + * @return data Lake Store firewall rule list information along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByAccountSinglePageAsync( @@ -276,7 +275,7 @@ private Mono> listByAccountSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store firewall rule list information. + * @return data Lake Store firewall rule list information as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByAccountAsync(String resourceGroupName, String accountName) { @@ -294,7 +293,7 @@ private PagedFlux listByAccountAsync(String resourceGroupName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store firewall rule list information. + * @return data Lake Store firewall rule list information as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByAccountAsync( @@ -312,7 +311,7 @@ private PagedFlux listByAccountAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store firewall rule list information. + * @return data Lake Store firewall rule list information as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByAccount(String resourceGroupName, String accountName) { @@ -328,7 +327,7 @@ public PagedIterable listByAccount(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store firewall rule list information. + * @return data Lake Store firewall rule list information as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByAccount( @@ -347,7 +346,8 @@ public PagedIterable listByAccount( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store firewall rule information. + * @return data Lake Store firewall rule information along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -413,7 +413,8 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store firewall rule information. + * @return data Lake Store firewall rule information along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -476,7 +477,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store firewall rule information. + * @return data Lake Store firewall rule information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -485,14 +486,7 @@ private Mono createOrUpdateAsync( String firewallRuleName, CreateOrUpdateFirewallRuleParameters parameters) { return createOrUpdateWithResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -503,18 +497,21 @@ private Mono createOrUpdateAsync( * @param accountName The name of the Data Lake Store account. * @param firewallRuleName The name of the firewall rule to create or update. * @param parameters Parameters supplied to create or update the firewall rule. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store firewall rule information. + * @return data Lake Store firewall rule information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public FirewallRuleInner createOrUpdate( + public Response createOrUpdateWithResponse( String resourceGroupName, String accountName, String firewallRuleName, - CreateOrUpdateFirewallRuleParameters parameters) { - return createOrUpdateAsync(resourceGroupName, accountName, firewallRuleName, parameters).block(); + CreateOrUpdateFirewallRuleParameters parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters, context) + .block(); } /** @@ -525,21 +522,19 @@ public FirewallRuleInner createOrUpdate( * @param accountName The name of the Data Lake Store account. * @param firewallRuleName The name of the firewall rule to create or update. * @param parameters Parameters supplied to create or update the firewall rule. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data Lake Store firewall rule information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( + public FirewallRuleInner createOrUpdate( String resourceGroupName, String accountName, String firewallRuleName, - CreateOrUpdateFirewallRuleParameters parameters, - Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters, context) - .block(); + CreateOrUpdateFirewallRuleParameters parameters) { + return createOrUpdateWithResponse(resourceGroupName, accountName, firewallRuleName, parameters, Context.NONE) + .getValue(); } /** @@ -551,7 +546,8 @@ public Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store firewall rule. + * @return the specified Data Lake Store firewall rule along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -606,7 +602,8 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store firewall rule. + * @return the specified Data Lake Store firewall rule along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -657,19 +654,12 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store firewall rule. + * @return the specified Data Lake Store firewall rule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String accountName, String firewallRuleName) { return getWithResponseAsync(resourceGroupName, accountName, firewallRuleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -678,14 +668,16 @@ private Mono getAsync(String resourceGroupName, String accoun * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param firewallRuleName The name of the firewall rule to retrieve. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store firewall rule. + * @return the specified Data Lake Store firewall rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public FirewallRuleInner get(String resourceGroupName, String accountName, String firewallRuleName) { - return getAsync(resourceGroupName, accountName, firewallRuleName).block(); + public Response getWithResponse( + String resourceGroupName, String accountName, String firewallRuleName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, firewallRuleName, context).block(); } /** @@ -694,16 +686,14 @@ public FirewallRuleInner get(String resourceGroupName, String accountName, Strin * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param firewallRuleName The name of the firewall rule to retrieve. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified Data Lake Store firewall rule. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String accountName, String firewallRuleName, Context context) { - return getWithResponseAsync(resourceGroupName, accountName, firewallRuleName, context).block(); + public FirewallRuleInner get(String resourceGroupName, String accountName, String firewallRuleName) { + return getWithResponse(resourceGroupName, accountName, firewallRuleName, Context.NONE).getValue(); } /** @@ -716,7 +706,8 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store firewall rule information. + * @return data Lake Store firewall rule information along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -779,7 +770,8 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store firewall rule information. + * @return data Lake Store firewall rule information along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -835,52 +827,16 @@ private Mono> updateWithResponseAsync( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param firewallRuleName The name of the firewall rule to update. - * @param parameters Parameters supplied to update the firewall rule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store firewall rule information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String accountName, - String firewallRuleName, - UpdateFirewallRuleParameters parameters) { - return updateWithResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the specified firewall rule. - * - * @param resourceGroupName The name of the Azure resource group. - * @param accountName The name of the Data Lake Store account. - * @param firewallRuleName The name of the firewall rule to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store firewall rule information. + * @return data Lake Store firewall rule information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String accountName, String firewallRuleName) { final UpdateFirewallRuleParameters parameters = null; return updateWithResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -889,15 +845,21 @@ private Mono updateAsync(String resourceGroupName, String acc * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param firewallRuleName The name of the firewall rule to update. + * @param parameters Parameters supplied to update the firewall rule. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store firewall rule information. + * @return data Lake Store firewall rule information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public FirewallRuleInner update(String resourceGroupName, String accountName, String firewallRuleName) { - final UpdateFirewallRuleParameters parameters = null; - return updateAsync(resourceGroupName, accountName, firewallRuleName, parameters).block(); + public Response updateWithResponse( + String resourceGroupName, + String accountName, + String firewallRuleName, + UpdateFirewallRuleParameters parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters, context).block(); } /** @@ -906,21 +868,16 @@ public FirewallRuleInner update(String resourceGroupName, String accountName, St * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param firewallRuleName The name of the firewall rule to update. - * @param parameters Parameters supplied to update the firewall rule. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data Lake Store firewall rule information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String accountName, - String firewallRuleName, - UpdateFirewallRuleParameters parameters, - Context context) { - return updateWithResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters, context).block(); + public FirewallRuleInner update(String resourceGroupName, String accountName, String firewallRuleName) { + final UpdateFirewallRuleParameters parameters = null; + return updateWithResponse(resourceGroupName, accountName, firewallRuleName, parameters, Context.NONE) + .getValue(); } /** @@ -932,7 +889,7 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -985,7 +942,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -1034,12 +991,12 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String accountName, String firewallRuleName) { return deleteWithResponseAsync(resourceGroupName, accountName, firewallRuleName) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** @@ -1048,13 +1005,16 @@ private Mono deleteAsync(String resourceGroupName, String accountName, Str * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param firewallRuleName The name of the firewall rule to delete. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String firewallRuleName) { - deleteAsync(resourceGroupName, accountName, firewallRuleName).block(); + public Response deleteWithResponse( + String resourceGroupName, String accountName, String firewallRuleName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, firewallRuleName, context).block(); } /** @@ -1063,26 +1023,25 @@ public void delete(String resourceGroupName, String accountName, String firewall * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param firewallRuleName The name of the firewall rule to delete. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String accountName, String firewallRuleName, Context context) { - return deleteWithResponseAsync(resourceGroupName, accountName, firewallRuleName, context).block(); + public void delete(String resourceGroupName, String accountName, String firewallRuleName) { + deleteWithResponse(resourceGroupName, accountName, firewallRuleName, Context.NONE); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store firewall rule list information. + * @return data Lake Store firewall rule list information along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByAccountNextSinglePageAsync(String nextLink) { @@ -1113,12 +1072,14 @@ private Mono> listByAccountNextSinglePageAsync( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store firewall rule list information. + * @return data Lake Store firewall rule list information along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByAccountNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/FirewallRulesImpl.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/FirewallRulesImpl.java index 8af34abd4cc42..5eac900985756 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/FirewallRulesImpl.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/FirewallRulesImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.datalakestore.fluent.models.FirewallRuleInner; import com.azure.resourcemanager.datalakestore.models.FirewallRule; import com.azure.resourcemanager.datalakestore.models.FirewallRules; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class FirewallRulesImpl implements FirewallRules { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallRulesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(FirewallRulesImpl.class); private final FirewallRulesClient innerClient; @@ -39,15 +38,6 @@ public PagedIterable listByAccount(String resourceGroupName, Strin return Utils.mapPage(inner, inner1 -> new FirewallRuleImpl(inner1, this.manager())); } - public FirewallRule get(String resourceGroupName, String accountName, String firewallRuleName) { - FirewallRuleInner inner = this.serviceClient().get(resourceGroupName, accountName, firewallRuleName); - if (inner != null) { - return new FirewallRuleImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( String resourceGroupName, String accountName, String firewallRuleName, Context context) { Response inner = @@ -63,8 +53,13 @@ public Response getWithResponse( } } - public void delete(String resourceGroupName, String accountName, String firewallRuleName) { - this.serviceClient().delete(resourceGroupName, accountName, firewallRuleName); + public FirewallRule get(String resourceGroupName, String accountName, String firewallRuleName) { + FirewallRuleInner inner = this.serviceClient().get(resourceGroupName, accountName, firewallRuleName); + if (inner != null) { + return new FirewallRuleImpl(inner, this.manager()); + } else { + return null; + } } public Response deleteWithResponse( @@ -72,10 +67,14 @@ public Response deleteWithResponse( return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, firewallRuleName, context); } + public void delete(String resourceGroupName, String accountName, String firewallRuleName) { + this.serviceClient().delete(resourceGroupName, accountName, firewallRuleName); + } + public FirewallRule getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -83,14 +82,14 @@ public FirewallRule getById(String id) { } String accountName = Utils.getValueFromIdByName(id, "accounts"); if (accountName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); } String firewallRuleName = Utils.getValueFromIdByName(id, "firewallRules"); if (firewallRuleName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id))); @@ -101,7 +100,7 @@ public FirewallRule getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -109,14 +108,14 @@ public Response getByIdWithResponse(String id, Context context) { } String accountName = Utils.getValueFromIdByName(id, "accounts"); if (accountName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); } String firewallRuleName = Utils.getValueFromIdByName(id, "firewallRules"); if (firewallRuleName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id))); @@ -127,7 +126,7 @@ public Response getByIdWithResponse(String id, Context context) { public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -135,25 +134,25 @@ public void deleteById(String id) { } String accountName = Utils.getValueFromIdByName(id, "accounts"); if (accountName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); } String firewallRuleName = Utils.getValueFromIdByName(id, "firewallRules"); if (firewallRuleName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id))); } - this.deleteWithResponse(resourceGroupName, accountName, firewallRuleName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, accountName, firewallRuleName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -161,14 +160,14 @@ public Response deleteByIdWithResponse(String id, Context context) { } String accountName = Utils.getValueFromIdByName(id, "accounts"); if (accountName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); } String firewallRuleName = Utils.getValueFromIdByName(id, "firewallRules"); if (firewallRuleName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id))); diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/LocationsClientImpl.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/LocationsClientImpl.java index 10b5c3e72a0ac..57299428cb91d 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/LocationsClientImpl.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/LocationsClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datalakestore.fluent.LocationsClient; import com.azure.resourcemanager.datalakestore.fluent.models.CapabilityInformationInner; import com.azure.resourcemanager.datalakestore.fluent.models.UsageInner; @@ -34,8 +33,6 @@ /** An instance of this class provides access to all the operations defined in LocationsClient. */ public final class LocationsClientImpl implements LocationsClient { - private final ClientLogger logger = new ClientLogger(LocationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final LocationsService service; @@ -59,7 +56,7 @@ public final class LocationsClientImpl implements LocationsClient { */ @Host("{$host}") @ServiceInterface(name = "DataLakeStoreAccount") - private interface LocationsService { + public interface LocationsService { @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DataLakeStore/locations/{location}/capability") @ExpectedResponses({200}) @@ -92,7 +89,8 @@ Mono> getUsage( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription-level properties and limits for Data Lake Store specified by resource location. + * @return subscription-level properties and limits for Data Lake Store specified by resource location along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getCapabilityWithResponseAsync(String location) { @@ -134,7 +132,8 @@ private Mono> getCapabilityWithResponseAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription-level properties and limits for Data Lake Store specified by resource location. + * @return subscription-level properties and limits for Data Lake Store specified by resource location along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getCapabilityWithResponseAsync( @@ -173,48 +172,42 @@ private Mono> getCapabilityWithResponseAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription-level properties and limits for Data Lake Store specified by resource location. + * @return subscription-level properties and limits for Data Lake Store specified by resource location on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getCapabilityAsync(String location) { - return getCapabilityWithResponseAsync(location) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return getCapabilityWithResponseAsync(location).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets subscription-level properties and limits for Data Lake Store specified by resource location. * * @param location The resource location without whitespace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription-level properties and limits for Data Lake Store specified by resource location. + * @return subscription-level properties and limits for Data Lake Store specified by resource location along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CapabilityInformationInner getCapability(String location) { - return getCapabilityAsync(location).block(); + public Response getCapabilityWithResponse(String location, Context context) { + return getCapabilityWithResponseAsync(location, context).block(); } /** * Gets subscription-level properties and limits for Data Lake Store specified by resource location. * * @param location The resource location without whitespace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return subscription-level properties and limits for Data Lake Store specified by resource location. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCapabilityWithResponse(String location, Context context) { - return getCapabilityWithResponseAsync(location, context).block(); + public CapabilityInformationInner getCapability(String location) { + return getCapabilityWithResponse(location, Context.NONE).getValue(); } /** @@ -224,7 +217,8 @@ public Response getCapabilityWithResponse(String loc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current usage count and the limit for the resources of the location under the subscription. + * @return the current usage count and the limit for the resources of the location under the subscription along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getUsageSinglePageAsync(String location) { @@ -270,7 +264,8 @@ private Mono> getUsageSinglePageAsync(String location) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current usage count and the limit for the resources of the location under the subscription. + * @return the current usage count and the limit for the resources of the location under the subscription along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getUsageSinglePageAsync(String location, Context context) { @@ -312,7 +307,8 @@ private Mono> getUsageSinglePageAsync(String location, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current usage count and the limit for the resources of the location under the subscription. + * @return the current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux getUsageAsync(String location) { @@ -327,7 +323,8 @@ private PagedFlux getUsageAsync(String location) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current usage count and the limit for the resources of the location under the subscription. + * @return the current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux getUsageAsync(String location, Context context) { @@ -341,7 +338,8 @@ private PagedFlux getUsageAsync(String location, Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current usage count and the limit for the resources of the location under the subscription. + * @return the current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable getUsage(String location) { @@ -356,7 +354,8 @@ public PagedIterable getUsage(String location) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current usage count and the limit for the resources of the location under the subscription. + * @return the current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable getUsage(String location, Context context) { diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/LocationsImpl.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/LocationsImpl.java index ed950c475e02f..a04f496712430 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/LocationsImpl.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/LocationsImpl.java @@ -15,10 +15,9 @@ import com.azure.resourcemanager.datalakestore.models.CapabilityInformation; import com.azure.resourcemanager.datalakestore.models.Locations; import com.azure.resourcemanager.datalakestore.models.Usage; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class LocationsImpl implements Locations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LocationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(LocationsImpl.class); private final LocationsClient innerClient; @@ -30,15 +29,6 @@ public LocationsImpl( this.serviceManager = serviceManager; } - public CapabilityInformation getCapability(String location) { - CapabilityInformationInner inner = this.serviceClient().getCapability(location); - if (inner != null) { - return new CapabilityInformationImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getCapabilityWithResponse(String location, Context context) { Response inner = this.serviceClient().getCapabilityWithResponse(location, context); if (inner != null) { @@ -52,6 +42,15 @@ public Response getCapabilityWithResponse(String location } } + public CapabilityInformation getCapability(String location) { + CapabilityInformationInner inner = this.serviceClient().getCapability(location); + if (inner != null) { + return new CapabilityInformationImpl(inner, this.manager()); + } else { + return null; + } + } + public PagedIterable getUsage(String location) { PagedIterable inner = this.serviceClient().getUsage(location); return Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/OperationsClientImpl.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/OperationsClientImpl.java index a741b8e67b71d..05c43b7eb2d58 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/OperationsClientImpl.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/OperationsClientImpl.java @@ -20,15 +20,12 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datalakestore.fluent.OperationsClient; import com.azure.resourcemanager.datalakestore.fluent.models.OperationListResultInner; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in OperationsClient. */ public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final OperationsService service; @@ -52,7 +49,7 @@ public final class OperationsClientImpl implements OperationsClient { */ @Host("{$host}") @ServiceInterface(name = "DataLakeStoreAccount") - private interface OperationsService { + public interface OperationsService { @Headers({"Content-Type: application/json"}) @Get("/providers/Microsoft.DataLakeStore/operations") @ExpectedResponses({200}) @@ -69,7 +66,8 @@ Mono> list( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available operations for Data Lake Store. + * @return the list of available operations for Data Lake Store along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync() { @@ -93,7 +91,8 @@ private Mono> listWithResponseAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available operations for Data Lake Store. + * @return the list of available operations for Data Lake Store along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync(Context context) { @@ -113,44 +112,36 @@ private Mono> listWithResponseAsync(Context c * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available operations for Data Lake Store. + * @return the list of available operations for Data Lake Store on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listAsync() { - return listWithResponseAsync() - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return listWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Lists all of the available Data Lake Store REST API operations. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available operations for Data Lake Store. + * @return the list of available operations for Data Lake Store along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationListResultInner list() { - return listAsync().block(); + public Response listWithResponse(Context context) { + return listWithResponseAsync(context).block(); } /** * Lists all of the available Data Lake Store REST API operations. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of available operations for Data Lake Store. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); + public OperationListResultInner list() { + return listWithResponse(Context.NONE).getValue(); } } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/OperationsImpl.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/OperationsImpl.java index fc1f54c8c2337..4ee121c63d3cc 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/OperationsImpl.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/OperationsImpl.java @@ -12,10 +12,9 @@ import com.azure.resourcemanager.datalakestore.fluent.models.OperationListResultInner; import com.azure.resourcemanager.datalakestore.models.OperationListResult; import com.azure.resourcemanager.datalakestore.models.Operations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class OperationsImpl implements Operations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); private final OperationsClient innerClient; @@ -27,15 +26,6 @@ public OperationsImpl( this.serviceManager = serviceManager; } - public OperationListResult list() { - OperationListResultInner inner = this.serviceClient().list(); - if (inner != null) { - return new OperationListResultImpl(inner, this.manager()); - } else { - return null; - } - } - public Response listWithResponse(Context context) { Response inner = this.serviceClient().listWithResponse(context); if (inner != null) { @@ -49,6 +39,15 @@ public Response listWithResponse(Context context) { } } + public OperationListResult list() { + OperationListResultInner inner = this.serviceClient().list(); + if (inner != null) { + return new OperationListResultImpl(inner, this.manager()); + } else { + return null; + } + } + private OperationsClient serviceClient() { return this.innerClient; } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/TrustedIdProviderImpl.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/TrustedIdProviderImpl.java index 8cc137ea75ac1..92efc1aa094e4 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/TrustedIdProviderImpl.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/TrustedIdProviderImpl.java @@ -20,10 +20,6 @@ public String id() { return this.innerModel().id(); } - public String idProvider() { - return this.innerModel().idProvider(); - } - public String name() { return this.innerModel().name(); } @@ -32,6 +28,14 @@ public String type() { return this.innerModel().type(); } + public String idProvider() { + return this.innerModel().idProvider(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + public TrustedIdProviderInner innerModel() { return this.innerObject; } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/TrustedIdProvidersClientImpl.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/TrustedIdProvidersClientImpl.java index 404f86fe7844f..0b6088bad3cd8 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/TrustedIdProvidersClientImpl.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/TrustedIdProvidersClientImpl.java @@ -29,7 +29,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datalakestore.fluent.TrustedIdProvidersClient; import com.azure.resourcemanager.datalakestore.fluent.models.TrustedIdProviderInner; import com.azure.resourcemanager.datalakestore.models.CreateOrUpdateTrustedIdProviderParameters; @@ -39,8 +38,6 @@ /** An instance of this class provides access to all the operations defined in TrustedIdProvidersClient. */ public final class TrustedIdProvidersClientImpl implements TrustedIdProvidersClient { - private final ClientLogger logger = new ClientLogger(TrustedIdProvidersClientImpl.class); - /** The proxy service used to perform REST calls. */ private final TrustedIdProvidersService service; @@ -64,7 +61,7 @@ public final class TrustedIdProvidersClientImpl implements TrustedIdProvidersCli */ @Host("{$host}") @ServiceInterface(name = "DataLakeStoreAccount") - private interface TrustedIdProvidersService { + public interface TrustedIdProvidersService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore" @@ -164,7 +161,8 @@ Mono> listByAccountNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store trusted identity provider list information. + * @return data Lake Store trusted identity provider list information along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByAccountSinglePageAsync( @@ -222,7 +220,8 @@ private Mono> listByAccountSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store trusted identity provider list information. + * @return data Lake Store trusted identity provider list information along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByAccountSinglePageAsync( @@ -276,7 +275,7 @@ private Mono> listByAccountSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store trusted identity provider list information. + * @return data Lake Store trusted identity provider list information as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByAccountAsync(String resourceGroupName, String accountName) { @@ -294,7 +293,7 @@ private PagedFlux listByAccountAsync(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store trusted identity provider list information. + * @return data Lake Store trusted identity provider list information as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByAccountAsync( @@ -312,7 +311,8 @@ private PagedFlux listByAccountAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store trusted identity provider list information. + * @return data Lake Store trusted identity provider list information as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByAccount(String resourceGroupName, String accountName) { @@ -328,7 +328,8 @@ public PagedIterable listByAccount(String resourceGroupN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store trusted identity provider list information. + * @return data Lake Store trusted identity provider list information as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByAccount( @@ -348,7 +349,8 @@ public PagedIterable listByAccount( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store trusted identity provider information. + * @return data Lake Store trusted identity provider information along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -415,7 +417,8 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store trusted identity provider information. + * @return data Lake Store trusted identity provider information along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -479,7 +482,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store trusted identity provider information. + * @return data Lake Store trusted identity provider information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -488,14 +491,7 @@ private Mono createOrUpdateAsync( String trustedIdProviderName, CreateOrUpdateTrustedIdProviderParameters parameters) { return createOrUpdateWithResponseAsync(resourceGroupName, accountName, trustedIdProviderName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -507,18 +503,22 @@ private Mono createOrUpdateAsync( * @param trustedIdProviderName The name of the trusted identity provider. This is used for differentiation of * providers in the account. * @param parameters Parameters supplied to create or replace the trusted identity provider. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store trusted identity provider information. + * @return data Lake Store trusted identity provider information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TrustedIdProviderInner createOrUpdate( + public Response createOrUpdateWithResponse( String resourceGroupName, String accountName, String trustedIdProviderName, - CreateOrUpdateTrustedIdProviderParameters parameters) { - return createOrUpdateAsync(resourceGroupName, accountName, trustedIdProviderName, parameters).block(); + CreateOrUpdateTrustedIdProviderParameters parameters, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, accountName, trustedIdProviderName, parameters, context) + .block(); } /** @@ -530,22 +530,20 @@ public TrustedIdProviderInner createOrUpdate( * @param trustedIdProviderName The name of the trusted identity provider. This is used for differentiation of * providers in the account. * @param parameters Parameters supplied to create or replace the trusted identity provider. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data Lake Store trusted identity provider information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( + public TrustedIdProviderInner createOrUpdate( String resourceGroupName, String accountName, String trustedIdProviderName, - CreateOrUpdateTrustedIdProviderParameters parameters, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, accountName, trustedIdProviderName, parameters, context) - .block(); + CreateOrUpdateTrustedIdProviderParameters parameters) { + return createOrUpdateWithResponse( + resourceGroupName, accountName, trustedIdProviderName, parameters, Context.NONE) + .getValue(); } /** @@ -557,7 +555,8 @@ public Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store trusted identity provider. + * @return the specified Data Lake Store trusted identity provider along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -612,7 +611,8 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store trusted identity provider. + * @return the specified Data Lake Store trusted identity provider along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -663,20 +663,13 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store trusted identity provider. + * @return the specified Data Lake Store trusted identity provider on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( String resourceGroupName, String accountName, String trustedIdProviderName) { return getWithResponseAsync(resourceGroupName, accountName, trustedIdProviderName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -685,14 +678,16 @@ private Mono getAsync( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param trustedIdProviderName The name of the trusted identity provider to retrieve. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store trusted identity provider. + * @return the specified Data Lake Store trusted identity provider along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TrustedIdProviderInner get(String resourceGroupName, String accountName, String trustedIdProviderName) { - return getAsync(resourceGroupName, accountName, trustedIdProviderName).block(); + public Response getWithResponse( + String resourceGroupName, String accountName, String trustedIdProviderName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, trustedIdProviderName, context).block(); } /** @@ -701,16 +696,14 @@ public TrustedIdProviderInner get(String resourceGroupName, String accountName, * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param trustedIdProviderName The name of the trusted identity provider to retrieve. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified Data Lake Store trusted identity provider. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String accountName, String trustedIdProviderName, Context context) { - return getWithResponseAsync(resourceGroupName, accountName, trustedIdProviderName, context).block(); + public TrustedIdProviderInner get(String resourceGroupName, String accountName, String trustedIdProviderName) { + return getWithResponse(resourceGroupName, accountName, trustedIdProviderName, Context.NONE).getValue(); } /** @@ -724,7 +717,8 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store trusted identity provider information. + * @return data Lake Store trusted identity provider information along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -788,7 +782,8 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store trusted identity provider information. + * @return data Lake Store trusted identity provider information along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -845,54 +840,17 @@ private Mono> updateWithResponseAsync( * @param accountName The name of the Data Lake Store account. * @param trustedIdProviderName The name of the trusted identity provider. This is used for differentiation of * providers in the account. - * @param parameters Parameters supplied to update the trusted identity provider. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store trusted identity provider information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String accountName, - String trustedIdProviderName, - UpdateTrustedIdProviderParameters parameters) { - return updateWithResponseAsync(resourceGroupName, accountName, trustedIdProviderName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates the specified trusted identity provider. - * - * @param resourceGroupName The name of the Azure resource group. - * @param accountName The name of the Data Lake Store account. - * @param trustedIdProviderName The name of the trusted identity provider. This is used for differentiation of - * providers in the account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store trusted identity provider information. + * @return data Lake Store trusted identity provider information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( String resourceGroupName, String accountName, String trustedIdProviderName) { final UpdateTrustedIdProviderParameters parameters = null; return updateWithResponseAsync(resourceGroupName, accountName, trustedIdProviderName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -902,15 +860,22 @@ private Mono updateAsync( * @param accountName The name of the Data Lake Store account. * @param trustedIdProviderName The name of the trusted identity provider. This is used for differentiation of * providers in the account. + * @param parameters Parameters supplied to update the trusted identity provider. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store trusted identity provider information. + * @return data Lake Store trusted identity provider information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TrustedIdProviderInner update(String resourceGroupName, String accountName, String trustedIdProviderName) { - final UpdateTrustedIdProviderParameters parameters = null; - return updateAsync(resourceGroupName, accountName, trustedIdProviderName, parameters).block(); + public Response updateWithResponse( + String resourceGroupName, + String accountName, + String trustedIdProviderName, + UpdateTrustedIdProviderParameters parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, trustedIdProviderName, parameters, context) + .block(); } /** @@ -920,22 +885,16 @@ public TrustedIdProviderInner update(String resourceGroupName, String accountNam * @param accountName The name of the Data Lake Store account. * @param trustedIdProviderName The name of the trusted identity provider. This is used for differentiation of * providers in the account. - * @param parameters Parameters supplied to update the trusted identity provider. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data Lake Store trusted identity provider information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String accountName, - String trustedIdProviderName, - UpdateTrustedIdProviderParameters parameters, - Context context) { - return updateWithResponseAsync(resourceGroupName, accountName, trustedIdProviderName, parameters, context) - .block(); + public TrustedIdProviderInner update(String resourceGroupName, String accountName, String trustedIdProviderName) { + final UpdateTrustedIdProviderParameters parameters = null; + return updateWithResponse(resourceGroupName, accountName, trustedIdProviderName, parameters, Context.NONE) + .getValue(); } /** @@ -947,7 +906,7 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -1000,7 +959,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -1049,12 +1008,12 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String accountName, String trustedIdProviderName) { return deleteWithResponseAsync(resourceGroupName, accountName, trustedIdProviderName) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** @@ -1063,13 +1022,16 @@ private Mono deleteAsync(String resourceGroupName, String accountName, Str * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param trustedIdProviderName The name of the trusted identity provider to delete. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String trustedIdProviderName) { - deleteAsync(resourceGroupName, accountName, trustedIdProviderName).block(); + public Response deleteWithResponse( + String resourceGroupName, String accountName, String trustedIdProviderName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, trustedIdProviderName, context).block(); } /** @@ -1078,26 +1040,25 @@ public void delete(String resourceGroupName, String accountName, String trustedI * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param trustedIdProviderName The name of the trusted identity provider to delete. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String accountName, String trustedIdProviderName, Context context) { - return deleteWithResponseAsync(resourceGroupName, accountName, trustedIdProviderName, context).block(); + public void delete(String resourceGroupName, String accountName, String trustedIdProviderName) { + deleteWithResponse(resourceGroupName, accountName, trustedIdProviderName, Context.NONE); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store trusted identity provider list information. + * @return data Lake Store trusted identity provider list information along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByAccountNextSinglePageAsync(String nextLink) { @@ -1128,12 +1089,14 @@ private Mono> listByAccountNextSinglePageA /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store trusted identity provider list information. + * @return data Lake Store trusted identity provider list information along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByAccountNextSinglePageAsync( diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/TrustedIdProvidersImpl.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/TrustedIdProvidersImpl.java index 8eeca37e5bee2..b02fa6a34f242 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/TrustedIdProvidersImpl.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/TrustedIdProvidersImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.datalakestore.fluent.models.TrustedIdProviderInner; import com.azure.resourcemanager.datalakestore.models.TrustedIdProvider; import com.azure.resourcemanager.datalakestore.models.TrustedIdProviders; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class TrustedIdProvidersImpl implements TrustedIdProviders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TrustedIdProvidersImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(TrustedIdProvidersImpl.class); private final TrustedIdProvidersClient innerClient; @@ -42,15 +41,6 @@ public PagedIterable listByAccount( return Utils.mapPage(inner, inner1 -> new TrustedIdProviderImpl(inner1, this.manager())); } - public TrustedIdProvider get(String resourceGroupName, String accountName, String trustedIdProviderName) { - TrustedIdProviderInner inner = this.serviceClient().get(resourceGroupName, accountName, trustedIdProviderName); - if (inner != null) { - return new TrustedIdProviderImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( String resourceGroupName, String accountName, String trustedIdProviderName, Context context) { Response inner = @@ -66,8 +56,13 @@ public Response getWithResponse( } } - public void delete(String resourceGroupName, String accountName, String trustedIdProviderName) { - this.serviceClient().delete(resourceGroupName, accountName, trustedIdProviderName); + public TrustedIdProvider get(String resourceGroupName, String accountName, String trustedIdProviderName) { + TrustedIdProviderInner inner = this.serviceClient().get(resourceGroupName, accountName, trustedIdProviderName); + if (inner != null) { + return new TrustedIdProviderImpl(inner, this.manager()); + } else { + return null; + } } public Response deleteWithResponse( @@ -75,10 +70,14 @@ public Response deleteWithResponse( return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, trustedIdProviderName, context); } + public void delete(String resourceGroupName, String accountName, String trustedIdProviderName) { + this.serviceClient().delete(resourceGroupName, accountName, trustedIdProviderName); + } + public TrustedIdProvider getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -86,14 +85,14 @@ public TrustedIdProvider getById(String id) { } String accountName = Utils.getValueFromIdByName(id, "accounts"); if (accountName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); } String trustedIdProviderName = Utils.getValueFromIdByName(id, "trustedIdProviders"); if (trustedIdProviderName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -106,7 +105,7 @@ public TrustedIdProvider getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -114,14 +113,14 @@ public Response getByIdWithResponse(String id, Context contex } String accountName = Utils.getValueFromIdByName(id, "accounts"); if (accountName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); } String trustedIdProviderName = Utils.getValueFromIdByName(id, "trustedIdProviders"); if (trustedIdProviderName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -134,7 +133,7 @@ public Response getByIdWithResponse(String id, Context contex public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -142,27 +141,27 @@ public void deleteById(String id) { } String accountName = Utils.getValueFromIdByName(id, "accounts"); if (accountName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); } String trustedIdProviderName = Utils.getValueFromIdByName(id, "trustedIdProviders"); if (trustedIdProviderName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format( "The resource ID '%s' is not valid. Missing path segment 'trustedIdProviders'.", id))); } - this.deleteWithResponse(resourceGroupName, accountName, trustedIdProviderName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, accountName, trustedIdProviderName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -170,14 +169,14 @@ public Response deleteByIdWithResponse(String id, Context context) { } String accountName = Utils.getValueFromIdByName(id, "accounts"); if (accountName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); } String trustedIdProviderName = Utils.getValueFromIdByName(id, "trustedIdProviders"); if (trustedIdProviderName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/VirtualNetworkRuleImpl.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/VirtualNetworkRuleImpl.java index cf10d8adb7ce2..c014481d9ec81 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/VirtualNetworkRuleImpl.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/VirtualNetworkRuleImpl.java @@ -20,10 +20,6 @@ public String id() { return this.innerModel().id(); } - public String subnetId() { - return this.innerModel().subnetId(); - } - public String name() { return this.innerModel().name(); } @@ -32,6 +28,14 @@ public String type() { return this.innerModel().type(); } + public String subnetId() { + return this.innerModel().subnetId(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + public VirtualNetworkRuleInner innerModel() { return this.innerObject; } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/VirtualNetworkRulesClientImpl.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/VirtualNetworkRulesClientImpl.java index 24769a947eb94..25b485662b510 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/VirtualNetworkRulesClientImpl.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/VirtualNetworkRulesClientImpl.java @@ -29,7 +29,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datalakestore.fluent.VirtualNetworkRulesClient; import com.azure.resourcemanager.datalakestore.fluent.models.VirtualNetworkRuleInner; import com.azure.resourcemanager.datalakestore.models.CreateOrUpdateVirtualNetworkRuleParameters; @@ -39,8 +38,6 @@ /** An instance of this class provides access to all the operations defined in VirtualNetworkRulesClient. */ public final class VirtualNetworkRulesClientImpl implements VirtualNetworkRulesClient { - private final ClientLogger logger = new ClientLogger(VirtualNetworkRulesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final VirtualNetworkRulesService service; @@ -64,7 +61,7 @@ public final class VirtualNetworkRulesClientImpl implements VirtualNetworkRulesC */ @Host("{$host}") @ServiceInterface(name = "DataLakeStoreAccount") - private interface VirtualNetworkRulesService { + public interface VirtualNetworkRulesService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeStore" @@ -164,7 +161,8 @@ Mono> listByAccountNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store virtual network rule list information. + * @return data Lake Store virtual network rule list information along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByAccountSinglePageAsync( @@ -222,7 +220,8 @@ private Mono> listByAccountSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store virtual network rule list information. + * @return data Lake Store virtual network rule list information along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByAccountSinglePageAsync( @@ -276,7 +275,7 @@ private Mono> listByAccountSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store virtual network rule list information. + * @return data Lake Store virtual network rule list information as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByAccountAsync(String resourceGroupName, String accountName) { @@ -294,7 +293,7 @@ private PagedFlux listByAccountAsync(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store virtual network rule list information. + * @return data Lake Store virtual network rule list information as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByAccountAsync( @@ -312,7 +311,7 @@ private PagedFlux listByAccountAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store virtual network rule list information. + * @return data Lake Store virtual network rule list information as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByAccount(String resourceGroupName, String accountName) { @@ -328,7 +327,7 @@ public PagedIterable listByAccount(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store virtual network rule list information. + * @return data Lake Store virtual network rule list information as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByAccount( @@ -347,7 +346,8 @@ public PagedIterable listByAccount( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store virtual network rule information. + * @return data Lake Store virtual network rule information along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -414,7 +414,8 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store virtual network rule information. + * @return data Lake Store virtual network rule information along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -478,7 +479,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store virtual network rule information. + * @return data Lake Store virtual network rule information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -487,14 +488,7 @@ private Mono createOrUpdateAsync( String virtualNetworkRuleName, CreateOrUpdateVirtualNetworkRuleParameters parameters) { return createOrUpdateWithResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -505,18 +499,22 @@ private Mono createOrUpdateAsync( * @param accountName The name of the Data Lake Store account. * @param virtualNetworkRuleName The name of the virtual network rule to create or update. * @param parameters Parameters supplied to create or update the virtual network rule. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store virtual network rule information. + * @return data Lake Store virtual network rule information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkRuleInner createOrUpdate( + public Response createOrUpdateWithResponse( String resourceGroupName, String accountName, String virtualNetworkRuleName, - CreateOrUpdateVirtualNetworkRuleParameters parameters) { - return createOrUpdateAsync(resourceGroupName, accountName, virtualNetworkRuleName, parameters).block(); + CreateOrUpdateVirtualNetworkRuleParameters parameters, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, accountName, virtualNetworkRuleName, parameters, context) + .block(); } /** @@ -527,22 +525,20 @@ public VirtualNetworkRuleInner createOrUpdate( * @param accountName The name of the Data Lake Store account. * @param virtualNetworkRuleName The name of the virtual network rule to create or update. * @param parameters Parameters supplied to create or update the virtual network rule. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data Lake Store virtual network rule information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( + public VirtualNetworkRuleInner createOrUpdate( String resourceGroupName, String accountName, String virtualNetworkRuleName, - CreateOrUpdateVirtualNetworkRuleParameters parameters, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, accountName, virtualNetworkRuleName, parameters, context) - .block(); + CreateOrUpdateVirtualNetworkRuleParameters parameters) { + return createOrUpdateWithResponse( + resourceGroupName, accountName, virtualNetworkRuleName, parameters, Context.NONE) + .getValue(); } /** @@ -554,7 +550,8 @@ public Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store virtual network rule. + * @return the specified Data Lake Store virtual network rule along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -610,7 +607,8 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store virtual network rule. + * @return the specified Data Lake Store virtual network rule along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -662,20 +660,13 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store virtual network rule. + * @return the specified Data Lake Store virtual network rule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( String resourceGroupName, String accountName, String virtualNetworkRuleName) { return getWithResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -684,14 +675,16 @@ private Mono getAsync( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param virtualNetworkRuleName The name of the virtual network rule to retrieve. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store virtual network rule. + * @return the specified Data Lake Store virtual network rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkRuleInner get(String resourceGroupName, String accountName, String virtualNetworkRuleName) { - return getAsync(resourceGroupName, accountName, virtualNetworkRuleName).block(); + public Response getWithResponse( + String resourceGroupName, String accountName, String virtualNetworkRuleName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName, context).block(); } /** @@ -700,16 +693,14 @@ public VirtualNetworkRuleInner get(String resourceGroupName, String accountName, * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param virtualNetworkRuleName The name of the virtual network rule to retrieve. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified Data Lake Store virtual network rule. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String accountName, String virtualNetworkRuleName, Context context) { - return getWithResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName, context).block(); + public VirtualNetworkRuleInner get(String resourceGroupName, String accountName, String virtualNetworkRuleName) { + return getWithResponse(resourceGroupName, accountName, virtualNetworkRuleName, Context.NONE).getValue(); } /** @@ -722,7 +713,8 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store virtual network rule information. + * @return data Lake Store virtual network rule information along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -786,7 +778,8 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store virtual network rule information. + * @return data Lake Store virtual network rule information along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -837,35 +830,6 @@ private Mono> updateWithResponseAsync( context); } - /** - * Updates the specified virtual network rule. - * - * @param resourceGroupName The name of the Azure resource group. - * @param accountName The name of the Data Lake Store account. - * @param virtualNetworkRuleName The name of the virtual network rule to update. - * @param parameters Parameters supplied to update the virtual network rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store virtual network rule information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String accountName, - String virtualNetworkRuleName, - UpdateVirtualNetworkRuleParameters parameters) { - return updateWithResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - /** * Updates the specified virtual network rule. * @@ -875,21 +839,14 @@ private Mono updateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store virtual network rule information. + * @return data Lake Store virtual network rule information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( String resourceGroupName, String accountName, String virtualNetworkRuleName) { final UpdateVirtualNetworkRuleParameters parameters = null; return updateWithResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -898,15 +855,22 @@ private Mono updateAsync( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param virtualNetworkRuleName The name of the virtual network rule to update. + * @param parameters Parameters supplied to update the virtual network rule. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store virtual network rule information. + * @return data Lake Store virtual network rule information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkRuleInner update(String resourceGroupName, String accountName, String virtualNetworkRuleName) { - final UpdateVirtualNetworkRuleParameters parameters = null; - return updateAsync(resourceGroupName, accountName, virtualNetworkRuleName, parameters).block(); + public Response updateWithResponse( + String resourceGroupName, + String accountName, + String virtualNetworkRuleName, + UpdateVirtualNetworkRuleParameters parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName, parameters, context) + .block(); } /** @@ -915,22 +879,16 @@ public VirtualNetworkRuleInner update(String resourceGroupName, String accountNa * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param virtualNetworkRuleName The name of the virtual network rule to update. - * @param parameters Parameters supplied to update the virtual network rule. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data Lake Store virtual network rule information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String accountName, - String virtualNetworkRuleName, - UpdateVirtualNetworkRuleParameters parameters, - Context context) { - return updateWithResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName, parameters, context) - .block(); + public VirtualNetworkRuleInner update(String resourceGroupName, String accountName, String virtualNetworkRuleName) { + final UpdateVirtualNetworkRuleParameters parameters = null; + return updateWithResponse(resourceGroupName, accountName, virtualNetworkRuleName, parameters, Context.NONE) + .getValue(); } /** @@ -942,7 +900,7 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -996,7 +954,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -1046,12 +1004,12 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String accountName, String virtualNetworkRuleName) { return deleteWithResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** @@ -1060,13 +1018,16 @@ private Mono deleteAsync(String resourceGroupName, String accountName, Str * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param virtualNetworkRuleName The name of the virtual network rule to delete. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String virtualNetworkRuleName) { - deleteAsync(resourceGroupName, accountName, virtualNetworkRuleName).block(); + public Response deleteWithResponse( + String resourceGroupName, String accountName, String virtualNetworkRuleName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName, context).block(); } /** @@ -1075,26 +1036,25 @@ public void delete(String resourceGroupName, String accountName, String virtualN * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param virtualNetworkRuleName The name of the virtual network rule to delete. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String accountName, String virtualNetworkRuleName, Context context) { - return deleteWithResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName, context).block(); + public void delete(String resourceGroupName, String accountName, String virtualNetworkRuleName) { + deleteWithResponse(resourceGroupName, accountName, virtualNetworkRuleName, Context.NONE); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store virtual network rule list information. + * @return data Lake Store virtual network rule list information along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByAccountNextSinglePageAsync(String nextLink) { @@ -1125,12 +1085,14 @@ private Mono> listByAccountNextSinglePage /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store virtual network rule list information. + * @return data Lake Store virtual network rule list information along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByAccountNextSinglePageAsync( diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/VirtualNetworkRulesImpl.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/VirtualNetworkRulesImpl.java index 2969566f0b37f..268b57e4862ef 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/VirtualNetworkRulesImpl.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/VirtualNetworkRulesImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.datalakestore.fluent.models.VirtualNetworkRuleInner; import com.azure.resourcemanager.datalakestore.models.VirtualNetworkRule; import com.azure.resourcemanager.datalakestore.models.VirtualNetworkRules; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class VirtualNetworkRulesImpl implements VirtualNetworkRules { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkRulesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkRulesImpl.class); private final VirtualNetworkRulesClient innerClient; @@ -42,16 +41,6 @@ public PagedIterable listByAccount( return Utils.mapPage(inner, inner1 -> new VirtualNetworkRuleImpl(inner1, this.manager())); } - public VirtualNetworkRule get(String resourceGroupName, String accountName, String virtualNetworkRuleName) { - VirtualNetworkRuleInner inner = - this.serviceClient().get(resourceGroupName, accountName, virtualNetworkRuleName); - if (inner != null) { - return new VirtualNetworkRuleImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( String resourceGroupName, String accountName, String virtualNetworkRuleName, Context context) { Response inner = @@ -67,8 +56,14 @@ public Response getWithResponse( } } - public void delete(String resourceGroupName, String accountName, String virtualNetworkRuleName) { - this.serviceClient().delete(resourceGroupName, accountName, virtualNetworkRuleName); + public VirtualNetworkRule get(String resourceGroupName, String accountName, String virtualNetworkRuleName) { + VirtualNetworkRuleInner inner = + this.serviceClient().get(resourceGroupName, accountName, virtualNetworkRuleName); + if (inner != null) { + return new VirtualNetworkRuleImpl(inner, this.manager()); + } else { + return null; + } } public Response deleteWithResponse( @@ -76,10 +71,14 @@ public Response deleteWithResponse( return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, virtualNetworkRuleName, context); } + public void delete(String resourceGroupName, String accountName, String virtualNetworkRuleName) { + this.serviceClient().delete(resourceGroupName, accountName, virtualNetworkRuleName); + } + public VirtualNetworkRule getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -87,14 +86,14 @@ public VirtualNetworkRule getById(String id) { } String accountName = Utils.getValueFromIdByName(id, "accounts"); if (accountName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); } String virtualNetworkRuleName = Utils.getValueFromIdByName(id, "virtualNetworkRules"); if (virtualNetworkRuleName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -107,7 +106,7 @@ public VirtualNetworkRule getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -115,14 +114,14 @@ public Response getByIdWithResponse(String id, Context conte } String accountName = Utils.getValueFromIdByName(id, "accounts"); if (accountName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); } String virtualNetworkRuleName = Utils.getValueFromIdByName(id, "virtualNetworkRules"); if (virtualNetworkRuleName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -135,7 +134,7 @@ public Response getByIdWithResponse(String id, Context conte public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -143,27 +142,27 @@ public void deleteById(String id) { } String accountName = Utils.getValueFromIdByName(id, "accounts"); if (accountName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); } String virtualNetworkRuleName = Utils.getValueFromIdByName(id, "virtualNetworkRules"); if (virtualNetworkRuleName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format( "The resource ID '%s' is not valid. Missing path segment 'virtualNetworkRules'.", id))); } - this.deleteWithResponse(resourceGroupName, accountName, virtualNetworkRuleName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, accountName, virtualNetworkRuleName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -171,14 +170,14 @@ public Response deleteByIdWithResponse(String id, Context context) { } String accountName = Utils.getValueFromIdByName(id, "accounts"); if (accountName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); } String virtualNetworkRuleName = Utils.getValueFromIdByName(id, "virtualNetworkRules"); if (virtualNetworkRuleName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/Accounts.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/Accounts.java index 6e0ef3e2140bd..5e06f3f4a5b59 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/Accounts.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/Accounts.java @@ -16,7 +16,7 @@ public interface Accounts { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -38,7 +38,7 @@ public interface Accounts { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response as paginated response with {@link PagedIterable}. */ PagedIterable list( String filter, Integer top, Integer skip, String select, String orderby, Boolean count, Context context); @@ -51,7 +51,7 @@ PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -74,7 +74,7 @@ PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account list information response. + * @return data Lake Store account list information response as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup( String resourceGroupName, @@ -91,26 +91,26 @@ PagedIterable listByResourceGroup( * * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store account. + * @return the specified Data Lake Store account along with {@link Response}. */ - DataLakeStoreAccount getByResourceGroup(String resourceGroupName, String accountName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context); /** * Gets the specified Data Lake Store account. * * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified Data Lake Store account. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String accountName, Context context); + DataLakeStoreAccount getByResourceGroup(String resourceGroupName, String accountName); /** * Deletes the specified Data Lake Store account. @@ -140,50 +140,50 @@ Response getByResourceGroupWithResponse( * * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void enableKeyVault(String resourceGroupName, String accountName); + Response enableKeyVaultWithResponse(String resourceGroupName, String accountName, Context context); /** * Attempts to enable a user managed Key Vault for encryption of the specified Data Lake Store account. * * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ - Response enableKeyVaultWithResponse(String resourceGroupName, String accountName, Context context); + void enableKeyVault(String resourceGroupName, String accountName); /** * Checks whether the specified account name is available or taken. * * @param location The resource location without whitespace. * @param parameters Parameters supplied to check the Data Lake Store account name availability. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store account name availability result information. + * @return data Lake Store account name availability result information along with {@link Response}. */ - NameAvailabilityInformation checkNameAvailability(String location, CheckNameAvailabilityParameters parameters); + Response checkNameAvailabilityWithResponse( + String location, CheckNameAvailabilityParameters parameters, Context context); /** * Checks whether the specified account name is available or taken. * * @param location The resource location without whitespace. * @param parameters Parameters supplied to check the Data Lake Store account name availability. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return data Lake Store account name availability result information. */ - Response checkNameAvailabilityWithResponse( - String location, CheckNameAvailabilityParameters parameters, Context context); + NameAvailabilityInformation checkNameAvailability(String location, CheckNameAvailabilityParameters parameters); /** * Gets the specified Data Lake Store account. @@ -192,7 +192,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store account. + * @return the specified Data Lake Store account along with {@link Response}. */ DataLakeStoreAccount getById(String id); @@ -204,7 +204,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store account. + * @return the specified Data Lake Store account along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CheckNameAvailabilityParameters.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CheckNameAvailabilityParameters.java index 58f55e3e88fa9..5822d361e4b67 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CheckNameAvailabilityParameters.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CheckNameAvailabilityParameters.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Data Lake Store account name availability check parameters. */ @Fluent public final class CheckNameAvailabilityParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityParameters.class); - /* * The Data Lake Store name to check availability for. */ @@ -21,11 +18,11 @@ public final class CheckNameAvailabilityParameters { private String name; /* - * The resource type. Note: This should not be set by the user, as the - * constant value is Microsoft.DataLakeStore/accounts + * The resource type. Note: This should not be set by the user, as the constant value is + * Microsoft.DataLakeStore/accounts */ @JsonProperty(value = "type", required = true) - private String type; + private String type = "Microsoft.DataLakeStore/accounts"; /** Creates an instance of CheckNameAvailabilityParameters class. */ public CheckNameAvailabilityParameters() { @@ -81,10 +78,12 @@ public CheckNameAvailabilityParameters withType(String type) { */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property name in model CheckNameAvailabilityParameters")); } } + + private static final ClientLogger LOGGER = new ClientLogger(CheckNameAvailabilityParameters.class); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateDataLakeStoreAccountParameters.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateDataLakeStoreAccountParameters.java index 77182efb27479..5783135e7f1b1 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateDataLakeStoreAccountParameters.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateDataLakeStoreAccountParameters.java @@ -5,19 +5,16 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.datalakestore.fluent.models.CreateDataLakeStoreAccountProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; /** The CreateDataLakeStoreAccountParameters model. */ -@JsonFlatten @Fluent -public class CreateDataLakeStoreAccountParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateDataLakeStoreAccountParameters.class); - +public final class CreateDataLakeStoreAccountParameters { /* * The resource location. */ @@ -28,6 +25,7 @@ public class CreateDataLakeStoreAccountParameters { * The resource tags. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* @@ -37,71 +35,14 @@ public class CreateDataLakeStoreAccountParameters { private EncryptionIdentity identity; /* - * The default owner group for all new folders and files created in the - * Data Lake Store account. - */ - @JsonProperty(value = "properties.defaultGroup") - private String defaultGroup; - - /* - * The Key Vault encryption configuration. - */ - @JsonProperty(value = "properties.encryptionConfig") - private EncryptionConfig encryptionConfig; - - /* - * The current state of encryption for this Data Lake Store account. - */ - @JsonProperty(value = "properties.encryptionState") - private EncryptionState encryptionState; - - /* - * The list of firewall rules associated with this Data Lake Store account. - */ - @JsonProperty(value = "properties.firewallRules") - private List firewallRules; - - /* - * The list of virtual network rules associated with this Data Lake Store - * account. + * The Data Lake Store account properties to use for creating. */ - @JsonProperty(value = "properties.virtualNetworkRules") - private List virtualNetworkRules; + @JsonProperty(value = "properties") + private CreateDataLakeStoreAccountProperties innerProperties; - /* - * The current state of the IP address firewall for this Data Lake Store - * account. - */ - @JsonProperty(value = "properties.firewallState") - private FirewallState firewallState; - - /* - * The current state of allowing or disallowing IPs originating within - * Azure through the firewall. If the firewall is disabled, this is not - * enforced. - */ - @JsonProperty(value = "properties.firewallAllowAzureIps") - private FirewallAllowAzureIpsState firewallAllowAzureIps; - - /* - * The list of trusted identity providers associated with this Data Lake - * Store account. - */ - @JsonProperty(value = "properties.trustedIdProviders") - private List trustedIdProviders; - - /* - * The current state of the trusted identity provider feature for this Data - * Lake Store account. - */ - @JsonProperty(value = "properties.trustedIdProviderState") - private TrustedIdProviderState trustedIdProviderState; - - /* - * The commitment tier to use for next month. - */ - @JsonProperty(value = "properties.newTier") - private TierType newTier; + /** Creates an instance of CreateDataLakeStoreAccountParameters class. */ + public CreateDataLakeStoreAccountParameters() { + } /** * Get the location property: The resource location. @@ -163,6 +104,15 @@ public CreateDataLakeStoreAccountParameters withIdentity(EncryptionIdentity iden return this; } + /** + * Get the innerProperties property: The Data Lake Store account properties to use for creating. + * + * @return the innerProperties value. + */ + private CreateDataLakeStoreAccountProperties innerProperties() { + return this.innerProperties; + } + /** * Get the defaultGroup property: The default owner group for all new folders and files created in the Data Lake * Store account. @@ -170,7 +120,7 @@ public CreateDataLakeStoreAccountParameters withIdentity(EncryptionIdentity iden * @return the defaultGroup value. */ public String defaultGroup() { - return this.defaultGroup; + return this.innerProperties() == null ? null : this.innerProperties().defaultGroup(); } /** @@ -181,7 +131,10 @@ public String defaultGroup() { * @return the CreateDataLakeStoreAccountParameters object itself. */ public CreateDataLakeStoreAccountParameters withDefaultGroup(String defaultGroup) { - this.defaultGroup = defaultGroup; + if (this.innerProperties() == null) { + this.innerProperties = new CreateDataLakeStoreAccountProperties(); + } + this.innerProperties().withDefaultGroup(defaultGroup); return this; } @@ -191,7 +144,7 @@ public CreateDataLakeStoreAccountParameters withDefaultGroup(String defaultGroup * @return the encryptionConfig value. */ public EncryptionConfig encryptionConfig() { - return this.encryptionConfig; + return this.innerProperties() == null ? null : this.innerProperties().encryptionConfig(); } /** @@ -201,7 +154,10 @@ public EncryptionConfig encryptionConfig() { * @return the CreateDataLakeStoreAccountParameters object itself. */ public CreateDataLakeStoreAccountParameters withEncryptionConfig(EncryptionConfig encryptionConfig) { - this.encryptionConfig = encryptionConfig; + if (this.innerProperties() == null) { + this.innerProperties = new CreateDataLakeStoreAccountProperties(); + } + this.innerProperties().withEncryptionConfig(encryptionConfig); return this; } @@ -211,7 +167,7 @@ public CreateDataLakeStoreAccountParameters withEncryptionConfig(EncryptionConfi * @return the encryptionState value. */ public EncryptionState encryptionState() { - return this.encryptionState; + return this.innerProperties() == null ? null : this.innerProperties().encryptionState(); } /** @@ -221,7 +177,10 @@ public EncryptionState encryptionState() { * @return the CreateDataLakeStoreAccountParameters object itself. */ public CreateDataLakeStoreAccountParameters withEncryptionState(EncryptionState encryptionState) { - this.encryptionState = encryptionState; + if (this.innerProperties() == null) { + this.innerProperties = new CreateDataLakeStoreAccountProperties(); + } + this.innerProperties().withEncryptionState(encryptionState); return this; } @@ -231,7 +190,7 @@ public CreateDataLakeStoreAccountParameters withEncryptionState(EncryptionState * @return the firewallRules value. */ public List firewallRules() { - return this.firewallRules; + return this.innerProperties() == null ? null : this.innerProperties().firewallRules(); } /** @@ -242,7 +201,10 @@ public List firewallRules() { */ public CreateDataLakeStoreAccountParameters withFirewallRules( List firewallRules) { - this.firewallRules = firewallRules; + if (this.innerProperties() == null) { + this.innerProperties = new CreateDataLakeStoreAccountProperties(); + } + this.innerProperties().withFirewallRules(firewallRules); return this; } @@ -253,7 +215,7 @@ public CreateDataLakeStoreAccountParameters withFirewallRules( * @return the virtualNetworkRules value. */ public List virtualNetworkRules() { - return this.virtualNetworkRules; + return this.innerProperties() == null ? null : this.innerProperties().virtualNetworkRules(); } /** @@ -265,7 +227,10 @@ public List virtualNetworkRules() */ public CreateDataLakeStoreAccountParameters withVirtualNetworkRules( List virtualNetworkRules) { - this.virtualNetworkRules = virtualNetworkRules; + if (this.innerProperties() == null) { + this.innerProperties = new CreateDataLakeStoreAccountProperties(); + } + this.innerProperties().withVirtualNetworkRules(virtualNetworkRules); return this; } @@ -275,7 +240,7 @@ public CreateDataLakeStoreAccountParameters withVirtualNetworkRules( * @return the firewallState value. */ public FirewallState firewallState() { - return this.firewallState; + return this.innerProperties() == null ? null : this.innerProperties().firewallState(); } /** @@ -285,7 +250,10 @@ public FirewallState firewallState() { * @return the CreateDataLakeStoreAccountParameters object itself. */ public CreateDataLakeStoreAccountParameters withFirewallState(FirewallState firewallState) { - this.firewallState = firewallState; + if (this.innerProperties() == null) { + this.innerProperties = new CreateDataLakeStoreAccountProperties(); + } + this.innerProperties().withFirewallState(firewallState); return this; } @@ -296,7 +264,7 @@ public CreateDataLakeStoreAccountParameters withFirewallState(FirewallState fire * @return the firewallAllowAzureIps value. */ public FirewallAllowAzureIpsState firewallAllowAzureIps() { - return this.firewallAllowAzureIps; + return this.innerProperties() == null ? null : this.innerProperties().firewallAllowAzureIps(); } /** @@ -308,7 +276,10 @@ public FirewallAllowAzureIpsState firewallAllowAzureIps() { */ public CreateDataLakeStoreAccountParameters withFirewallAllowAzureIps( FirewallAllowAzureIpsState firewallAllowAzureIps) { - this.firewallAllowAzureIps = firewallAllowAzureIps; + if (this.innerProperties() == null) { + this.innerProperties = new CreateDataLakeStoreAccountProperties(); + } + this.innerProperties().withFirewallAllowAzureIps(firewallAllowAzureIps); return this; } @@ -319,7 +290,7 @@ public CreateDataLakeStoreAccountParameters withFirewallAllowAzureIps( * @return the trustedIdProviders value. */ public List trustedIdProviders() { - return this.trustedIdProviders; + return this.innerProperties() == null ? null : this.innerProperties().trustedIdProviders(); } /** @@ -331,7 +302,10 @@ public List trustedIdProviders() { */ public CreateDataLakeStoreAccountParameters withTrustedIdProviders( List trustedIdProviders) { - this.trustedIdProviders = trustedIdProviders; + if (this.innerProperties() == null) { + this.innerProperties = new CreateDataLakeStoreAccountProperties(); + } + this.innerProperties().withTrustedIdProviders(trustedIdProviders); return this; } @@ -342,7 +316,7 @@ public CreateDataLakeStoreAccountParameters withTrustedIdProviders( * @return the trustedIdProviderState value. */ public TrustedIdProviderState trustedIdProviderState() { - return this.trustedIdProviderState; + return this.innerProperties() == null ? null : this.innerProperties().trustedIdProviderState(); } /** @@ -354,7 +328,10 @@ public TrustedIdProviderState trustedIdProviderState() { */ public CreateDataLakeStoreAccountParameters withTrustedIdProviderState( TrustedIdProviderState trustedIdProviderState) { - this.trustedIdProviderState = trustedIdProviderState; + if (this.innerProperties() == null) { + this.innerProperties = new CreateDataLakeStoreAccountProperties(); + } + this.innerProperties().withTrustedIdProviderState(trustedIdProviderState); return this; } @@ -364,7 +341,7 @@ public CreateDataLakeStoreAccountParameters withTrustedIdProviderState( * @return the newTier value. */ public TierType newTier() { - return this.newTier; + return this.innerProperties() == null ? null : this.innerProperties().newTier(); } /** @@ -374,7 +351,10 @@ public TierType newTier() { * @return the CreateDataLakeStoreAccountParameters object itself. */ public CreateDataLakeStoreAccountParameters withNewTier(TierType newTier) { - this.newTier = newTier; + if (this.innerProperties() == null) { + this.innerProperties = new CreateDataLakeStoreAccountProperties(); + } + this.innerProperties().withNewTier(newTier); return this; } @@ -385,7 +365,7 @@ public CreateDataLakeStoreAccountParameters withNewTier(TierType newTier) { */ public void validate() { if (location() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property location in model CreateDataLakeStoreAccountParameters")); @@ -393,17 +373,10 @@ public void validate() { if (identity() != null) { identity().validate(); } - if (encryptionConfig() != null) { - encryptionConfig().validate(); - } - if (firewallRules() != null) { - firewallRules().forEach(e -> e.validate()); - } - if (virtualNetworkRules() != null) { - virtualNetworkRules().forEach(e -> e.validate()); - } - if (trustedIdProviders() != null) { - trustedIdProviders().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(CreateDataLakeStoreAccountParameters.class); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateFirewallRuleWithAccountParameters.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateFirewallRuleWithAccountParameters.java index 0e1cc6fd7cc02..4a44a30f1d253 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateFirewallRuleWithAccountParameters.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateFirewallRuleWithAccountParameters.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.datalakestore.fluent.models.CreateOrUpdateFirewallRuleProperties; import com.fasterxml.jackson.annotation.JsonProperty; /** The parameters used to create a new firewall rule while creating a new Data Lake Store account. */ -@JsonFlatten @Fluent -public class CreateFirewallRuleWithAccountParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateFirewallRuleWithAccountParameters.class); - +public final class CreateFirewallRuleWithAccountParameters { /* * The unique name of the firewall rule to create. */ @@ -23,18 +19,14 @@ public class CreateFirewallRuleWithAccountParameters { private String name; /* - * The start IP address for the firewall rule. This can be either ipv4 or - * ipv6. Start and End should be in the same protocol. + * The firewall rule properties to use when creating a new firewall rule. */ - @JsonProperty(value = "properties.startIpAddress", required = true) - private String startIpAddress; + @JsonProperty(value = "properties", required = true) + private CreateOrUpdateFirewallRuleProperties innerProperties = new CreateOrUpdateFirewallRuleProperties(); - /* - * The end IP address for the firewall rule. This can be either ipv4 or - * ipv6. Start and End should be in the same protocol. - */ - @JsonProperty(value = "properties.endIpAddress", required = true) - private String endIpAddress; + /** Creates an instance of CreateFirewallRuleWithAccountParameters class. */ + public CreateFirewallRuleWithAccountParameters() { + } /** * Get the name property: The unique name of the firewall rule to create. @@ -56,6 +48,15 @@ public CreateFirewallRuleWithAccountParameters withName(String name) { return this; } + /** + * Get the innerProperties property: The firewall rule properties to use when creating a new firewall rule. + * + * @return the innerProperties value. + */ + private CreateOrUpdateFirewallRuleProperties innerProperties() { + return this.innerProperties; + } + /** * Get the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6. * Start and End should be in the same protocol. @@ -63,7 +64,7 @@ public CreateFirewallRuleWithAccountParameters withName(String name) { * @return the startIpAddress value. */ public String startIpAddress() { - return this.startIpAddress; + return this.innerProperties() == null ? null : this.innerProperties().startIpAddress(); } /** @@ -74,7 +75,10 @@ public String startIpAddress() { * @return the CreateFirewallRuleWithAccountParameters object itself. */ public CreateFirewallRuleWithAccountParameters withStartIpAddress(String startIpAddress) { - this.startIpAddress = startIpAddress; + if (this.innerProperties() == null) { + this.innerProperties = new CreateOrUpdateFirewallRuleProperties(); + } + this.innerProperties().withStartIpAddress(startIpAddress); return this; } @@ -85,7 +89,7 @@ public CreateFirewallRuleWithAccountParameters withStartIpAddress(String startIp * @return the endIpAddress value. */ public String endIpAddress() { - return this.endIpAddress; + return this.innerProperties() == null ? null : this.innerProperties().endIpAddress(); } /** @@ -96,7 +100,10 @@ public String endIpAddress() { * @return the CreateFirewallRuleWithAccountParameters object itself. */ public CreateFirewallRuleWithAccountParameters withEndIpAddress(String endIpAddress) { - this.endIpAddress = endIpAddress; + if (this.innerProperties() == null) { + this.innerProperties = new CreateOrUpdateFirewallRuleProperties(); + } + this.innerProperties().withEndIpAddress(endIpAddress); return this; } @@ -107,22 +114,20 @@ public CreateFirewallRuleWithAccountParameters withEndIpAddress(String endIpAddr */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property name in model CreateFirewallRuleWithAccountParameters")); } - if (startIpAddress() == null) { - throw logger + if (innerProperties() == null) { + throw LOGGER .logExceptionAsError( new IllegalArgumentException( - "Missing required property startIpAddress in model CreateFirewallRuleWithAccountParameters")); - } - if (endIpAddress() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property endIpAddress in model CreateFirewallRuleWithAccountParameters")); + "Missing required property innerProperties in model CreateFirewallRuleWithAccountParameters")); + } else { + innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(CreateFirewallRuleWithAccountParameters.class); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateOrUpdateFirewallRuleParameters.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateOrUpdateFirewallRuleParameters.java index be77fce865d1e..6770fa4c202e0 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateOrUpdateFirewallRuleParameters.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateOrUpdateFirewallRuleParameters.java @@ -5,30 +5,31 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.datalakestore.fluent.models.CreateOrUpdateFirewallRuleProperties; import com.fasterxml.jackson.annotation.JsonProperty; /** The parameters used to create a new firewall rule. */ -@JsonFlatten @Fluent -public class CreateOrUpdateFirewallRuleParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateOrUpdateFirewallRuleParameters.class); - +public final class CreateOrUpdateFirewallRuleParameters { /* - * The start IP address for the firewall rule. This can be either ipv4 or - * ipv6. Start and End should be in the same protocol. + * The firewall rule properties to use when creating a new firewall rule. */ - @JsonProperty(value = "properties.startIpAddress", required = true) - private String startIpAddress; + @JsonProperty(value = "properties", required = true) + private CreateOrUpdateFirewallRuleProperties innerProperties = new CreateOrUpdateFirewallRuleProperties(); - /* - * The end IP address for the firewall rule. This can be either ipv4 or - * ipv6. Start and End should be in the same protocol. + /** Creates an instance of CreateOrUpdateFirewallRuleParameters class. */ + public CreateOrUpdateFirewallRuleParameters() { + } + + /** + * Get the innerProperties property: The firewall rule properties to use when creating a new firewall rule. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.endIpAddress", required = true) - private String endIpAddress; + private CreateOrUpdateFirewallRuleProperties innerProperties() { + return this.innerProperties; + } /** * Get the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6. @@ -37,7 +38,7 @@ public class CreateOrUpdateFirewallRuleParameters { * @return the startIpAddress value. */ public String startIpAddress() { - return this.startIpAddress; + return this.innerProperties() == null ? null : this.innerProperties().startIpAddress(); } /** @@ -48,7 +49,10 @@ public String startIpAddress() { * @return the CreateOrUpdateFirewallRuleParameters object itself. */ public CreateOrUpdateFirewallRuleParameters withStartIpAddress(String startIpAddress) { - this.startIpAddress = startIpAddress; + if (this.innerProperties() == null) { + this.innerProperties = new CreateOrUpdateFirewallRuleProperties(); + } + this.innerProperties().withStartIpAddress(startIpAddress); return this; } @@ -59,7 +63,7 @@ public CreateOrUpdateFirewallRuleParameters withStartIpAddress(String startIpAdd * @return the endIpAddress value. */ public String endIpAddress() { - return this.endIpAddress; + return this.innerProperties() == null ? null : this.innerProperties().endIpAddress(); } /** @@ -70,7 +74,10 @@ public String endIpAddress() { * @return the CreateOrUpdateFirewallRuleParameters object itself. */ public CreateOrUpdateFirewallRuleParameters withEndIpAddress(String endIpAddress) { - this.endIpAddress = endIpAddress; + if (this.innerProperties() == null) { + this.innerProperties = new CreateOrUpdateFirewallRuleProperties(); + } + this.innerProperties().withEndIpAddress(endIpAddress); return this; } @@ -80,17 +87,15 @@ public CreateOrUpdateFirewallRuleParameters withEndIpAddress(String endIpAddress * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (startIpAddress() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property startIpAddress in model CreateOrUpdateFirewallRuleParameters")); - } - if (endIpAddress() == null) { - throw logger + if (innerProperties() == null) { + throw LOGGER .logExceptionAsError( new IllegalArgumentException( - "Missing required property endIpAddress in model CreateOrUpdateFirewallRuleParameters")); + "Missing required property innerProperties in model CreateOrUpdateFirewallRuleParameters")); + } else { + innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(CreateOrUpdateFirewallRuleParameters.class); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateOrUpdateTrustedIdProviderParameters.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateOrUpdateTrustedIdProviderParameters.java index db32aad3c3389..38bd6d66f15e2 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateOrUpdateTrustedIdProviderParameters.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateOrUpdateTrustedIdProviderParameters.java @@ -5,22 +5,32 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.datalakestore.fluent.models.CreateOrUpdateTrustedIdProviderProperties; import com.fasterxml.jackson.annotation.JsonProperty; /** The parameters used to create a new trusted identity provider. */ -@JsonFlatten @Fluent -public class CreateOrUpdateTrustedIdProviderParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateOrUpdateTrustedIdProviderParameters.class); - +public final class CreateOrUpdateTrustedIdProviderParameters { /* - * The URL of this trusted identity provider. + * The trusted identity provider properties to use when creating a new trusted identity provider. + */ + @JsonProperty(value = "properties", required = true) + private CreateOrUpdateTrustedIdProviderProperties innerProperties = new CreateOrUpdateTrustedIdProviderProperties(); + + /** Creates an instance of CreateOrUpdateTrustedIdProviderParameters class. */ + public CreateOrUpdateTrustedIdProviderParameters() { + } + + /** + * Get the innerProperties property: The trusted identity provider properties to use when creating a new trusted + * identity provider. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.idProvider", required = true) - private String idProvider; + private CreateOrUpdateTrustedIdProviderProperties innerProperties() { + return this.innerProperties; + } /** * Get the idProvider property: The URL of this trusted identity provider. @@ -28,7 +38,7 @@ public class CreateOrUpdateTrustedIdProviderParameters { * @return the idProvider value. */ public String idProvider() { - return this.idProvider; + return this.innerProperties() == null ? null : this.innerProperties().idProvider(); } /** @@ -38,7 +48,10 @@ public String idProvider() { * @return the CreateOrUpdateTrustedIdProviderParameters object itself. */ public CreateOrUpdateTrustedIdProviderParameters withIdProvider(String idProvider) { - this.idProvider = idProvider; + if (this.innerProperties() == null) { + this.innerProperties = new CreateOrUpdateTrustedIdProviderProperties(); + } + this.innerProperties().withIdProvider(idProvider); return this; } @@ -48,11 +61,16 @@ public CreateOrUpdateTrustedIdProviderParameters withIdProvider(String idProvide * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (idProvider() == null) { - throw logger + if (innerProperties() == null) { + throw LOGGER .logExceptionAsError( new IllegalArgumentException( - "Missing required property idProvider in model CreateOrUpdateTrustedIdProviderParameters")); + "Missing required property innerProperties in model" + + " CreateOrUpdateTrustedIdProviderParameters")); + } else { + innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(CreateOrUpdateTrustedIdProviderParameters.class); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateOrUpdateVirtualNetworkRuleParameters.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateOrUpdateVirtualNetworkRuleParameters.java index 35543c9a013eb..216cc7db1d71d 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateOrUpdateVirtualNetworkRuleParameters.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateOrUpdateVirtualNetworkRuleParameters.java @@ -5,22 +5,33 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.datalakestore.fluent.models.CreateOrUpdateVirtualNetworkRuleProperties; import com.fasterxml.jackson.annotation.JsonProperty; /** The parameters used to create a new virtual network rule. */ -@JsonFlatten @Fluent -public class CreateOrUpdateVirtualNetworkRuleParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateOrUpdateVirtualNetworkRuleParameters.class); - +public final class CreateOrUpdateVirtualNetworkRuleParameters { /* - * The resource identifier for the subnet. + * The virtual network rule properties to use when creating a new virtual network rule. + */ + @JsonProperty(value = "properties", required = true) + private CreateOrUpdateVirtualNetworkRuleProperties innerProperties = + new CreateOrUpdateVirtualNetworkRuleProperties(); + + /** Creates an instance of CreateOrUpdateVirtualNetworkRuleParameters class. */ + public CreateOrUpdateVirtualNetworkRuleParameters() { + } + + /** + * Get the innerProperties property: The virtual network rule properties to use when creating a new virtual network + * rule. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.subnetId", required = true) - private String subnetId; + private CreateOrUpdateVirtualNetworkRuleProperties innerProperties() { + return this.innerProperties; + } /** * Get the subnetId property: The resource identifier for the subnet. @@ -28,7 +39,7 @@ public class CreateOrUpdateVirtualNetworkRuleParameters { * @return the subnetId value. */ public String subnetId() { - return this.subnetId; + return this.innerProperties() == null ? null : this.innerProperties().subnetId(); } /** @@ -38,7 +49,10 @@ public String subnetId() { * @return the CreateOrUpdateVirtualNetworkRuleParameters object itself. */ public CreateOrUpdateVirtualNetworkRuleParameters withSubnetId(String subnetId) { - this.subnetId = subnetId; + if (this.innerProperties() == null) { + this.innerProperties = new CreateOrUpdateVirtualNetworkRuleProperties(); + } + this.innerProperties().withSubnetId(subnetId); return this; } @@ -48,11 +62,16 @@ public CreateOrUpdateVirtualNetworkRuleParameters withSubnetId(String subnetId) * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (subnetId() == null) { - throw logger + if (innerProperties() == null) { + throw LOGGER .logExceptionAsError( new IllegalArgumentException( - "Missing required property subnetId in model CreateOrUpdateVirtualNetworkRuleParameters")); + "Missing required property innerProperties in model" + + " CreateOrUpdateVirtualNetworkRuleParameters")); + } else { + innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(CreateOrUpdateVirtualNetworkRuleParameters.class); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateTrustedIdProviderWithAccountParameters.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateTrustedIdProviderWithAccountParameters.java index 1a84361a8f62a..da265c42b7aaa 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateTrustedIdProviderWithAccountParameters.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateTrustedIdProviderWithAccountParameters.java @@ -5,18 +5,13 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.datalakestore.fluent.models.CreateOrUpdateTrustedIdProviderProperties; import com.fasterxml.jackson.annotation.JsonProperty; /** The parameters used to create a new trusted identity provider while creating a new Data Lake Store account. */ -@JsonFlatten @Fluent -public class CreateTrustedIdProviderWithAccountParameters { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(CreateTrustedIdProviderWithAccountParameters.class); - +public final class CreateTrustedIdProviderWithAccountParameters { /* * The unique name of the trusted identity provider to create. */ @@ -24,10 +19,14 @@ public class CreateTrustedIdProviderWithAccountParameters { private String name; /* - * The URL of this trusted identity provider. + * The trusted identity provider properties to use when creating a new trusted identity provider. */ - @JsonProperty(value = "properties.idProvider", required = true) - private String idProvider; + @JsonProperty(value = "properties", required = true) + private CreateOrUpdateTrustedIdProviderProperties innerProperties = new CreateOrUpdateTrustedIdProviderProperties(); + + /** Creates an instance of CreateTrustedIdProviderWithAccountParameters class. */ + public CreateTrustedIdProviderWithAccountParameters() { + } /** * Get the name property: The unique name of the trusted identity provider to create. @@ -49,13 +48,23 @@ public CreateTrustedIdProviderWithAccountParameters withName(String name) { return this; } + /** + * Get the innerProperties property: The trusted identity provider properties to use when creating a new trusted + * identity provider. + * + * @return the innerProperties value. + */ + private CreateOrUpdateTrustedIdProviderProperties innerProperties() { + return this.innerProperties; + } + /** * Get the idProvider property: The URL of this trusted identity provider. * * @return the idProvider value. */ public String idProvider() { - return this.idProvider; + return this.innerProperties() == null ? null : this.innerProperties().idProvider(); } /** @@ -65,7 +74,10 @@ public String idProvider() { * @return the CreateTrustedIdProviderWithAccountParameters object itself. */ public CreateTrustedIdProviderWithAccountParameters withIdProvider(String idProvider) { - this.idProvider = idProvider; + if (this.innerProperties() == null) { + this.innerProperties = new CreateOrUpdateTrustedIdProviderProperties(); + } + this.innerProperties().withIdProvider(idProvider); return this; } @@ -76,16 +88,21 @@ public CreateTrustedIdProviderWithAccountParameters withIdProvider(String idProv */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property name in model CreateTrustedIdProviderWithAccountParameters")); } - if (idProvider() == null) { - throw logger + if (innerProperties() == null) { + throw LOGGER .logExceptionAsError( new IllegalArgumentException( - "Missing required property idProvider in model CreateTrustedIdProviderWithAccountParameters")); + "Missing required property innerProperties in model" + + " CreateTrustedIdProviderWithAccountParameters")); + } else { + innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(CreateTrustedIdProviderWithAccountParameters.class); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateVirtualNetworkRuleWithAccountParameters.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateVirtualNetworkRuleWithAccountParameters.java index a78e7c309a81d..a4d16458dc6cf 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateVirtualNetworkRuleWithAccountParameters.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/CreateVirtualNetworkRuleWithAccountParameters.java @@ -5,18 +5,13 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.datalakestore.fluent.models.CreateOrUpdateVirtualNetworkRuleProperties; import com.fasterxml.jackson.annotation.JsonProperty; /** The parameters used to create a new virtual network rule while creating a new Data Lake Store account. */ -@JsonFlatten @Fluent -public class CreateVirtualNetworkRuleWithAccountParameters { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(CreateVirtualNetworkRuleWithAccountParameters.class); - +public final class CreateVirtualNetworkRuleWithAccountParameters { /* * The unique name of the virtual network rule to create. */ @@ -24,10 +19,15 @@ public class CreateVirtualNetworkRuleWithAccountParameters { private String name; /* - * The resource identifier for the subnet. + * The virtual network rule properties to use when creating a new virtual network rule. */ - @JsonProperty(value = "properties.subnetId", required = true) - private String subnetId; + @JsonProperty(value = "properties", required = true) + private CreateOrUpdateVirtualNetworkRuleProperties innerProperties = + new CreateOrUpdateVirtualNetworkRuleProperties(); + + /** Creates an instance of CreateVirtualNetworkRuleWithAccountParameters class. */ + public CreateVirtualNetworkRuleWithAccountParameters() { + } /** * Get the name property: The unique name of the virtual network rule to create. @@ -49,13 +49,23 @@ public CreateVirtualNetworkRuleWithAccountParameters withName(String name) { return this; } + /** + * Get the innerProperties property: The virtual network rule properties to use when creating a new virtual network + * rule. + * + * @return the innerProperties value. + */ + private CreateOrUpdateVirtualNetworkRuleProperties innerProperties() { + return this.innerProperties; + } + /** * Get the subnetId property: The resource identifier for the subnet. * * @return the subnetId value. */ public String subnetId() { - return this.subnetId; + return this.innerProperties() == null ? null : this.innerProperties().subnetId(); } /** @@ -65,7 +75,10 @@ public String subnetId() { * @return the CreateVirtualNetworkRuleWithAccountParameters object itself. */ public CreateVirtualNetworkRuleWithAccountParameters withSubnetId(String subnetId) { - this.subnetId = subnetId; + if (this.innerProperties() == null) { + this.innerProperties = new CreateOrUpdateVirtualNetworkRuleProperties(); + } + this.innerProperties().withSubnetId(subnetId); return this; } @@ -76,16 +89,21 @@ public CreateVirtualNetworkRuleWithAccountParameters withSubnetId(String subnetI */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property name in model CreateVirtualNetworkRuleWithAccountParameters")); } - if (subnetId() == null) { - throw logger + if (innerProperties() == null) { + throw LOGGER .logExceptionAsError( new IllegalArgumentException( - "Missing required property subnetId in model CreateVirtualNetworkRuleWithAccountParameters")); + "Missing required property innerProperties in model" + + " CreateVirtualNetworkRuleWithAccountParameters")); + } else { + innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(CreateVirtualNetworkRuleWithAccountParameters.class); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/DataLakeStoreAccount.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/DataLakeStoreAccount.java index 5a15b7ab98991..109d058cf4560 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/DataLakeStoreAccount.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/DataLakeStoreAccount.java @@ -57,48 +57,6 @@ public interface DataLakeStoreAccount { */ EncryptionIdentity identity(); - /** - * Gets the accountId property: The unique identifier associated with this Data Lake Store account. - * - * @return the accountId value. - */ - UUID accountId(); - - /** - * Gets the provisioningState property: The provisioning status of the Data Lake Store account. - * - * @return the provisioningState value. - */ - DataLakeStoreAccountStatus provisioningState(); - - /** - * Gets the state property: The state of the Data Lake Store account. - * - * @return the state value. - */ - DataLakeStoreAccountState state(); - - /** - * Gets the creationTime property: The account creation time. - * - * @return the creationTime value. - */ - OffsetDateTime creationTime(); - - /** - * Gets the lastModifiedTime property: The account last modified time. - * - * @return the lastModifiedTime value. - */ - OffsetDateTime lastModifiedTime(); - - /** - * Gets the endpoint property: The full CName endpoint for this account. - * - * @return the endpoint value. - */ - String endpoint(); - /** * Gets the defaultGroup property: The default owner group for all new folders and files created in the Data Lake * Store account. @@ -189,6 +147,48 @@ public interface DataLakeStoreAccount { */ TierType currentTier(); + /** + * Gets the accountId property: The unique identifier associated with this Data Lake Store account. + * + * @return the accountId value. + */ + UUID accountId(); + + /** + * Gets the provisioningState property: The provisioning status of the Data Lake Store account. + * + * @return the provisioningState value. + */ + DataLakeStoreAccountStatus provisioningState(); + + /** + * Gets the state property: The state of the Data Lake Store account. + * + * @return the state value. + */ + DataLakeStoreAccountState state(); + + /** + * Gets the creationTime property: The account creation time. + * + * @return the creationTime value. + */ + OffsetDateTime creationTime(); + + /** + * Gets the lastModifiedTime property: The account last modified time. + * + * @return the lastModifiedTime value. + */ + OffsetDateTime lastModifiedTime(); + + /** + * Gets the endpoint property: The full CName endpoint for this account. + * + * @return the endpoint value. + */ + String endpoint(); + /** * Gets the region of the resource. * @@ -203,6 +203,13 @@ public interface DataLakeStoreAccount { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.datalakestore.fluent.models.DataLakeStoreAccountInner object. * @@ -592,19 +599,19 @@ interface WithNewTier { /** * Attempts to enable a user managed Key Vault for encryption of the specified Data Lake Store account. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void enableKeyVault(); + Response enableKeyVaultWithResponse(Context context); /** * Attempts to enable a user managed Key Vault for encryption of the specified Data Lake Store account. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ - Response enableKeyVaultWithResponse(Context context); + void enableKeyVault(); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/DataLakeStoreAccountListResult.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/DataLakeStoreAccountListResult.java index fc5c75a671992..2caf410cd11d7 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/DataLakeStoreAccountListResult.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/DataLakeStoreAccountListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datalakestore.fluent.models.DataLakeStoreAccountBasicInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Data Lake Store account list information response. */ @Immutable public final class DataLakeStoreAccountListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataLakeStoreAccountListResult.class); - /* * The results of the list operation. */ @@ -28,6 +24,10 @@ public final class DataLakeStoreAccountListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of DataLakeStoreAccountListResult class. */ + public DataLakeStoreAccountListResult() { + } + /** * Get the value property: The results of the list operation. * diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/DataLakeStoreAccountState.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/DataLakeStoreAccountState.java index 9089b96c5148b..c1de1005c34e8 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/DataLakeStoreAccountState.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/DataLakeStoreAccountState.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for DataLakeStoreAccountState. */ +/** The state of the Data Lake Store account. */ public enum DataLakeStoreAccountState { /** Enum value Active. */ ACTIVE("Active"), @@ -30,6 +30,9 @@ public enum DataLakeStoreAccountState { */ @JsonCreator public static DataLakeStoreAccountState fromString(String value) { + if (value == null) { + return null; + } DataLakeStoreAccountState[] items = DataLakeStoreAccountState.values(); for (DataLakeStoreAccountState item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -39,6 +42,7 @@ public static DataLakeStoreAccountState fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/DataLakeStoreAccountStatus.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/DataLakeStoreAccountStatus.java index e6c404af11ec6..fd5390771b3e6 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/DataLakeStoreAccountStatus.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/DataLakeStoreAccountStatus.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for DataLakeStoreAccountStatus. */ +/** The provisioning status of the Data Lake Store account. */ public enum DataLakeStoreAccountStatus { /** Enum value Failed. */ FAILED("Failed"), @@ -57,6 +57,9 @@ public enum DataLakeStoreAccountStatus { */ @JsonCreator public static DataLakeStoreAccountStatus fromString(String value) { + if (value == null) { + return null; + } DataLakeStoreAccountStatus[] items = DataLakeStoreAccountStatus.values(); for (DataLakeStoreAccountStatus item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -66,6 +69,7 @@ public static DataLakeStoreAccountStatus fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/EncryptionConfig.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/EncryptionConfig.java index 10a5134ae6adb..1c373c9580b91 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/EncryptionConfig.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/EncryptionConfig.java @@ -6,28 +6,28 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The encryption configuration for the account. */ @Fluent public final class EncryptionConfig { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionConfig.class); - /* - * The type of encryption configuration being used. Currently the only - * supported types are 'UserManaged' and 'ServiceManaged'. + * The type of encryption configuration being used. Currently the only supported types are 'UserManaged' and + * 'ServiceManaged'. */ @JsonProperty(value = "type", required = true) private EncryptionConfigType type; /* - * The Key Vault information for connecting to user managed encryption - * keys. + * The Key Vault information for connecting to user managed encryption keys. */ @JsonProperty(value = "keyVaultMetaInfo") private KeyVaultMetaInfo keyVaultMetaInfo; + /** Creates an instance of EncryptionConfig class. */ + public EncryptionConfig() { + } + /** * Get the type property: The type of encryption configuration being used. Currently the only supported types are * 'UserManaged' and 'ServiceManaged'. @@ -77,7 +77,7 @@ public EncryptionConfig withKeyVaultMetaInfo(KeyVaultMetaInfo keyVaultMetaInfo) */ public void validate() { if (type() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property type in model EncryptionConfig")); } @@ -85,4 +85,6 @@ public void validate() { keyVaultMetaInfo().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(EncryptionConfig.class); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/EncryptionConfigType.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/EncryptionConfigType.java index e65476d43c6ce..b3cc9d7d9503d 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/EncryptionConfigType.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/EncryptionConfigType.java @@ -7,7 +7,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for EncryptionConfigType. */ +/** + * The type of encryption configuration being used. Currently the only supported types are 'UserManaged' and + * 'ServiceManaged'. + */ public enum EncryptionConfigType { /** Enum value UserManaged. */ USER_MANAGED("UserManaged"), @@ -30,6 +33,9 @@ public enum EncryptionConfigType { */ @JsonCreator public static EncryptionConfigType fromString(String value) { + if (value == null) { + return null; + } EncryptionConfigType[] items = EncryptionConfigType.values(); for (EncryptionConfigType item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -39,6 +45,7 @@ public static EncryptionConfigType fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/EncryptionIdentity.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/EncryptionIdentity.java index eb34e11b496b2..f907f41e3a468 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/EncryptionIdentity.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/EncryptionIdentity.java @@ -5,22 +5,17 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.UUID; /** The encryption identity properties. */ @Fluent public class EncryptionIdentity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionIdentity.class); - /* - * The type of encryption being used. Currently the only supported type is - * 'SystemAssigned'. + * The type of encryption being used. Currently the only supported type is 'SystemAssigned'. */ @JsonProperty(value = "type", required = true) - private String type; + private String type = "SystemAssigned"; /* * The principal identifier associated with the encryption. diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/EncryptionProvisioningState.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/EncryptionProvisioningState.java index 825c31dd458a8..ea9b6c6455146 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/EncryptionProvisioningState.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/EncryptionProvisioningState.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for EncryptionProvisioningState. */ +/** The current state of encryption provisioning for this Data Lake Store account. */ public enum EncryptionProvisioningState { /** Enum value Creating. */ CREATING("Creating"), @@ -30,6 +30,9 @@ public enum EncryptionProvisioningState { */ @JsonCreator public static EncryptionProvisioningState fromString(String value) { + if (value == null) { + return null; + } EncryptionProvisioningState[] items = EncryptionProvisioningState.values(); for (EncryptionProvisioningState item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -39,6 +42,7 @@ public static EncryptionProvisioningState fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/EncryptionState.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/EncryptionState.java index f648b35635494..9ba6fe1205c46 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/EncryptionState.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/EncryptionState.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for EncryptionState. */ +/** The current state of encryption for this Data Lake Store account. */ public enum EncryptionState { /** Enum value Enabled. */ ENABLED("Enabled"), @@ -30,6 +30,9 @@ public enum EncryptionState { */ @JsonCreator public static EncryptionState fromString(String value) { + if (value == null) { + return null; + } EncryptionState[] items = EncryptionState.values(); for (EncryptionState item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -39,6 +42,7 @@ public static EncryptionState fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/FirewallAllowAzureIpsState.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/FirewallAllowAzureIpsState.java index ccff63ed82732..1b139f1488dec 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/FirewallAllowAzureIpsState.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/FirewallAllowAzureIpsState.java @@ -7,7 +7,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for FirewallAllowAzureIpsState. */ +/** + * The current state of allowing or disallowing IPs originating within Azure through the firewall. If the firewall is + * disabled, this is not enforced. + */ public enum FirewallAllowAzureIpsState { /** Enum value Enabled. */ ENABLED("Enabled"), @@ -30,6 +33,9 @@ public enum FirewallAllowAzureIpsState { */ @JsonCreator public static FirewallAllowAzureIpsState fromString(String value) { + if (value == null) { + return null; + } FirewallAllowAzureIpsState[] items = FirewallAllowAzureIpsState.values(); for (FirewallAllowAzureIpsState item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -39,6 +45,7 @@ public static FirewallAllowAzureIpsState fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/FirewallRule.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/FirewallRule.java index d6083e0e3e700..4373ca44a92df 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/FirewallRule.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/FirewallRule.java @@ -16,6 +16,20 @@ public interface FirewallRule { */ String id(); + /** + * Gets the name property: The resource name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The resource type. + * + * @return the type value. + */ + String type(); + /** * Gets the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6. * Start and End should be in the same protocol. @@ -33,18 +47,11 @@ public interface FirewallRule { String endIpAddress(); /** - * Gets the name property: The resource name. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The resource type. + * Gets the name of the resource group. * - * @return the type value. + * @return the name of the resource group. */ - String type(); + String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.datalakestore.fluent.models.FirewallRuleInner object. diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/FirewallRuleListResult.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/FirewallRuleListResult.java index 692071e32eb48..547f136ab0111 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/FirewallRuleListResult.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/FirewallRuleListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datalakestore.fluent.models.FirewallRuleInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Data Lake Store firewall rule list information. */ @Immutable public final class FirewallRuleListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallRuleListResult.class); - /* * The results of the list operation. */ @@ -28,6 +24,10 @@ public final class FirewallRuleListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of FirewallRuleListResult class. */ + public FirewallRuleListResult() { + } + /** * Get the value property: The results of the list operation. * diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/FirewallRules.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/FirewallRules.java index 2269a2718b96b..fbd2beff3114c 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/FirewallRules.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/FirewallRules.java @@ -18,7 +18,7 @@ public interface FirewallRules { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store firewall rule list information. + * @return data Lake Store firewall rule list information as paginated response with {@link PagedIterable}. */ PagedIterable listByAccount(String resourceGroupName, String accountName); @@ -31,7 +31,7 @@ public interface FirewallRules { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store firewall rule list information. + * @return data Lake Store firewall rule list information as paginated response with {@link PagedIterable}. */ PagedIterable listByAccount(String resourceGroupName, String accountName, Context context); @@ -41,12 +41,14 @@ public interface FirewallRules { * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param firewallRuleName The name of the firewall rule to retrieve. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store firewall rule. + * @return the specified Data Lake Store firewall rule along with {@link Response}. */ - FirewallRule get(String resourceGroupName, String accountName, String firewallRuleName); + Response getWithResponse( + String resourceGroupName, String accountName, String firewallRuleName, Context context); /** * Gets the specified Data Lake Store firewall rule. @@ -54,14 +56,12 @@ public interface FirewallRules { * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param firewallRuleName The name of the firewall rule to retrieve. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified Data Lake Store firewall rule. */ - Response getWithResponse( - String resourceGroupName, String accountName, String firewallRuleName, Context context); + FirewallRule get(String resourceGroupName, String accountName, String firewallRuleName); /** * Deletes the specified firewall rule from the specified Data Lake Store account. @@ -69,11 +69,14 @@ Response getWithResponse( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param firewallRuleName The name of the firewall rule to delete. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void delete(String resourceGroupName, String accountName, String firewallRuleName); + Response deleteWithResponse( + String resourceGroupName, String accountName, String firewallRuleName, Context context); /** * Deletes the specified firewall rule from the specified Data Lake Store account. @@ -81,14 +84,11 @@ Response getWithResponse( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param firewallRuleName The name of the firewall rule to delete. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ - Response deleteWithResponse( - String resourceGroupName, String accountName, String firewallRuleName, Context context); + void delete(String resourceGroupName, String accountName, String firewallRuleName); /** * Gets the specified Data Lake Store firewall rule. @@ -97,7 +97,7 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store firewall rule. + * @return the specified Data Lake Store firewall rule along with {@link Response}. */ FirewallRule getById(String id); @@ -109,7 +109,7 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store firewall rule. + * @return the specified Data Lake Store firewall rule along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -131,7 +131,7 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/FirewallState.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/FirewallState.java index 1ee0ecb1886ba..18d860738c58a 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/FirewallState.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/FirewallState.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for FirewallState. */ +/** The current state of the IP address firewall for this Data Lake Store account. */ public enum FirewallState { /** Enum value Enabled. */ ENABLED("Enabled"), @@ -30,6 +30,9 @@ public enum FirewallState { */ @JsonCreator public static FirewallState fromString(String value) { + if (value == null) { + return null; + } FirewallState[] items = FirewallState.values(); for (FirewallState item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -39,6 +42,7 @@ public static FirewallState fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/KeyVaultMetaInfo.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/KeyVaultMetaInfo.java index 49b0c4f4565b8..ff2ff1a1dfab5 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/KeyVaultMetaInfo.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/KeyVaultMetaInfo.java @@ -6,17 +6,13 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Metadata information used by account encryption. */ @Fluent public final class KeyVaultMetaInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultMetaInfo.class); - /* - * The resource identifier for the user managed Key Vault being used to - * encrypt. + * The resource identifier for the user managed Key Vault being used to encrypt. */ @JsonProperty(value = "keyVaultResourceId", required = true) private String keyVaultResourceId; @@ -33,6 +29,10 @@ public final class KeyVaultMetaInfo { @JsonProperty(value = "encryptionKeyVersion", required = true) private String encryptionKeyVersion; + /** Creates an instance of KeyVaultMetaInfo class. */ + public KeyVaultMetaInfo() { + } + /** * Get the keyVaultResourceId property: The resource identifier for the user managed Key Vault being used to * encrypt. @@ -102,22 +102,24 @@ public KeyVaultMetaInfo withEncryptionKeyVersion(String encryptionKeyVersion) { */ public void validate() { if (keyVaultResourceId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property keyVaultResourceId in model KeyVaultMetaInfo")); } if (encryptionKeyName() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property encryptionKeyName in model KeyVaultMetaInfo")); } if (encryptionKeyVersion() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property encryptionKeyVersion in model KeyVaultMetaInfo")); } } + + private static final ClientLogger LOGGER = new ClientLogger(KeyVaultMetaInfo.class); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/Locations.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/Locations.java index 9c865af7e8fd8..fba6c28ed51e9 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/Locations.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/Locations.java @@ -14,24 +14,25 @@ public interface Locations { * Gets subscription-level properties and limits for Data Lake Store specified by resource location. * * @param location The resource location without whitespace. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription-level properties and limits for Data Lake Store specified by resource location. + * @return subscription-level properties and limits for Data Lake Store specified by resource location along with + * {@link Response}. */ - CapabilityInformation getCapability(String location); + Response getCapabilityWithResponse(String location, Context context); /** * Gets subscription-level properties and limits for Data Lake Store specified by resource location. * * @param location The resource location without whitespace. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return subscription-level properties and limits for Data Lake Store specified by resource location. */ - Response getCapabilityWithResponse(String location, Context context); + CapabilityInformation getCapability(String location); /** * Gets the current usage count and the limit for the resources of the location under the subscription. @@ -40,7 +41,8 @@ public interface Locations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current usage count and the limit for the resources of the location under the subscription. + * @return the current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedIterable}. */ PagedIterable getUsage(String location); @@ -52,7 +54,8 @@ public interface Locations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current usage count and the limit for the resources of the location under the subscription. + * @return the current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedIterable}. */ PagedIterable getUsage(String location, Context context); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/Operation.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/Operation.java index 96ab99d6dee3a..da5e8c043edba 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/Operation.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/Operation.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** An available operation for Data Lake Store. */ @Fluent public final class Operation { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Operation.class); - /* * The name of the operation. */ @@ -32,6 +28,10 @@ public final class Operation { @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) private OperationOrigin origin; + /** Creates an instance of Operation class. */ + public Operation() { + } + /** * Get the name property: The name of the operation. * diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/OperationDisplay.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/OperationDisplay.java index 453bbc14ddcca..2cce589bd326a 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/OperationDisplay.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/OperationDisplay.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The display information for a particular operation. */ @Immutable public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - /* * The resource provider of the operation. */ @@ -38,6 +34,10 @@ public final class OperationDisplay { @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + /** * Get the provider property: The resource provider of the operation. * diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/OperationOrigin.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/OperationOrigin.java index 1ce4a09116ffb..ef77a8c0299fe 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/OperationOrigin.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/OperationOrigin.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for OperationOrigin. */ +/** The intended executor of the operation. */ public final class OperationOrigin extends ExpandableStringEnum { /** Static value user for OperationOrigin. */ public static final OperationOrigin USER = fromString("user"); @@ -19,6 +19,15 @@ public final class OperationOrigin extends ExpandableStringEnum /** Static value user,system for OperationOrigin. */ public static final OperationOrigin USER_SYSTEM = fromString("user,system"); + /** + * Creates a new instance of OperationOrigin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OperationOrigin() { + } + /** * Creates or finds a OperationOrigin from its string representation. * @@ -30,7 +39,11 @@ public static OperationOrigin fromString(String name) { return fromString(name, OperationOrigin.class); } - /** @return known OperationOrigin values. */ + /** + * Gets known OperationOrigin values. + * + * @return known OperationOrigin values. + */ public static Collection values() { return values(OperationOrigin.class); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/Operations.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/Operations.java index 22b5550d42f71..a8428b42f01ac 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/Operations.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/Operations.java @@ -12,20 +12,20 @@ public interface Operations { /** * Lists all of the available Data Lake Store REST API operations. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of available operations for Data Lake Store. + * @return the list of available operations for Data Lake Store along with {@link Response}. */ - OperationListResult list(); + Response listWithResponse(Context context); /** * Lists all of the available Data Lake Store REST API operations. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of available operations for Data Lake Store. */ - Response listWithResponse(Context context); + OperationListResult list(); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/SubscriptionState.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/SubscriptionState.java index c9967983ee4a5..b6b35ff251a9c 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/SubscriptionState.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/SubscriptionState.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for SubscriptionState. */ +/** The subscription state. */ public final class SubscriptionState extends ExpandableStringEnum { /** Static value Registered for SubscriptionState. */ public static final SubscriptionState REGISTERED = fromString("Registered"); @@ -25,6 +25,15 @@ public final class SubscriptionState extends ExpandableStringEnum values() { return values(SubscriptionState.class); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/TierType.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/TierType.java index 5fc95e25efa47..e3ae06339e38c 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/TierType.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/TierType.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for TierType. */ +/** The commitment tier to use for next month. */ public enum TierType { /** Enum value Consumption. */ CONSUMPTION("Consumption"), @@ -45,6 +45,9 @@ public enum TierType { */ @JsonCreator public static TierType fromString(String value) { + if (value == null) { + return null; + } TierType[] items = TierType.values(); for (TierType item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -54,6 +57,7 @@ public static TierType fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/TrustedIdProvider.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/TrustedIdProvider.java index 7625c1e438a9a..5c650b4a5f489 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/TrustedIdProvider.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/TrustedIdProvider.java @@ -16,13 +16,6 @@ public interface TrustedIdProvider { */ String id(); - /** - * Gets the idProvider property: The URL of this trusted identity provider. - * - * @return the idProvider value. - */ - String idProvider(); - /** * Gets the name property: The resource name. * @@ -37,6 +30,20 @@ public interface TrustedIdProvider { */ String type(); + /** + * Gets the idProvider property: The URL of this trusted identity provider. + * + * @return the idProvider value. + */ + String idProvider(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.datalakestore.fluent.models.TrustedIdProviderInner object. * diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/TrustedIdProviderListResult.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/TrustedIdProviderListResult.java index f58a462c43a59..571b822560ba4 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/TrustedIdProviderListResult.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/TrustedIdProviderListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datalakestore.fluent.models.TrustedIdProviderInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Data Lake Store trusted identity provider list information. */ @Immutable public final class TrustedIdProviderListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TrustedIdProviderListResult.class); - /* * The results of the list operation. */ @@ -28,6 +24,10 @@ public final class TrustedIdProviderListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of TrustedIdProviderListResult class. */ + public TrustedIdProviderListResult() { + } + /** * Get the value property: The results of the list operation. * diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/TrustedIdProviderState.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/TrustedIdProviderState.java index 60dcf8d3487d6..a21e3faa6211b 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/TrustedIdProviderState.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/TrustedIdProviderState.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for TrustedIdProviderState. */ +/** The current state of the trusted identity provider feature for this Data Lake Store account. */ public enum TrustedIdProviderState { /** Enum value Enabled. */ ENABLED("Enabled"), @@ -30,6 +30,9 @@ public enum TrustedIdProviderState { */ @JsonCreator public static TrustedIdProviderState fromString(String value) { + if (value == null) { + return null; + } TrustedIdProviderState[] items = TrustedIdProviderState.values(); for (TrustedIdProviderState item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -39,6 +42,7 @@ public static TrustedIdProviderState fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/TrustedIdProviders.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/TrustedIdProviders.java index 59d1175438d78..f70fc8a2e0b17 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/TrustedIdProviders.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/TrustedIdProviders.java @@ -18,7 +18,8 @@ public interface TrustedIdProviders { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store trusted identity provider list information. + * @return data Lake Store trusted identity provider list information as paginated response with {@link + * PagedIterable}. */ PagedIterable listByAccount(String resourceGroupName, String accountName); @@ -31,7 +32,8 @@ public interface TrustedIdProviders { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store trusted identity provider list information. + * @return data Lake Store trusted identity provider list information as paginated response with {@link + * PagedIterable}. */ PagedIterable listByAccount(String resourceGroupName, String accountName, Context context); @@ -41,12 +43,14 @@ public interface TrustedIdProviders { * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param trustedIdProviderName The name of the trusted identity provider to retrieve. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store trusted identity provider. + * @return the specified Data Lake Store trusted identity provider along with {@link Response}. */ - TrustedIdProvider get(String resourceGroupName, String accountName, String trustedIdProviderName); + Response getWithResponse( + String resourceGroupName, String accountName, String trustedIdProviderName, Context context); /** * Gets the specified Data Lake Store trusted identity provider. @@ -54,14 +58,12 @@ public interface TrustedIdProviders { * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param trustedIdProviderName The name of the trusted identity provider to retrieve. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified Data Lake Store trusted identity provider. */ - Response getWithResponse( - String resourceGroupName, String accountName, String trustedIdProviderName, Context context); + TrustedIdProvider get(String resourceGroupName, String accountName, String trustedIdProviderName); /** * Deletes the specified trusted identity provider from the specified Data Lake Store account. @@ -69,11 +71,14 @@ Response getWithResponse( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param trustedIdProviderName The name of the trusted identity provider to delete. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void delete(String resourceGroupName, String accountName, String trustedIdProviderName); + Response deleteWithResponse( + String resourceGroupName, String accountName, String trustedIdProviderName, Context context); /** * Deletes the specified trusted identity provider from the specified Data Lake Store account. @@ -81,14 +86,11 @@ Response getWithResponse( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param trustedIdProviderName The name of the trusted identity provider to delete. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ - Response deleteWithResponse( - String resourceGroupName, String accountName, String trustedIdProviderName, Context context); + void delete(String resourceGroupName, String accountName, String trustedIdProviderName); /** * Gets the specified Data Lake Store trusted identity provider. @@ -97,7 +99,7 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store trusted identity provider. + * @return the specified Data Lake Store trusted identity provider along with {@link Response}. */ TrustedIdProvider getById(String id); @@ -109,7 +111,7 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store trusted identity provider. + * @return the specified Data Lake Store trusted identity provider along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -131,7 +133,7 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateDataLakeStoreAccountParameters.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateDataLakeStoreAccountParameters.java index bddfb6b56abf4..a0ddc53d1f699 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateDataLakeStoreAccountParameters.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateDataLakeStoreAccountParameters.java @@ -5,89 +5,31 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.datalakestore.fluent.models.UpdateDataLakeStoreAccountProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; /** Data Lake Store account information to update. */ -@JsonFlatten @Fluent -public class UpdateDataLakeStoreAccountParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateDataLakeStoreAccountParameters.class); - +public final class UpdateDataLakeStoreAccountParameters { /* * Resource tags */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* - * The default owner group for all new folders and files created in the - * Data Lake Store account. - */ - @JsonProperty(value = "properties.defaultGroup") - private String defaultGroup; - - /* - * Used for rotation of user managed Key Vault keys. Can only be used to - * rotate a user managed encryption Key Vault key. - */ - @JsonProperty(value = "properties.encryptionConfig") - private UpdateEncryptionConfig encryptionConfig; - - /* - * The list of firewall rules associated with this Data Lake Store account. - */ - @JsonProperty(value = "properties.firewallRules") - private List firewallRules; - - /* - * The list of virtual network rules associated with this Data Lake Store - * account. - */ - @JsonProperty(value = "properties.virtualNetworkRules") - private List virtualNetworkRules; - - /* - * The current state of the IP address firewall for this Data Lake Store - * account. Disabling the firewall does not remove existing rules, they - * will just be ignored until the firewall is re-enabled. - */ - @JsonProperty(value = "properties.firewallState") - private FirewallState firewallState; - - /* - * The current state of allowing or disallowing IPs originating within - * Azure through the firewall. If the firewall is disabled, this is not - * enforced. - */ - @JsonProperty(value = "properties.firewallAllowAzureIps") - private FirewallAllowAzureIpsState firewallAllowAzureIps; - - /* - * The list of trusted identity providers associated with this Data Lake - * Store account. - */ - @JsonProperty(value = "properties.trustedIdProviders") - private List trustedIdProviders; - - /* - * The current state of the trusted identity provider feature for this Data - * Lake Store account. Disabling trusted identity provider functionality - * does not remove the providers, they will just be ignored until this - * feature is re-enabled. + * The Data Lake Store account properties to update. */ - @JsonProperty(value = "properties.trustedIdProviderState") - private TrustedIdProviderState trustedIdProviderState; + @JsonProperty(value = "properties") + private UpdateDataLakeStoreAccountProperties innerProperties; - /* - * The commitment tier to use for next month. - */ - @JsonProperty(value = "properties.newTier") - private TierType newTier; + /** Creates an instance of UpdateDataLakeStoreAccountParameters class. */ + public UpdateDataLakeStoreAccountParameters() { + } /** * Get the tags property: Resource tags. @@ -109,6 +51,15 @@ public UpdateDataLakeStoreAccountParameters withTags(Map tags) { return this; } + /** + * Get the innerProperties property: The Data Lake Store account properties to update. + * + * @return the innerProperties value. + */ + private UpdateDataLakeStoreAccountProperties innerProperties() { + return this.innerProperties; + } + /** * Get the defaultGroup property: The default owner group for all new folders and files created in the Data Lake * Store account. @@ -116,7 +67,7 @@ public UpdateDataLakeStoreAccountParameters withTags(Map tags) { * @return the defaultGroup value. */ public String defaultGroup() { - return this.defaultGroup; + return this.innerProperties() == null ? null : this.innerProperties().defaultGroup(); } /** @@ -127,7 +78,10 @@ public String defaultGroup() { * @return the UpdateDataLakeStoreAccountParameters object itself. */ public UpdateDataLakeStoreAccountParameters withDefaultGroup(String defaultGroup) { - this.defaultGroup = defaultGroup; + if (this.innerProperties() == null) { + this.innerProperties = new UpdateDataLakeStoreAccountProperties(); + } + this.innerProperties().withDefaultGroup(defaultGroup); return this; } @@ -138,7 +92,7 @@ public UpdateDataLakeStoreAccountParameters withDefaultGroup(String defaultGroup * @return the encryptionConfig value. */ public UpdateEncryptionConfig encryptionConfig() { - return this.encryptionConfig; + return this.innerProperties() == null ? null : this.innerProperties().encryptionConfig(); } /** @@ -149,7 +103,10 @@ public UpdateEncryptionConfig encryptionConfig() { * @return the UpdateDataLakeStoreAccountParameters object itself. */ public UpdateDataLakeStoreAccountParameters withEncryptionConfig(UpdateEncryptionConfig encryptionConfig) { - this.encryptionConfig = encryptionConfig; + if (this.innerProperties() == null) { + this.innerProperties = new UpdateDataLakeStoreAccountProperties(); + } + this.innerProperties().withEncryptionConfig(encryptionConfig); return this; } @@ -159,7 +116,7 @@ public UpdateDataLakeStoreAccountParameters withEncryptionConfig(UpdateEncryptio * @return the firewallRules value. */ public List firewallRules() { - return this.firewallRules; + return this.innerProperties() == null ? null : this.innerProperties().firewallRules(); } /** @@ -170,7 +127,10 @@ public List firewallRules() { */ public UpdateDataLakeStoreAccountParameters withFirewallRules( List firewallRules) { - this.firewallRules = firewallRules; + if (this.innerProperties() == null) { + this.innerProperties = new UpdateDataLakeStoreAccountProperties(); + } + this.innerProperties().withFirewallRules(firewallRules); return this; } @@ -181,7 +141,7 @@ public UpdateDataLakeStoreAccountParameters withFirewallRules( * @return the virtualNetworkRules value. */ public List virtualNetworkRules() { - return this.virtualNetworkRules; + return this.innerProperties() == null ? null : this.innerProperties().virtualNetworkRules(); } /** @@ -193,7 +153,10 @@ public List virtualNetworkRules() */ public UpdateDataLakeStoreAccountParameters withVirtualNetworkRules( List virtualNetworkRules) { - this.virtualNetworkRules = virtualNetworkRules; + if (this.innerProperties() == null) { + this.innerProperties = new UpdateDataLakeStoreAccountProperties(); + } + this.innerProperties().withVirtualNetworkRules(virtualNetworkRules); return this; } @@ -205,7 +168,7 @@ public UpdateDataLakeStoreAccountParameters withVirtualNetworkRules( * @return the firewallState value. */ public FirewallState firewallState() { - return this.firewallState; + return this.innerProperties() == null ? null : this.innerProperties().firewallState(); } /** @@ -217,7 +180,10 @@ public FirewallState firewallState() { * @return the UpdateDataLakeStoreAccountParameters object itself. */ public UpdateDataLakeStoreAccountParameters withFirewallState(FirewallState firewallState) { - this.firewallState = firewallState; + if (this.innerProperties() == null) { + this.innerProperties = new UpdateDataLakeStoreAccountProperties(); + } + this.innerProperties().withFirewallState(firewallState); return this; } @@ -228,7 +194,7 @@ public UpdateDataLakeStoreAccountParameters withFirewallState(FirewallState fire * @return the firewallAllowAzureIps value. */ public FirewallAllowAzureIpsState firewallAllowAzureIps() { - return this.firewallAllowAzureIps; + return this.innerProperties() == null ? null : this.innerProperties().firewallAllowAzureIps(); } /** @@ -240,7 +206,10 @@ public FirewallAllowAzureIpsState firewallAllowAzureIps() { */ public UpdateDataLakeStoreAccountParameters withFirewallAllowAzureIps( FirewallAllowAzureIpsState firewallAllowAzureIps) { - this.firewallAllowAzureIps = firewallAllowAzureIps; + if (this.innerProperties() == null) { + this.innerProperties = new UpdateDataLakeStoreAccountProperties(); + } + this.innerProperties().withFirewallAllowAzureIps(firewallAllowAzureIps); return this; } @@ -251,7 +220,7 @@ public UpdateDataLakeStoreAccountParameters withFirewallAllowAzureIps( * @return the trustedIdProviders value. */ public List trustedIdProviders() { - return this.trustedIdProviders; + return this.innerProperties() == null ? null : this.innerProperties().trustedIdProviders(); } /** @@ -263,7 +232,10 @@ public List trustedIdProviders() { */ public UpdateDataLakeStoreAccountParameters withTrustedIdProviders( List trustedIdProviders) { - this.trustedIdProviders = trustedIdProviders; + if (this.innerProperties() == null) { + this.innerProperties = new UpdateDataLakeStoreAccountProperties(); + } + this.innerProperties().withTrustedIdProviders(trustedIdProviders); return this; } @@ -275,7 +247,7 @@ public UpdateDataLakeStoreAccountParameters withTrustedIdProviders( * @return the trustedIdProviderState value. */ public TrustedIdProviderState trustedIdProviderState() { - return this.trustedIdProviderState; + return this.innerProperties() == null ? null : this.innerProperties().trustedIdProviderState(); } /** @@ -288,7 +260,10 @@ public TrustedIdProviderState trustedIdProviderState() { */ public UpdateDataLakeStoreAccountParameters withTrustedIdProviderState( TrustedIdProviderState trustedIdProviderState) { - this.trustedIdProviderState = trustedIdProviderState; + if (this.innerProperties() == null) { + this.innerProperties = new UpdateDataLakeStoreAccountProperties(); + } + this.innerProperties().withTrustedIdProviderState(trustedIdProviderState); return this; } @@ -298,7 +273,7 @@ public UpdateDataLakeStoreAccountParameters withTrustedIdProviderState( * @return the newTier value. */ public TierType newTier() { - return this.newTier; + return this.innerProperties() == null ? null : this.innerProperties().newTier(); } /** @@ -308,7 +283,10 @@ public TierType newTier() { * @return the UpdateDataLakeStoreAccountParameters object itself. */ public UpdateDataLakeStoreAccountParameters withNewTier(TierType newTier) { - this.newTier = newTier; + if (this.innerProperties() == null) { + this.innerProperties = new UpdateDataLakeStoreAccountProperties(); + } + this.innerProperties().withNewTier(newTier); return this; } @@ -318,17 +296,8 @@ public UpdateDataLakeStoreAccountParameters withNewTier(TierType newTier) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (encryptionConfig() != null) { - encryptionConfig().validate(); - } - if (firewallRules() != null) { - firewallRules().forEach(e -> e.validate()); - } - if (virtualNetworkRules() != null) { - virtualNetworkRules().forEach(e -> e.validate()); - } - if (trustedIdProviders() != null) { - trustedIdProviders().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateEncryptionConfig.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateEncryptionConfig.java index 72350a2f58251..f70b0b587d05a 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateEncryptionConfig.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateEncryptionConfig.java @@ -5,21 +5,21 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The encryption configuration used to update a user managed Key Vault key. */ @Fluent public final class UpdateEncryptionConfig { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateEncryptionConfig.class); - /* * The updated Key Vault key to use in user managed key rotation. */ @JsonProperty(value = "keyVaultMetaInfo") private UpdateKeyVaultMetaInfo keyVaultMetaInfo; + /** Creates an instance of UpdateEncryptionConfig class. */ + public UpdateEncryptionConfig() { + } + /** * Get the keyVaultMetaInfo property: The updated Key Vault key to use in user managed key rotation. * diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateFirewallRuleParameters.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateFirewallRuleParameters.java index afe8bcbfd8486..21b2d76ed04c7 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateFirewallRuleParameters.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateFirewallRuleParameters.java @@ -5,30 +5,30 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.datalakestore.fluent.models.UpdateFirewallRuleProperties; import com.fasterxml.jackson.annotation.JsonProperty; /** The parameters used to update a firewall rule. */ -@JsonFlatten @Fluent -public class UpdateFirewallRuleParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateFirewallRuleParameters.class); - +public final class UpdateFirewallRuleParameters { /* - * The start IP address for the firewall rule. This can be either ipv4 or - * ipv6. Start and End should be in the same protocol. + * The firewall rule properties to use when updating a firewall rule. */ - @JsonProperty(value = "properties.startIpAddress") - private String startIpAddress; + @JsonProperty(value = "properties") + private UpdateFirewallRuleProperties innerProperties; - /* - * The end IP address for the firewall rule. This can be either ipv4 or - * ipv6. Start and End should be in the same protocol. + /** Creates an instance of UpdateFirewallRuleParameters class. */ + public UpdateFirewallRuleParameters() { + } + + /** + * Get the innerProperties property: The firewall rule properties to use when updating a firewall rule. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.endIpAddress") - private String endIpAddress; + private UpdateFirewallRuleProperties innerProperties() { + return this.innerProperties; + } /** * Get the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6. @@ -37,7 +37,7 @@ public class UpdateFirewallRuleParameters { * @return the startIpAddress value. */ public String startIpAddress() { - return this.startIpAddress; + return this.innerProperties() == null ? null : this.innerProperties().startIpAddress(); } /** @@ -48,7 +48,10 @@ public String startIpAddress() { * @return the UpdateFirewallRuleParameters object itself. */ public UpdateFirewallRuleParameters withStartIpAddress(String startIpAddress) { - this.startIpAddress = startIpAddress; + if (this.innerProperties() == null) { + this.innerProperties = new UpdateFirewallRuleProperties(); + } + this.innerProperties().withStartIpAddress(startIpAddress); return this; } @@ -59,7 +62,7 @@ public UpdateFirewallRuleParameters withStartIpAddress(String startIpAddress) { * @return the endIpAddress value. */ public String endIpAddress() { - return this.endIpAddress; + return this.innerProperties() == null ? null : this.innerProperties().endIpAddress(); } /** @@ -70,7 +73,10 @@ public String endIpAddress() { * @return the UpdateFirewallRuleParameters object itself. */ public UpdateFirewallRuleParameters withEndIpAddress(String endIpAddress) { - this.endIpAddress = endIpAddress; + if (this.innerProperties() == null) { + this.innerProperties = new UpdateFirewallRuleProperties(); + } + this.innerProperties().withEndIpAddress(endIpAddress); return this; } @@ -80,5 +86,8 @@ public UpdateFirewallRuleParameters withEndIpAddress(String endIpAddress) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateFirewallRuleWithAccountParameters.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateFirewallRuleWithAccountParameters.java index 0c475c249cc6d..54b5d15ff34ec 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateFirewallRuleWithAccountParameters.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateFirewallRuleWithAccountParameters.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.datalakestore.fluent.models.UpdateFirewallRuleProperties; import com.fasterxml.jackson.annotation.JsonProperty; /** The parameters used to update a firewall rule while updating a Data Lake Store account. */ -@JsonFlatten @Fluent -public class UpdateFirewallRuleWithAccountParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateFirewallRuleWithAccountParameters.class); - +public final class UpdateFirewallRuleWithAccountParameters { /* * The unique name of the firewall rule to update. */ @@ -23,18 +19,14 @@ public class UpdateFirewallRuleWithAccountParameters { private String name; /* - * The start IP address for the firewall rule. This can be either ipv4 or - * ipv6. Start and End should be in the same protocol. + * The firewall rule properties to use when updating a firewall rule. */ - @JsonProperty(value = "properties.startIpAddress") - private String startIpAddress; + @JsonProperty(value = "properties") + private UpdateFirewallRuleProperties innerProperties; - /* - * The end IP address for the firewall rule. This can be either ipv4 or - * ipv6. Start and End should be in the same protocol. - */ - @JsonProperty(value = "properties.endIpAddress") - private String endIpAddress; + /** Creates an instance of UpdateFirewallRuleWithAccountParameters class. */ + public UpdateFirewallRuleWithAccountParameters() { + } /** * Get the name property: The unique name of the firewall rule to update. @@ -56,6 +48,15 @@ public UpdateFirewallRuleWithAccountParameters withName(String name) { return this; } + /** + * Get the innerProperties property: The firewall rule properties to use when updating a firewall rule. + * + * @return the innerProperties value. + */ + private UpdateFirewallRuleProperties innerProperties() { + return this.innerProperties; + } + /** * Get the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6. * Start and End should be in the same protocol. @@ -63,7 +64,7 @@ public UpdateFirewallRuleWithAccountParameters withName(String name) { * @return the startIpAddress value. */ public String startIpAddress() { - return this.startIpAddress; + return this.innerProperties() == null ? null : this.innerProperties().startIpAddress(); } /** @@ -74,7 +75,10 @@ public String startIpAddress() { * @return the UpdateFirewallRuleWithAccountParameters object itself. */ public UpdateFirewallRuleWithAccountParameters withStartIpAddress(String startIpAddress) { - this.startIpAddress = startIpAddress; + if (this.innerProperties() == null) { + this.innerProperties = new UpdateFirewallRuleProperties(); + } + this.innerProperties().withStartIpAddress(startIpAddress); return this; } @@ -85,7 +89,7 @@ public UpdateFirewallRuleWithAccountParameters withStartIpAddress(String startIp * @return the endIpAddress value. */ public String endIpAddress() { - return this.endIpAddress; + return this.innerProperties() == null ? null : this.innerProperties().endIpAddress(); } /** @@ -96,7 +100,10 @@ public String endIpAddress() { * @return the UpdateFirewallRuleWithAccountParameters object itself. */ public UpdateFirewallRuleWithAccountParameters withEndIpAddress(String endIpAddress) { - this.endIpAddress = endIpAddress; + if (this.innerProperties() == null) { + this.innerProperties = new UpdateFirewallRuleProperties(); + } + this.innerProperties().withEndIpAddress(endIpAddress); return this; } @@ -107,10 +114,15 @@ public UpdateFirewallRuleWithAccountParameters withEndIpAddress(String endIpAddr */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property name in model UpdateFirewallRuleWithAccountParameters")); } + if (innerProperties() != null) { + innerProperties().validate(); + } } + + private static final ClientLogger LOGGER = new ClientLogger(UpdateFirewallRuleWithAccountParameters.class); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateKeyVaultMetaInfo.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateKeyVaultMetaInfo.java index 06f6305c07ed4..f5f225c9fed9d 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateKeyVaultMetaInfo.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateKeyVaultMetaInfo.java @@ -5,22 +5,21 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The Key Vault update information used for user managed key rotation. */ @Fluent public final class UpdateKeyVaultMetaInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateKeyVaultMetaInfo.class); - /* - * The version of the user managed encryption key to update through a key - * rotation. + * The version of the user managed encryption key to update through a key rotation. */ @JsonProperty(value = "encryptionKeyVersion") private String encryptionKeyVersion; + /** Creates an instance of UpdateKeyVaultMetaInfo class. */ + public UpdateKeyVaultMetaInfo() { + } + /** * Get the encryptionKeyVersion property: The version of the user managed encryption key to update through a key * rotation. diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateTrustedIdProviderParameters.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateTrustedIdProviderParameters.java index f1ebe13d600c3..0f5f8f28a9815 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateTrustedIdProviderParameters.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateTrustedIdProviderParameters.java @@ -5,22 +5,31 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.datalakestore.fluent.models.UpdateTrustedIdProviderProperties; import com.fasterxml.jackson.annotation.JsonProperty; /** The parameters used to update a trusted identity provider. */ -@JsonFlatten @Fluent -public class UpdateTrustedIdProviderParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateTrustedIdProviderParameters.class); - +public final class UpdateTrustedIdProviderParameters { /* - * The URL of this trusted identity provider. + * The trusted identity provider properties to use when updating a trusted identity provider. + */ + @JsonProperty(value = "properties") + private UpdateTrustedIdProviderProperties innerProperties; + + /** Creates an instance of UpdateTrustedIdProviderParameters class. */ + public UpdateTrustedIdProviderParameters() { + } + + /** + * Get the innerProperties property: The trusted identity provider properties to use when updating a trusted + * identity provider. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.idProvider") - private String idProvider; + private UpdateTrustedIdProviderProperties innerProperties() { + return this.innerProperties; + } /** * Get the idProvider property: The URL of this trusted identity provider. @@ -28,7 +37,7 @@ public class UpdateTrustedIdProviderParameters { * @return the idProvider value. */ public String idProvider() { - return this.idProvider; + return this.innerProperties() == null ? null : this.innerProperties().idProvider(); } /** @@ -38,7 +47,10 @@ public String idProvider() { * @return the UpdateTrustedIdProviderParameters object itself. */ public UpdateTrustedIdProviderParameters withIdProvider(String idProvider) { - this.idProvider = idProvider; + if (this.innerProperties() == null) { + this.innerProperties = new UpdateTrustedIdProviderProperties(); + } + this.innerProperties().withIdProvider(idProvider); return this; } @@ -48,5 +60,8 @@ public UpdateTrustedIdProviderParameters withIdProvider(String idProvider) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateTrustedIdProviderWithAccountParameters.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateTrustedIdProviderWithAccountParameters.java index 2f68bad69f8ee..2ccc986c149e2 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateTrustedIdProviderWithAccountParameters.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateTrustedIdProviderWithAccountParameters.java @@ -5,18 +5,13 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.datalakestore.fluent.models.UpdateTrustedIdProviderProperties; import com.fasterxml.jackson.annotation.JsonProperty; /** The parameters used to update a trusted identity provider while updating a Data Lake Store account. */ -@JsonFlatten @Fluent -public class UpdateTrustedIdProviderWithAccountParameters { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(UpdateTrustedIdProviderWithAccountParameters.class); - +public final class UpdateTrustedIdProviderWithAccountParameters { /* * The unique name of the trusted identity provider to update. */ @@ -24,10 +19,14 @@ public class UpdateTrustedIdProviderWithAccountParameters { private String name; /* - * The URL of this trusted identity provider. + * The trusted identity provider properties to use when updating a trusted identity provider. */ - @JsonProperty(value = "properties.idProvider") - private String idProvider; + @JsonProperty(value = "properties") + private UpdateTrustedIdProviderProperties innerProperties; + + /** Creates an instance of UpdateTrustedIdProviderWithAccountParameters class. */ + public UpdateTrustedIdProviderWithAccountParameters() { + } /** * Get the name property: The unique name of the trusted identity provider to update. @@ -49,13 +48,23 @@ public UpdateTrustedIdProviderWithAccountParameters withName(String name) { return this; } + /** + * Get the innerProperties property: The trusted identity provider properties to use when updating a trusted + * identity provider. + * + * @return the innerProperties value. + */ + private UpdateTrustedIdProviderProperties innerProperties() { + return this.innerProperties; + } + /** * Get the idProvider property: The URL of this trusted identity provider. * * @return the idProvider value. */ public String idProvider() { - return this.idProvider; + return this.innerProperties() == null ? null : this.innerProperties().idProvider(); } /** @@ -65,7 +74,10 @@ public String idProvider() { * @return the UpdateTrustedIdProviderWithAccountParameters object itself. */ public UpdateTrustedIdProviderWithAccountParameters withIdProvider(String idProvider) { - this.idProvider = idProvider; + if (this.innerProperties() == null) { + this.innerProperties = new UpdateTrustedIdProviderProperties(); + } + this.innerProperties().withIdProvider(idProvider); return this; } @@ -76,10 +88,15 @@ public UpdateTrustedIdProviderWithAccountParameters withIdProvider(String idProv */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property name in model UpdateTrustedIdProviderWithAccountParameters")); } + if (innerProperties() != null) { + innerProperties().validate(); + } } + + private static final ClientLogger LOGGER = new ClientLogger(UpdateTrustedIdProviderWithAccountParameters.class); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateVirtualNetworkRuleParameters.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateVirtualNetworkRuleParameters.java index 1f39fbc89a054..23a8702987506 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateVirtualNetworkRuleParameters.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateVirtualNetworkRuleParameters.java @@ -5,22 +5,31 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.datalakestore.fluent.models.UpdateVirtualNetworkRuleProperties; import com.fasterxml.jackson.annotation.JsonProperty; /** The parameters used to update a virtual network rule. */ -@JsonFlatten @Fluent -public class UpdateVirtualNetworkRuleParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateVirtualNetworkRuleParameters.class); - +public final class UpdateVirtualNetworkRuleParameters { /* - * The resource identifier for the subnet. + * The virtual network rule properties to use when updating a virtual network rule. + */ + @JsonProperty(value = "properties") + private UpdateVirtualNetworkRuleProperties innerProperties; + + /** Creates an instance of UpdateVirtualNetworkRuleParameters class. */ + public UpdateVirtualNetworkRuleParameters() { + } + + /** + * Get the innerProperties property: The virtual network rule properties to use when updating a virtual network + * rule. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.subnetId") - private String subnetId; + private UpdateVirtualNetworkRuleProperties innerProperties() { + return this.innerProperties; + } /** * Get the subnetId property: The resource identifier for the subnet. @@ -28,7 +37,7 @@ public class UpdateVirtualNetworkRuleParameters { * @return the subnetId value. */ public String subnetId() { - return this.subnetId; + return this.innerProperties() == null ? null : this.innerProperties().subnetId(); } /** @@ -38,7 +47,10 @@ public String subnetId() { * @return the UpdateVirtualNetworkRuleParameters object itself. */ public UpdateVirtualNetworkRuleParameters withSubnetId(String subnetId) { - this.subnetId = subnetId; + if (this.innerProperties() == null) { + this.innerProperties = new UpdateVirtualNetworkRuleProperties(); + } + this.innerProperties().withSubnetId(subnetId); return this; } @@ -48,5 +60,8 @@ public UpdateVirtualNetworkRuleParameters withSubnetId(String subnetId) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateVirtualNetworkRuleWithAccountParameters.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateVirtualNetworkRuleWithAccountParameters.java index a2e34927822d6..906f843c0a522 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateVirtualNetworkRuleWithAccountParameters.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UpdateVirtualNetworkRuleWithAccountParameters.java @@ -5,18 +5,13 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.datalakestore.fluent.models.UpdateVirtualNetworkRuleProperties; import com.fasterxml.jackson.annotation.JsonProperty; /** The parameters used to update a virtual network rule while updating a Data Lake Store account. */ -@JsonFlatten @Fluent -public class UpdateVirtualNetworkRuleWithAccountParameters { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(UpdateVirtualNetworkRuleWithAccountParameters.class); - +public final class UpdateVirtualNetworkRuleWithAccountParameters { /* * The unique name of the virtual network rule to update. */ @@ -24,10 +19,14 @@ public class UpdateVirtualNetworkRuleWithAccountParameters { private String name; /* - * The resource identifier for the subnet. + * The virtual network rule properties to use when updating a virtual network rule. */ - @JsonProperty(value = "properties.subnetId") - private String subnetId; + @JsonProperty(value = "properties") + private UpdateVirtualNetworkRuleProperties innerProperties; + + /** Creates an instance of UpdateVirtualNetworkRuleWithAccountParameters class. */ + public UpdateVirtualNetworkRuleWithAccountParameters() { + } /** * Get the name property: The unique name of the virtual network rule to update. @@ -49,13 +48,23 @@ public UpdateVirtualNetworkRuleWithAccountParameters withName(String name) { return this; } + /** + * Get the innerProperties property: The virtual network rule properties to use when updating a virtual network + * rule. + * + * @return the innerProperties value. + */ + private UpdateVirtualNetworkRuleProperties innerProperties() { + return this.innerProperties; + } + /** * Get the subnetId property: The resource identifier for the subnet. * * @return the subnetId value. */ public String subnetId() { - return this.subnetId; + return this.innerProperties() == null ? null : this.innerProperties().subnetId(); } /** @@ -65,7 +74,10 @@ public String subnetId() { * @return the UpdateVirtualNetworkRuleWithAccountParameters object itself. */ public UpdateVirtualNetworkRuleWithAccountParameters withSubnetId(String subnetId) { - this.subnetId = subnetId; + if (this.innerProperties() == null) { + this.innerProperties = new UpdateVirtualNetworkRuleProperties(); + } + this.innerProperties().withSubnetId(subnetId); return this; } @@ -76,10 +88,15 @@ public UpdateVirtualNetworkRuleWithAccountParameters withSubnetId(String subnetI */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property name in model UpdateVirtualNetworkRuleWithAccountParameters")); } + if (innerProperties() != null) { + innerProperties().validate(); + } } + + private static final ClientLogger LOGGER = new ClientLogger(UpdateVirtualNetworkRuleWithAccountParameters.class); } diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UsageListResult.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UsageListResult.java index 0bccc409fda82..1956422b98e91 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UsageListResult.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UsageListResult.java @@ -5,23 +5,23 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datalakestore.fluent.models.UsageInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The response from the List Usages operation. */ @Fluent public final class UsageListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageListResult.class); - /* * Gets or sets the list of Storage Resource Usages. */ @JsonProperty(value = "value") private List value; + /** Creates an instance of UsageListResult class. */ + public UsageListResult() { + } + /** * Get the value property: Gets or sets the list of Storage Resource Usages. * diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UsageName.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UsageName.java index 18b3e8225e13e..3eb61e09e3485 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UsageName.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UsageName.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The usage names that can be used. */ @Immutable public final class UsageName { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageName.class); - /* * Gets a string describing the resource name. */ @@ -26,6 +22,10 @@ public final class UsageName { @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) private String localizedValue; + /** Creates an instance of UsageName class. */ + public UsageName() { + } + /** * Get the value property: Gets a string describing the resource name. * diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UsageUnit.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UsageUnit.java index ad7371c6d282a..677f106776c96 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UsageUnit.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/UsageUnit.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** Defines values for UsageUnit. */ +/** Gets the unit of measurement. */ public enum UsageUnit { /** Enum value Count. */ COUNT("Count"), @@ -42,6 +42,9 @@ public enum UsageUnit { */ @JsonCreator public static UsageUnit fromString(String value) { + if (value == null) { + return null; + } UsageUnit[] items = UsageUnit.values(); for (UsageUnit item : items) { if (item.toString().equalsIgnoreCase(value)) { @@ -51,6 +54,7 @@ public static UsageUnit fromString(String value) { return null; } + /** {@inheritDoc} */ @JsonValue @Override public String toString() { diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/VirtualNetworkRule.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/VirtualNetworkRule.java index 7f11647cf4b0b..8ed17e5be66dc 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/VirtualNetworkRule.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/VirtualNetworkRule.java @@ -16,13 +16,6 @@ public interface VirtualNetworkRule { */ String id(); - /** - * Gets the subnetId property: The resource identifier for the subnet. - * - * @return the subnetId value. - */ - String subnetId(); - /** * Gets the name property: The resource name. * @@ -37,6 +30,20 @@ public interface VirtualNetworkRule { */ String type(); + /** + * Gets the subnetId property: The resource identifier for the subnet. + * + * @return the subnetId value. + */ + String subnetId(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.datalakestore.fluent.models.VirtualNetworkRuleInner object. * diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/VirtualNetworkRuleListResult.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/VirtualNetworkRuleListResult.java index 8fb836119a127..4d2080626fc34 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/VirtualNetworkRuleListResult.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/VirtualNetworkRuleListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.datalakestore.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datalakestore.fluent.models.VirtualNetworkRuleInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Data Lake Store virtual network rule list information. */ @Immutable public final class VirtualNetworkRuleListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkRuleListResult.class); - /* * The results of the list operation. */ @@ -28,6 +24,10 @@ public final class VirtualNetworkRuleListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of VirtualNetworkRuleListResult class. */ + public VirtualNetworkRuleListResult() { + } + /** * Get the value property: The results of the list operation. * diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/VirtualNetworkRules.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/VirtualNetworkRules.java index f813819050d9c..550f29fc7b512 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/VirtualNetworkRules.java +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/models/VirtualNetworkRules.java @@ -18,7 +18,7 @@ public interface VirtualNetworkRules { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store virtual network rule list information. + * @return data Lake Store virtual network rule list information as paginated response with {@link PagedIterable}. */ PagedIterable listByAccount(String resourceGroupName, String accountName); @@ -31,7 +31,7 @@ public interface VirtualNetworkRules { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data Lake Store virtual network rule list information. + * @return data Lake Store virtual network rule list information as paginated response with {@link PagedIterable}. */ PagedIterable listByAccount(String resourceGroupName, String accountName, Context context); @@ -41,12 +41,14 @@ public interface VirtualNetworkRules { * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param virtualNetworkRuleName The name of the virtual network rule to retrieve. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store virtual network rule. + * @return the specified Data Lake Store virtual network rule along with {@link Response}. */ - VirtualNetworkRule get(String resourceGroupName, String accountName, String virtualNetworkRuleName); + Response getWithResponse( + String resourceGroupName, String accountName, String virtualNetworkRuleName, Context context); /** * Gets the specified Data Lake Store virtual network rule. @@ -54,14 +56,12 @@ public interface VirtualNetworkRules { * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param virtualNetworkRuleName The name of the virtual network rule to retrieve. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified Data Lake Store virtual network rule. */ - Response getWithResponse( - String resourceGroupName, String accountName, String virtualNetworkRuleName, Context context); + VirtualNetworkRule get(String resourceGroupName, String accountName, String virtualNetworkRuleName); /** * Deletes the specified virtual network rule from the specified Data Lake Store account. @@ -69,11 +69,14 @@ Response getWithResponse( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param virtualNetworkRuleName The name of the virtual network rule to delete. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void delete(String resourceGroupName, String accountName, String virtualNetworkRuleName); + Response deleteWithResponse( + String resourceGroupName, String accountName, String virtualNetworkRuleName, Context context); /** * Deletes the specified virtual network rule from the specified Data Lake Store account. @@ -81,14 +84,11 @@ Response getWithResponse( * @param resourceGroupName The name of the Azure resource group. * @param accountName The name of the Data Lake Store account. * @param virtualNetworkRuleName The name of the virtual network rule to delete. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ - Response deleteWithResponse( - String resourceGroupName, String accountName, String virtualNetworkRuleName, Context context); + void delete(String resourceGroupName, String accountName, String virtualNetworkRuleName); /** * Gets the specified Data Lake Store virtual network rule. @@ -97,7 +97,7 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store virtual network rule. + * @return the specified Data Lake Store virtual network rule along with {@link Response}. */ VirtualNetworkRule getById(String id); @@ -109,7 +109,7 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Data Lake Store virtual network rule. + * @return the specified Data Lake Store virtual network rule along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -131,7 +131,7 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsCheckNameAvailabilitySamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsCheckNameAvailabilitySamples.java new file mode 100644 index 0000000000000..fc4000ca2ec34 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsCheckNameAvailabilitySamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.resourcemanager.datalakestore.models.CheckNameAvailabilityParameters; + +/** Samples for Accounts CheckNameAvailability. */ +public final class AccountsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Accounts_CheckNameAvailability.json + */ + /** + * Sample code: Checks whether the specified account name is available or taken. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void checksWhetherTheSpecifiedAccountNameIsAvailableOrTaken( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .accounts() + .checkNameAvailabilityWithResponse( + "EastUS2", + new CheckNameAvailabilityParameters().withName("contosoadla"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsCreateSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsCreateSamples.java new file mode 100644 index 0000000000000..872a5b43c6297 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsCreateSamples.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.resourcemanager.datalakestore.models.CreateFirewallRuleWithAccountParameters; +import com.azure.resourcemanager.datalakestore.models.CreateTrustedIdProviderWithAccountParameters; +import com.azure.resourcemanager.datalakestore.models.EncryptionConfig; +import com.azure.resourcemanager.datalakestore.models.EncryptionConfigType; +import com.azure.resourcemanager.datalakestore.models.EncryptionIdentity; +import com.azure.resourcemanager.datalakestore.models.EncryptionState; +import com.azure.resourcemanager.datalakestore.models.FirewallAllowAzureIpsState; +import com.azure.resourcemanager.datalakestore.models.FirewallState; +import com.azure.resourcemanager.datalakestore.models.KeyVaultMetaInfo; +import com.azure.resourcemanager.datalakestore.models.TierType; +import com.azure.resourcemanager.datalakestore.models.TrustedIdProviderState; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Accounts Create. */ +public final class AccountsCreateSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Accounts_Create.json + */ + /** + * Sample code: Creates the specified Data Lake Store account. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void createsTheSpecifiedDataLakeStoreAccount( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .accounts() + .define("contosoadla") + .withRegion("eastus2") + .withExistingResourceGroup("contosorg") + .withTags(mapOf("test_key", "test_value")) + .withIdentity(new EncryptionIdentity()) + .withDefaultGroup("test_default_group") + .withEncryptionConfig( + new EncryptionConfig() + .withType(EncryptionConfigType.USER_MANAGED) + .withKeyVaultMetaInfo( + new KeyVaultMetaInfo() + .withKeyVaultResourceId("fakeTokenPlaceholder") + .withEncryptionKeyName("fakeTokenPlaceholder") + .withEncryptionKeyVersion("fakeTokenPlaceholder"))) + .withEncryptionState(EncryptionState.ENABLED) + .withFirewallRules( + Arrays + .asList( + new CreateFirewallRuleWithAccountParameters() + .withName("test_rule") + .withStartIpAddress("1.1.1.1") + .withEndIpAddress("2.2.2.2"))) + .withFirewallState(FirewallState.ENABLED) + .withFirewallAllowAzureIps(FirewallAllowAzureIpsState.ENABLED) + .withTrustedIdProviders( + Arrays + .asList( + new CreateTrustedIdProviderWithAccountParameters() + .withName("test_trusted_id_provider_name") + .withIdProvider("https://sts.windows.net/ea9ec534-a3e3-4e45-ad36-3afc5bb291c1"))) + .withTrustedIdProviderState(TrustedIdProviderState.ENABLED) + .withNewTier(TierType.CONSUMPTION) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsDeleteSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsDeleteSamples.java new file mode 100644 index 0000000000000..e40fbca4b8260 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +/** Samples for Accounts Delete. */ +public final class AccountsDeleteSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Accounts_Delete.json + */ + /** + * Sample code: Deletes the specified Data Lake Store account. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void deletesTheSpecifiedDataLakeStoreAccount( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager.accounts().delete("contosorg", "contosoadla", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsEnableKeyVaultSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsEnableKeyVaultSamples.java new file mode 100644 index 0000000000000..e84ade5e7694a --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsEnableKeyVaultSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +/** Samples for Accounts EnableKeyVault. */ +public final class AccountsEnableKeyVaultSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Accounts_EnableKeyVault.json + */ + /** + * Sample code: Attempts to enable a user managed Key Vault for encryption of the specified Data Lake Store account. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void attemptsToEnableAUserManagedKeyVaultForEncryptionOfTheSpecifiedDataLakeStoreAccount( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager.accounts().enableKeyVaultWithResponse("contosorg", "contosoadla", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsGetByResourceGroupSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..9a36ad8ed8deb --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsGetByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +/** Samples for Accounts GetByResourceGroup. */ +public final class AccountsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Accounts_Get.json + */ + /** + * Sample code: Gets the specified Data Lake Store account. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void getsTheSpecifiedDataLakeStoreAccount( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager.accounts().getByResourceGroupWithResponse("contosorg", "contosoadla", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsListByResourceGroupSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..119730b37be83 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsListByResourceGroupSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +/** Samples for Accounts ListByResourceGroup. */ +public final class AccountsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Accounts_ListByResourceGroup.json + */ + /** + * Sample code: Lists the Data Lake Store accounts within a specific resource group. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void listsTheDataLakeStoreAccountsWithinASpecificResourceGroup( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .accounts() + .listByResourceGroup( + "contosorg", + "test_filter", + 1, + 1, + "test_select", + "test_orderby", + false, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsListSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsListSamples.java new file mode 100644 index 0000000000000..121343dc34a44 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +/** Samples for Accounts List. */ +public final class AccountsListSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Accounts_List.json + */ + /** + * Sample code: Lists the Data Lake Store accounts within the subscription. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void listsTheDataLakeStoreAccountsWithinTheSubscription( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .accounts() + .list("test_filter", 1, 1, "test_select", "test_orderby", false, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsUpdateSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsUpdateSamples.java new file mode 100644 index 0000000000000..ba7eea42f0d98 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/AccountsUpdateSamples.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.resourcemanager.datalakestore.models.DataLakeStoreAccount; +import com.azure.resourcemanager.datalakestore.models.FirewallAllowAzureIpsState; +import com.azure.resourcemanager.datalakestore.models.FirewallState; +import com.azure.resourcemanager.datalakestore.models.TierType; +import com.azure.resourcemanager.datalakestore.models.TrustedIdProviderState; +import com.azure.resourcemanager.datalakestore.models.UpdateEncryptionConfig; +import com.azure.resourcemanager.datalakestore.models.UpdateKeyVaultMetaInfo; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Accounts Update. */ +public final class AccountsUpdateSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Accounts_Update.json + */ + /** + * Sample code: Updates the specified Data Lake Store account information. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void updatesTheSpecifiedDataLakeStoreAccountInformation( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + DataLakeStoreAccount resource = + manager + .accounts() + .getByResourceGroupWithResponse("contosorg", "contosoadla", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("test_key", "test_value")) + .withDefaultGroup("test_default_group") + .withEncryptionConfig( + new UpdateEncryptionConfig() + .withKeyVaultMetaInfo( + new UpdateKeyVaultMetaInfo().withEncryptionKeyVersion("fakeTokenPlaceholder"))) + .withFirewallState(FirewallState.ENABLED) + .withFirewallAllowAzureIps(FirewallAllowAzureIpsState.ENABLED) + .withTrustedIdProviderState(TrustedIdProviderState.ENABLED) + .withNewTier(TierType.CONSUMPTION) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesCreateOrUpdateSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..8abcfd7ed8322 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesCreateOrUpdateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +/** Samples for FirewallRules CreateOrUpdate. */ +public final class FirewallRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/FirewallRules_CreateOrUpdate.json + */ + /** + * Sample code: Creates or updates the specified firewall rule. During update, the firewall rule with the specified + * name will be replaced with this new firewall rule. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void + createsOrUpdatesTheSpecifiedFirewallRuleDuringUpdateTheFirewallRuleWithTheSpecifiedNameWillBeReplacedWithThisNewFirewallRule( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .firewallRules() + .define("test_rule") + .withExistingAccount("contosorg", "contosoadla") + .withStartIpAddress("1.1.1.1") + .withEndIpAddress("2.2.2.2") + .create(); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesDeleteSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesDeleteSamples.java new file mode 100644 index 0000000000000..1c8a2a40dd943 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +/** Samples for FirewallRules Delete. */ +public final class FirewallRulesDeleteSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/FirewallRules_Delete.json + */ + /** + * Sample code: Deletes the specified firewall rule from the specified Data Lake Store account. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void deletesTheSpecifiedFirewallRuleFromTheSpecifiedDataLakeStoreAccount( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .firewallRules() + .deleteWithResponse("contosorg", "contosoadla", "test_rule", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesGetSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesGetSamples.java new file mode 100644 index 0000000000000..334a0abd3b108 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +/** Samples for FirewallRules Get. */ +public final class FirewallRulesGetSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/FirewallRules_Get.json + */ + /** + * Sample code: Gets the specified Data Lake Store firewall rule. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void getsTheSpecifiedDataLakeStoreFirewallRule( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .firewallRules() + .getWithResponse("contosorg", "contosoadla", "test_rule", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesListByAccountSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesListByAccountSamples.java new file mode 100644 index 0000000000000..801243354c96e --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesListByAccountSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +/** Samples for FirewallRules ListByAccount. */ +public final class FirewallRulesListByAccountSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/FirewallRules_ListByAccount.json + */ + /** + * Sample code: Lists the Data Lake Store firewall rules within the specified Data Lake Store account. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void listsTheDataLakeStoreFirewallRulesWithinTheSpecifiedDataLakeStoreAccount( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager.firewallRules().listByAccount("contosorg", "contosoadla", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesUpdateSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesUpdateSamples.java new file mode 100644 index 0000000000000..00759f0a0f66a --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.resourcemanager.datalakestore.models.FirewallRule; + +/** Samples for FirewallRules Update. */ +public final class FirewallRulesUpdateSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/FirewallRules_Update.json + */ + /** + * Sample code: Updates the specified firewall rule. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void updatesTheSpecifiedFirewallRule( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + FirewallRule resource = + manager + .firewallRules() + .getWithResponse("contosorg", "contosoadla", "test_rule", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withStartIpAddress("1.1.1.1").withEndIpAddress("2.2.2.2").apply(); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/LocationsGetCapabilitySamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/LocationsGetCapabilitySamples.java new file mode 100644 index 0000000000000..e7743b26cbccd --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/LocationsGetCapabilitySamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +/** Samples for Locations GetCapability. */ +public final class LocationsGetCapabilitySamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Locations_GetCapability.json + */ + /** + * Sample code: Gets subscription-level properties and limits for Data Lake Store specified by resource location. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void getsSubscriptionLevelPropertiesAndLimitsForDataLakeStoreSpecifiedByResourceLocation( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager.locations().getCapabilityWithResponse("EastUS2", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/LocationsGetUsageSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/LocationsGetUsageSamples.java new file mode 100644 index 0000000000000..c080f1f0044b0 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/LocationsGetUsageSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +/** Samples for Locations GetUsage. */ +public final class LocationsGetUsageSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Locations_GetUsage.json + */ + /** + * Sample code: UsageList. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void usageList(com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager.locations().getUsage("WestUS", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/OperationsListSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..057a6589eed34 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/OperationsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/Operations_List.json + */ + /** + * Sample code: Lists all of the available Data Lake Store REST API operations. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void listsAllOfTheAvailableDataLakeStoreRESTAPIOperations( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager.operations().listWithResponse(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersCreateOrUpdateSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..f7161ce460d9e --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersCreateOrUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +/** Samples for TrustedIdProviders CreateOrUpdate. */ +public final class TrustedIdProvidersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/TrustedIdProviders_CreateOrUpdate.json + */ + /** + * Sample code: Creates or updates the specified trusted identity provider. During update, the trusted identity + * provider with the specified name will be replaced with this new provider. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void + createsOrUpdatesTheSpecifiedTrustedIdentityProviderDuringUpdateTheTrustedIdentityProviderWithTheSpecifiedNameWillBeReplacedWithThisNewProvider( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .trustedIdProviders() + .define("test_trusted_id_provider_name") + .withExistingAccount("contosorg", "contosoadla") + .withIdProvider("https://sts.windows.net/ea9ec534-a3e3-4e45-ad36-3afc5bb291c1") + .create(); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersDeleteSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersDeleteSamples.java new file mode 100644 index 0000000000000..47c99dbd96df8 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +/** Samples for TrustedIdProviders Delete. */ +public final class TrustedIdProvidersDeleteSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/TrustedIdProviders_Delete.json + */ + /** + * Sample code: Deletes the specified trusted identity provider from the specified Data Lake Store account. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void deletesTheSpecifiedTrustedIdentityProviderFromTheSpecifiedDataLakeStoreAccount( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .trustedIdProviders() + .deleteWithResponse( + "contosorg", "contosoadla", "test_trusted_id_provider_name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersGetSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersGetSamples.java new file mode 100644 index 0000000000000..740319a4cd100 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +/** Samples for TrustedIdProviders Get. */ +public final class TrustedIdProvidersGetSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/TrustedIdProviders_Get.json + */ + /** + * Sample code: Gets the specified Data Lake Store trusted identity provider. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void getsTheSpecifiedDataLakeStoreTrustedIdentityProvider( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .trustedIdProviders() + .getWithResponse( + "contosorg", "contosoadla", "test_trusted_id_provider_name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersListByAccountSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersListByAccountSamples.java new file mode 100644 index 0000000000000..be395bf3d9b7c --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersListByAccountSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +/** Samples for TrustedIdProviders ListByAccount. */ +public final class TrustedIdProvidersListByAccountSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/TrustedIdProviders_ListByAccount.json + */ + /** + * Sample code: Lists the Data Lake Store trusted identity providers within the specified Data Lake Store account. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void listsTheDataLakeStoreTrustedIdentityProvidersWithinTheSpecifiedDataLakeStoreAccount( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager.trustedIdProviders().listByAccount("contosorg", "contosoadla", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersUpdateSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersUpdateSamples.java new file mode 100644 index 0000000000000..5844682d561f4 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersUpdateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.resourcemanager.datalakestore.models.TrustedIdProvider; + +/** Samples for TrustedIdProviders Update. */ +public final class TrustedIdProvidersUpdateSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/TrustedIdProviders_Update.json + */ + /** + * Sample code: Updates the specified trusted identity provider. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void updatesTheSpecifiedTrustedIdentityProvider( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + TrustedIdProvider resource = + manager + .trustedIdProviders() + .getWithResponse( + "contosorg", "contosoadla", "test_trusted_id_provider_name", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withIdProvider("https://sts.windows.net/ea9ec534-a3e3-4e45-ad36-3afc5bb291c1").apply(); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesCreateOrUpdateSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..e6f64f2688d96 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesCreateOrUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +/** Samples for VirtualNetworkRules CreateOrUpdate. */ +public final class VirtualNetworkRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/VirtualNetworkRules_CreateOrUpdate.json + */ + /** + * Sample code: Creates or updates the specified virtual network rule. During update, the virtual network rule with + * the specified name will be replaced with this new virtual network rule. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void + createsOrUpdatesTheSpecifiedVirtualNetworkRuleDuringUpdateTheVirtualNetworkRuleWithTheSpecifiedNameWillBeReplacedWithThisNewVirtualNetworkRule( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .virtualNetworkRules() + .define("test_virtual_network_rules_name") + .withExistingAccount("contosorg", "contosoadla") + .withSubnetId("test_subnetId") + .create(); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesDeleteSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesDeleteSamples.java new file mode 100644 index 0000000000000..4f46d7a49eeca --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +/** Samples for VirtualNetworkRules Delete. */ +public final class VirtualNetworkRulesDeleteSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/VirtualNetworkRules_Delete.json + */ + /** + * Sample code: Deletes the specified virtual network rule from the specified Data Lake Store account. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void deletesTheSpecifiedVirtualNetworkRuleFromTheSpecifiedDataLakeStoreAccount( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .virtualNetworkRules() + .deleteWithResponse( + "contosorg", "contosoadla", "test_virtual_network_rules_name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesGetSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesGetSamples.java new file mode 100644 index 0000000000000..6c164e8934052 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +/** Samples for VirtualNetworkRules Get. */ +public final class VirtualNetworkRulesGetSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/VirtualNetworkRules_Get.json + */ + /** + * Sample code: Gets the specified Data Lake Store virtual network rule. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void getsTheSpecifiedDataLakeStoreVirtualNetworkRule( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager + .virtualNetworkRules() + .getWithResponse( + "contosorg", "contosoadla", "test_virtual_network_rules_name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesListByAccountSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesListByAccountSamples.java new file mode 100644 index 0000000000000..b834c6150507d --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesListByAccountSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +/** Samples for VirtualNetworkRules ListByAccount. */ +public final class VirtualNetworkRulesListByAccountSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/VirtualNetworkRules_ListByAccount.json + */ + /** + * Sample code: Lists the Data Lake Store virtual network rules within the specified Data Lake Store account. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void listsTheDataLakeStoreVirtualNetworkRulesWithinTheSpecifiedDataLakeStoreAccount( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + manager.virtualNetworkRules().listByAccount("contosorg", "contosoadla", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesUpdateSamples.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesUpdateSamples.java new file mode 100644 index 0000000000000..537f4ffdb3ae7 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/samples/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesUpdateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.resourcemanager.datalakestore.models.VirtualNetworkRule; + +/** Samples for VirtualNetworkRules Update. */ +public final class VirtualNetworkRulesUpdateSamples { + /* + * x-ms-original-file: specification/datalake-store/resource-manager/Microsoft.DataLakeStore/stable/2016-11-01/examples/VirtualNetworkRules_Update.json + */ + /** + * Sample code: Updates the specified virtual network rule. + * + * @param manager Entry point to DataLakeStoreManager. + */ + public static void updatesTheSpecifiedVirtualNetworkRule( + com.azure.resourcemanager.datalakestore.DataLakeStoreManager manager) { + VirtualNetworkRule resource = + manager + .virtualNetworkRules() + .getWithResponse( + "contosorg", "contosoadla", "test_virtual_network_rules_name", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withSubnetId("test_subnetId").apply(); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/AccountsCheckNameAvailabilityWithResponseMockTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/AccountsCheckNameAvailabilityWithResponseMockTests.java new file mode 100644 index 0000000000000..bf242cc4cbb64 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/AccountsCheckNameAvailabilityWithResponseMockTests.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.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.datalakestore.DataLakeStoreManager; +import com.azure.resourcemanager.datalakestore.models.CheckNameAvailabilityParameters; +import com.azure.resourcemanager.datalakestore.models.NameAvailabilityInformation; +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 AccountsCheckNameAvailabilityWithResponseMockTests { + @Test + public void testCheckNameAvailabilityWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{\"nameAvailable\":true,\"reason\":\"bh\",\"message\":\"nlankxmyskpb\"}"; + + 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); + })); + + DataLakeStoreManager manager = + DataLakeStoreManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + NameAvailabilityInformation response = + manager + .accounts() + .checkNameAvailabilityWithResponse( + "arbu", + new CheckNameAvailabilityParameters().withName("rcvpnazzmhjrunmp"), + com.azure.core.util.Context.NONE) + .getValue(); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/AccountsCreateMockTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/AccountsCreateMockTests.java new file mode 100644 index 0000000000000..4a0cda384e7d8 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/AccountsCreateMockTests.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.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.datalakestore.DataLakeStoreManager; +import com.azure.resourcemanager.datalakestore.models.DataLakeStoreAccount; +import com.azure.resourcemanager.datalakestore.models.EncryptionConfig; +import com.azure.resourcemanager.datalakestore.models.EncryptionConfigType; +import com.azure.resourcemanager.datalakestore.models.EncryptionIdentity; +import com.azure.resourcemanager.datalakestore.models.EncryptionState; +import com.azure.resourcemanager.datalakestore.models.FirewallAllowAzureIpsState; +import com.azure.resourcemanager.datalakestore.models.FirewallState; +import com.azure.resourcemanager.datalakestore.models.TierType; +import com.azure.resourcemanager.datalakestore.models.TrustedIdProviderState; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class AccountsCreateMockTests { + @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 = + "{\"identity\":{\"principalId\":\"a17186ff-d35b-4bd3-9614-5969b7152240\",\"tenantId\":\"91d96eca-fb1d-40ca-aa78-3b7373123724\"},\"properties\":{\"defaultGroup\":\"pgn\",\"encryptionConfig\":{\"type\":\"UserManaged\"},\"encryptionState\":\"Enabled\",\"encryptionProvisioningState\":\"Creating\",\"firewallRules\":[],\"virtualNetworkRules\":[],\"firewallState\":\"Enabled\",\"firewallAllowAzureIps\":\"Disabled\",\"trustedIdProviders\":[],\"trustedIdProviderState\":\"Enabled\",\"newTier\":\"Commitment_1PB\",\"currentTier\":\"Commitment_10TB\",\"accountId\":\"b39e2aaf-53a6-4ad3-a232-5a274c532e1b\",\"provisioningState\":\"Succeeded\",\"state\":\"Active\",\"creationTime\":\"2021-06-27T19:00:45Z\",\"lastModifiedTime\":\"2021-12-07T02:31:05Z\",\"endpoint\":\"plwzbhvgyugu\"},\"location\":\"svmkfssxquk\",\"tags\":{\"mg\":\"l\",\"vlopwiyighx\":\"xnkjzkdesl\",\"upedeojnabckhs\":\"kdwzbaiuebbaumny\"},\"id\":\"txp\",\"name\":\"ie\",\"type\":\"tfhvpesapskrdqmh\"}"; + + 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); + })); + + DataLakeStoreManager manager = + DataLakeStoreManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + DataLakeStoreAccount response = + manager + .accounts() + .define("nrs") + .withRegion("nlqidybyxczf") + .withExistingResourceGroup("enbtkcxywny") + .withTags( + mapOf("fkts", "aaxdbabphlwrq", "nyyazttbtwwrqpue", "hsucoc", "xibxujwbhqwalm", "ckzywbiexzfeyue")) + .withIdentity(new EncryptionIdentity()) + .withDefaultGroup("epdkzja") + .withEncryptionConfig(new EncryptionConfig().withType(EncryptionConfigType.USER_MANAGED)) + .withEncryptionState(EncryptionState.DISABLED) + .withFirewallRules(Arrays.asList()) + .withVirtualNetworkRules(Arrays.asList()) + .withFirewallState(FirewallState.ENABLED) + .withFirewallAllowAzureIps(FirewallAllowAzureIpsState.ENABLED) + .withTrustedIdProviders(Arrays.asList()) + .withTrustedIdProviderState(TrustedIdProviderState.DISABLED) + .withNewTier(TierType.COMMITMENT_10TB) + .create(); + + Assertions.assertEquals("svmkfssxquk", response.location()); + Assertions.assertEquals("l", response.tags().get("mg")); + } + + @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/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/AccountsDeleteMockTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/AccountsDeleteMockTests.java new file mode 100644 index 0000000000000..169687680cd39 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/AccountsDeleteMockTests.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.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.datalakestore.DataLakeStoreManager; +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 AccountsDeleteMockTests { + @Test + public void testDelete() 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(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); + })); + + DataLakeStoreManager manager = + DataLakeStoreManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager.accounts().delete("hibnuqqkpika", "rgvtqag", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/AccountsEnableKeyVaultWithResponseMockTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/AccountsEnableKeyVaultWithResponseMockTests.java new file mode 100644 index 0000000000000..389ce7ff61fab --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/AccountsEnableKeyVaultWithResponseMockTests.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.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.datalakestore.DataLakeStoreManager; +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 AccountsEnableKeyVaultWithResponseMockTests { + @Test + public void testEnableKeyVaultWithResponse() 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(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); + })); + + DataLakeStoreManager manager = + DataLakeStoreManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager.accounts().enableKeyVaultWithResponse("buynhijggm", "bfs", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/AccountsGetByResourceGroupWithResponseMockTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/AccountsGetByResourceGroupWithResponseMockTests.java new file mode 100644 index 0000000000000..7632892d42496 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/AccountsGetByResourceGroupWithResponseMockTests.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.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.datalakestore.DataLakeStoreManager; +import com.azure.resourcemanager.datalakestore.models.DataLakeStoreAccount; +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 AccountsGetByResourceGroupWithResponseMockTests { + @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 = + "{\"identity\":{\"principalId\":\"fd77ed63-4786-4c29-b12a-4be323179679\",\"tenantId\":\"2ee98339-ac2f-4035-b930-d055e4defbd0\"},\"properties\":{\"defaultGroup\":\"rjcxerfuwu\",\"encryptionConfig\":{\"type\":\"ServiceManaged\"},\"encryptionState\":\"Disabled\",\"encryptionProvisioningState\":\"Creating\",\"firewallRules\":[],\"virtualNetworkRules\":[],\"firewallState\":\"Disabled\",\"firewallAllowAzureIps\":\"Disabled\",\"trustedIdProviders\":[],\"trustedIdProviderState\":\"Enabled\",\"newTier\":\"Commitment_500TB\",\"currentTier\":\"Commitment_100TB\",\"accountId\":\"f9928d90-dd9d-4964-99c3-f21a09b2fdd1\",\"provisioningState\":\"Undeleting\",\"state\":\"Suspended\",\"creationTime\":\"2021-02-07T10:30:53Z\",\"lastModifiedTime\":\"2021-01-29T11:34:22Z\",\"endpoint\":\"qgidokgjljyo\"},\"location\":\"gvcl\",\"tags\":{\"bijhtxfvgxbf\":\"sncghkjeszz\",\"ec\":\"mxnehmp\",\"gr\":\"godebfqkkrbmpu\"},\"id\":\"wflzlfbxzpuzy\",\"name\":\"ispnqzahmgkbrp\",\"type\":\"y\"}"; + + 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); + })); + + DataLakeStoreManager manager = + DataLakeStoreManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + DataLakeStoreAccount response = + manager + .accounts() + .getByResourceGroupWithResponse("fcivfsnkym", "ctq", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("gvcl", response.location()); + Assertions.assertEquals("sncghkjeszz", response.tags().get("bijhtxfvgxbf")); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/AccountsListByResourceGroupMockTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/AccountsListByResourceGroupMockTests.java new file mode 100644 index 0000000000000..ab6d0035cef43 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/AccountsListByResourceGroupMockTests.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.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.datalakestore.DataLakeStoreManager; +import com.azure.resourcemanager.datalakestore.models.DataLakeStoreAccountBasic; +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 AccountsListByResourceGroupMockTests { + @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\":{\"accountId\":\"22fa21ff-72b0-4deb-9918-e0f77e9068e5\",\"provisioningState\":\"Succeeded\",\"state\":\"Suspended\",\"creationTime\":\"2021-03-27T23:23:57Z\",\"lastModifiedTime\":\"2021-01-13T15:17:17Z\",\"endpoint\":\"tmryw\"},\"location\":\"uzoqft\",\"tags\":{\"lsicohoqqnwv\":\"zrnkcqvyxlwh\",\"yxzk\":\"ryavwhheunmmqh\",\"koklya\":\"noc\",\"ewrmjmwvvjektc\":\"uconuqszfkbey\"},\"id\":\"senhwlrs\",\"name\":\"frzpwvlqdqgb\",\"type\":\"qylihkaetckt\"}]}"; + + 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); + })); + + DataLakeStoreManager manager = + DataLakeStoreManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = + manager + .accounts() + .listByResourceGroup( + "bkh", + "jdeyeamdpha", + 1536073800, + 2125402633, + "pbuxwgipwhon", + "wkgshwa", + false, + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("uzoqft", response.iterator().next().location()); + Assertions.assertEquals("zrnkcqvyxlwh", response.iterator().next().tags().get("lsicohoqqnwv")); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/AccountsListMockTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/AccountsListMockTests.java new file mode 100644 index 0000000000000..87303d2da50a9 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/AccountsListMockTests.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.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.datalakestore.DataLakeStoreManager; +import com.azure.resourcemanager.datalakestore.models.DataLakeStoreAccountBasic; +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 AccountsListMockTests { + @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\":{\"accountId\":\"fbea2996-69da-43c8-8264-edd16fcb7600\",\"provisioningState\":\"Deleting\",\"state\":\"Suspended\",\"creationTime\":\"2021-04-07T14:56:45Z\",\"lastModifiedTime\":\"2021-05-01T06:56:52Z\",\"endpoint\":\"bbzoggig\"},\"location\":\"xwburvjxxjns\",\"tags\":{\"udwtiukbl\":\"ptkoenkoukn\",\"o\":\"ngkpocipazy\",\"ntypmrbpizcdrqj\":\"gukgjnpiucgygevq\"},\"id\":\"dpydn\",\"name\":\"yhxdeoejzicwi\",\"type\":\"sjttgzfbish\"}]}"; + + 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); + })); + + DataLakeStoreManager manager = + DataLakeStoreManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = + manager + .accounts() + .list("zfbuhf", 983901153, 53032115, "axkffei", "th", false, com.azure.core.util.Context.NONE); + + Assertions.assertEquals("xwburvjxxjns", response.iterator().next().location()); + Assertions.assertEquals("ptkoenkoukn", response.iterator().next().tags().get("udwtiukbl")); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CapabilityInformationInnerTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CapabilityInformationInnerTests.java new file mode 100644 index 0000000000000..5737b6b0dd966 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CapabilityInformationInnerTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.fluent.models.CapabilityInformationInner; + +public final class CapabilityInformationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CapabilityInformationInner model = + BinaryData + .fromString( + "{\"subscriptionId\":\"fdfc4063-6309-48c1-88e2-51379232b7d4\",\"state\":\"Warned\",\"maxAccountCount\":1613770943,\"accountCount\":45811298,\"migrationState\":true}") + .toObject(CapabilityInformationInner.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CapabilityInformationInner model = new CapabilityInformationInner(); + model = BinaryData.fromObject(model).toObject(CapabilityInformationInner.class); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CheckNameAvailabilityParametersTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CheckNameAvailabilityParametersTests.java new file mode 100644 index 0000000000000..ab8a33a3f2d53 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CheckNameAvailabilityParametersTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.models.CheckNameAvailabilityParameters; +import org.junit.jupiter.api.Assertions; + +public final class CheckNameAvailabilityParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CheckNameAvailabilityParameters model = + BinaryData.fromString("{\"name\":\"v\"}").toObject(CheckNameAvailabilityParameters.class); + Assertions.assertEquals("v", model.name()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CheckNameAvailabilityParameters model = new CheckNameAvailabilityParameters().withName("v"); + model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityParameters.class); + Assertions.assertEquals("v", model.name()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateDataLakeStoreAccountParametersTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateDataLakeStoreAccountParametersTests.java new file mode 100644 index 0000000000000..326a2ce2a5beb --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateDataLakeStoreAccountParametersTests.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.models.CreateDataLakeStoreAccountParameters; +import com.azure.resourcemanager.datalakestore.models.CreateFirewallRuleWithAccountParameters; +import com.azure.resourcemanager.datalakestore.models.CreateTrustedIdProviderWithAccountParameters; +import com.azure.resourcemanager.datalakestore.models.CreateVirtualNetworkRuleWithAccountParameters; +import com.azure.resourcemanager.datalakestore.models.EncryptionConfig; +import com.azure.resourcemanager.datalakestore.models.EncryptionConfigType; +import com.azure.resourcemanager.datalakestore.models.EncryptionIdentity; +import com.azure.resourcemanager.datalakestore.models.EncryptionState; +import com.azure.resourcemanager.datalakestore.models.FirewallAllowAzureIpsState; +import com.azure.resourcemanager.datalakestore.models.FirewallState; +import com.azure.resourcemanager.datalakestore.models.TierType; +import com.azure.resourcemanager.datalakestore.models.TrustedIdProviderState; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class CreateDataLakeStoreAccountParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CreateDataLakeStoreAccountParameters model = + BinaryData + .fromString( + "{\"location\":\"kvnipjoxz\",\"tags\":{\"lzydehojwyahux\":\"hgejspodma\",\"vcputegj\":\"npmqnjaqwixjspro\",\"uuvmkjozkrwfnd\":\"wmfdatscmdvpjhul\"},\"identity\":{\"principalId\":\"d0dc0555-2478-483f-bd52-738f824e1696\",\"tenantId\":\"795441b9-fd01-44d8-859a-876e07e2fb02\"},\"properties\":{\"defaultGroup\":\"lwejdpv\",\"encryptionConfig\":{\"type\":\"ServiceManaged\"},\"encryptionState\":\"Disabled\",\"firewallRules\":[{\"name\":\"acctazakljla\"},{\"name\":\"bcryffdfd\"}],\"virtualNetworkRules\":[{\"name\":\"gexpaojakhmsbz\"},{\"name\":\"hcrzevd\"},{\"name\":\"hlxaolthqtr\"},{\"name\":\"qjbpfzfsin\"}],\"firewallState\":\"Enabled\",\"firewallAllowAzureIps\":\"Disabled\",\"trustedIdProviders\":[{\"name\":\"wzo\"},{\"name\":\"xjtfelluwfzit\"},{\"name\":\"np\"},{\"name\":\"qfpjk\"}],\"trustedIdProviderState\":\"Disabled\",\"newTier\":\"Commitment_5PB\"}}") + .toObject(CreateDataLakeStoreAccountParameters.class); + Assertions.assertEquals("kvnipjoxz", model.location()); + Assertions.assertEquals("hgejspodma", model.tags().get("lzydehojwyahux")); + Assertions.assertEquals("lwejdpv", model.defaultGroup()); + Assertions.assertEquals(EncryptionConfigType.SERVICE_MANAGED, model.encryptionConfig().type()); + Assertions.assertEquals(EncryptionState.DISABLED, model.encryptionState()); + Assertions.assertEquals("acctazakljla", model.firewallRules().get(0).name()); + Assertions.assertEquals("gexpaojakhmsbz", model.virtualNetworkRules().get(0).name()); + Assertions.assertEquals(FirewallState.ENABLED, model.firewallState()); + Assertions.assertEquals(FirewallAllowAzureIpsState.DISABLED, model.firewallAllowAzureIps()); + Assertions.assertEquals("wzo", model.trustedIdProviders().get(0).name()); + Assertions.assertEquals(TrustedIdProviderState.DISABLED, model.trustedIdProviderState()); + Assertions.assertEquals(TierType.COMMITMENT_5PB, model.newTier()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CreateDataLakeStoreAccountParameters model = + new CreateDataLakeStoreAccountParameters() + .withLocation("kvnipjoxz") + .withTags( + mapOf( + "lzydehojwyahux", + "hgejspodma", + "vcputegj", + "npmqnjaqwixjspro", + "uuvmkjozkrwfnd", + "wmfdatscmdvpjhul")) + .withIdentity(new EncryptionIdentity()) + .withDefaultGroup("lwejdpv") + .withEncryptionConfig(new EncryptionConfig().withType(EncryptionConfigType.SERVICE_MANAGED)) + .withEncryptionState(EncryptionState.DISABLED) + .withFirewallRules( + Arrays + .asList( + new CreateFirewallRuleWithAccountParameters().withName("acctazakljla"), + new CreateFirewallRuleWithAccountParameters().withName("bcryffdfd"))) + .withVirtualNetworkRules( + Arrays + .asList( + new CreateVirtualNetworkRuleWithAccountParameters().withName("gexpaojakhmsbz"), + new CreateVirtualNetworkRuleWithAccountParameters().withName("hcrzevd"), + new CreateVirtualNetworkRuleWithAccountParameters().withName("hlxaolthqtr"), + new CreateVirtualNetworkRuleWithAccountParameters().withName("qjbpfzfsin"))) + .withFirewallState(FirewallState.ENABLED) + .withFirewallAllowAzureIps(FirewallAllowAzureIpsState.DISABLED) + .withTrustedIdProviders( + Arrays + .asList( + new CreateTrustedIdProviderWithAccountParameters().withName("wzo"), + new CreateTrustedIdProviderWithAccountParameters().withName("xjtfelluwfzit"), + new CreateTrustedIdProviderWithAccountParameters().withName("np"), + new CreateTrustedIdProviderWithAccountParameters().withName("qfpjk"))) + .withTrustedIdProviderState(TrustedIdProviderState.DISABLED) + .withNewTier(TierType.COMMITMENT_5PB); + model = BinaryData.fromObject(model).toObject(CreateDataLakeStoreAccountParameters.class); + Assertions.assertEquals("kvnipjoxz", model.location()); + Assertions.assertEquals("hgejspodma", model.tags().get("lzydehojwyahux")); + Assertions.assertEquals("lwejdpv", model.defaultGroup()); + Assertions.assertEquals(EncryptionConfigType.SERVICE_MANAGED, model.encryptionConfig().type()); + Assertions.assertEquals(EncryptionState.DISABLED, model.encryptionState()); + Assertions.assertEquals("acctazakljla", model.firewallRules().get(0).name()); + Assertions.assertEquals("gexpaojakhmsbz", model.virtualNetworkRules().get(0).name()); + Assertions.assertEquals(FirewallState.ENABLED, model.firewallState()); + Assertions.assertEquals(FirewallAllowAzureIpsState.DISABLED, model.firewallAllowAzureIps()); + Assertions.assertEquals("wzo", model.trustedIdProviders().get(0).name()); + Assertions.assertEquals(TrustedIdProviderState.DISABLED, model.trustedIdProviderState()); + Assertions.assertEquals(TierType.COMMITMENT_5PB, model.newTier()); + } + + @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/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateFirewallRuleWithAccountParametersTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateFirewallRuleWithAccountParametersTests.java new file mode 100644 index 0000000000000..239abc29332cd --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateFirewallRuleWithAccountParametersTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.models.CreateFirewallRuleWithAccountParameters; +import org.junit.jupiter.api.Assertions; + +public final class CreateFirewallRuleWithAccountParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CreateFirewallRuleWithAccountParameters model = + BinaryData + .fromString( + "{\"name\":\"zxtheotusivyevcc\",\"properties\":{\"startIpAddress\":\"qi\",\"endIpAddress\":\"nhungbw\"}}") + .toObject(CreateFirewallRuleWithAccountParameters.class); + Assertions.assertEquals("zxtheotusivyevcc", model.name()); + Assertions.assertEquals("qi", model.startIpAddress()); + Assertions.assertEquals("nhungbw", model.endIpAddress()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CreateFirewallRuleWithAccountParameters model = + new CreateFirewallRuleWithAccountParameters() + .withName("zxtheotusivyevcc") + .withStartIpAddress("qi") + .withEndIpAddress("nhungbw"); + model = BinaryData.fromObject(model).toObject(CreateFirewallRuleWithAccountParameters.class); + Assertions.assertEquals("zxtheotusivyevcc", model.name()); + Assertions.assertEquals("qi", model.startIpAddress()); + Assertions.assertEquals("nhungbw", model.endIpAddress()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateOrUpdateFirewallRuleParametersTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateOrUpdateFirewallRuleParametersTests.java new file mode 100644 index 0000000000000..d91be045ee2b5 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateOrUpdateFirewallRuleParametersTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.models.CreateOrUpdateFirewallRuleParameters; +import org.junit.jupiter.api.Assertions; + +public final class CreateOrUpdateFirewallRuleParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CreateOrUpdateFirewallRuleParameters model = + BinaryData + .fromString("{\"properties\":{\"startIpAddress\":\"a\",\"endIpAddress\":\"hrzayvvtpgvdf\"}}") + .toObject(CreateOrUpdateFirewallRuleParameters.class); + Assertions.assertEquals("a", model.startIpAddress()); + Assertions.assertEquals("hrzayvvtpgvdf", model.endIpAddress()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CreateOrUpdateFirewallRuleParameters model = + new CreateOrUpdateFirewallRuleParameters().withStartIpAddress("a").withEndIpAddress("hrzayvvtpgvdf"); + model = BinaryData.fromObject(model).toObject(CreateOrUpdateFirewallRuleParameters.class); + Assertions.assertEquals("a", model.startIpAddress()); + Assertions.assertEquals("hrzayvvtpgvdf", model.endIpAddress()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateOrUpdateFirewallRulePropertiesTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateOrUpdateFirewallRulePropertiesTests.java new file mode 100644 index 0000000000000..391eca75f4996 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateOrUpdateFirewallRulePropertiesTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.fluent.models.CreateOrUpdateFirewallRuleProperties; +import org.junit.jupiter.api.Assertions; + +public final class CreateOrUpdateFirewallRulePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CreateOrUpdateFirewallRuleProperties model = + BinaryData + .fromString("{\"startIpAddress\":\"zrnf\",\"endIpAddress\":\"gxg\"}") + .toObject(CreateOrUpdateFirewallRuleProperties.class); + Assertions.assertEquals("zrnf", model.startIpAddress()); + Assertions.assertEquals("gxg", model.endIpAddress()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CreateOrUpdateFirewallRuleProperties model = + new CreateOrUpdateFirewallRuleProperties().withStartIpAddress("zrnf").withEndIpAddress("gxg"); + model = BinaryData.fromObject(model).toObject(CreateOrUpdateFirewallRuleProperties.class); + Assertions.assertEquals("zrnf", model.startIpAddress()); + Assertions.assertEquals("gxg", model.endIpAddress()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateOrUpdateTrustedIdProviderParametersTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateOrUpdateTrustedIdProviderParametersTests.java new file mode 100644 index 0000000000000..a8d3f8f41b2cd --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateOrUpdateTrustedIdProviderParametersTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.models.CreateOrUpdateTrustedIdProviderParameters; +import org.junit.jupiter.api.Assertions; + +public final class CreateOrUpdateTrustedIdProviderParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CreateOrUpdateTrustedIdProviderParameters model = + BinaryData + .fromString("{\"properties\":{\"idProvider\":\"zscxaqwo\"}}") + .toObject(CreateOrUpdateTrustedIdProviderParameters.class); + Assertions.assertEquals("zscxaqwo", model.idProvider()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CreateOrUpdateTrustedIdProviderParameters model = + new CreateOrUpdateTrustedIdProviderParameters().withIdProvider("zscxaqwo"); + model = BinaryData.fromObject(model).toObject(CreateOrUpdateTrustedIdProviderParameters.class); + Assertions.assertEquals("zscxaqwo", model.idProvider()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateOrUpdateTrustedIdProviderPropertiesTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateOrUpdateTrustedIdProviderPropertiesTests.java new file mode 100644 index 0000000000000..d98951aff7769 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateOrUpdateTrustedIdProviderPropertiesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.fluent.models.CreateOrUpdateTrustedIdProviderProperties; +import org.junit.jupiter.api.Assertions; + +public final class CreateOrUpdateTrustedIdProviderPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CreateOrUpdateTrustedIdProviderProperties model = + BinaryData + .fromString("{\"idProvider\":\"gsntnbybkzgcwr\"}") + .toObject(CreateOrUpdateTrustedIdProviderProperties.class); + Assertions.assertEquals("gsntnbybkzgcwr", model.idProvider()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CreateOrUpdateTrustedIdProviderProperties model = + new CreateOrUpdateTrustedIdProviderProperties().withIdProvider("gsntnbybkzgcwr"); + model = BinaryData.fromObject(model).toObject(CreateOrUpdateTrustedIdProviderProperties.class); + Assertions.assertEquals("gsntnbybkzgcwr", model.idProvider()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateOrUpdateVirtualNetworkRuleParametersTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateOrUpdateVirtualNetworkRuleParametersTests.java new file mode 100644 index 0000000000000..25fb812ff1f8a --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateOrUpdateVirtualNetworkRuleParametersTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.models.CreateOrUpdateVirtualNetworkRuleParameters; +import org.junit.jupiter.api.Assertions; + +public final class CreateOrUpdateVirtualNetworkRuleParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CreateOrUpdateVirtualNetworkRuleParameters model = + BinaryData + .fromString("{\"properties\":{\"subnetId\":\"bcypmi\"}}") + .toObject(CreateOrUpdateVirtualNetworkRuleParameters.class); + Assertions.assertEquals("bcypmi", model.subnetId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CreateOrUpdateVirtualNetworkRuleParameters model = + new CreateOrUpdateVirtualNetworkRuleParameters().withSubnetId("bcypmi"); + model = BinaryData.fromObject(model).toObject(CreateOrUpdateVirtualNetworkRuleParameters.class); + Assertions.assertEquals("bcypmi", model.subnetId()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateOrUpdateVirtualNetworkRulePropertiesTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateOrUpdateVirtualNetworkRulePropertiesTests.java new file mode 100644 index 0000000000000..10daa968015a5 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateOrUpdateVirtualNetworkRulePropertiesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.fluent.models.CreateOrUpdateVirtualNetworkRuleProperties; +import org.junit.jupiter.api.Assertions; + +public final class CreateOrUpdateVirtualNetworkRulePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CreateOrUpdateVirtualNetworkRuleProperties model = + BinaryData + .fromString("{\"subnetId\":\"fxqeof\"}") + .toObject(CreateOrUpdateVirtualNetworkRuleProperties.class); + Assertions.assertEquals("fxqeof", model.subnetId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CreateOrUpdateVirtualNetworkRuleProperties model = + new CreateOrUpdateVirtualNetworkRuleProperties().withSubnetId("fxqeof"); + model = BinaryData.fromObject(model).toObject(CreateOrUpdateVirtualNetworkRuleProperties.class); + Assertions.assertEquals("fxqeof", model.subnetId()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateTrustedIdProviderWithAccountParametersTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateTrustedIdProviderWithAccountParametersTests.java new file mode 100644 index 0000000000000..415f9cfe26dfd --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateTrustedIdProviderWithAccountParametersTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.models.CreateTrustedIdProviderWithAccountParameters; +import org.junit.jupiter.api.Assertions; + +public final class CreateTrustedIdProviderWithAccountParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CreateTrustedIdProviderWithAccountParameters model = + BinaryData + .fromString("{\"name\":\"aeqjhqjbasvms\",\"properties\":{\"idProvider\":\"jqul\"}}") + .toObject(CreateTrustedIdProviderWithAccountParameters.class); + Assertions.assertEquals("aeqjhqjbasvms", model.name()); + Assertions.assertEquals("jqul", model.idProvider()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CreateTrustedIdProviderWithAccountParameters model = + new CreateTrustedIdProviderWithAccountParameters().withName("aeqjhqjbasvms").withIdProvider("jqul"); + model = BinaryData.fromObject(model).toObject(CreateTrustedIdProviderWithAccountParameters.class); + Assertions.assertEquals("aeqjhqjbasvms", model.name()); + Assertions.assertEquals("jqul", model.idProvider()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateVirtualNetworkRuleWithAccountParametersTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateVirtualNetworkRuleWithAccountParametersTests.java new file mode 100644 index 0000000000000..31403c7bddde1 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/CreateVirtualNetworkRuleWithAccountParametersTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.models.CreateVirtualNetworkRuleWithAccountParameters; +import org.junit.jupiter.api.Assertions; + +public final class CreateVirtualNetworkRuleWithAccountParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CreateVirtualNetworkRuleWithAccountParameters model = + BinaryData + .fromString("{\"name\":\"spemvtzfk\",\"properties\":{\"subnetId\":\"fublj\"}}") + .toObject(CreateVirtualNetworkRuleWithAccountParameters.class); + Assertions.assertEquals("spemvtzfk", model.name()); + Assertions.assertEquals("fublj", model.subnetId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CreateVirtualNetworkRuleWithAccountParameters model = + new CreateVirtualNetworkRuleWithAccountParameters().withName("spemvtzfk").withSubnetId("fublj"); + model = BinaryData.fromObject(model).toObject(CreateVirtualNetworkRuleWithAccountParameters.class); + Assertions.assertEquals("spemvtzfk", model.name()); + Assertions.assertEquals("fublj", model.subnetId()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/DataLakeStoreAccountBasicInnerTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/DataLakeStoreAccountBasicInnerTests.java new file mode 100644 index 0000000000000..fb86e73e62e13 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/DataLakeStoreAccountBasicInnerTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.fluent.models.DataLakeStoreAccountBasicInner; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class DataLakeStoreAccountBasicInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DataLakeStoreAccountBasicInner model = + BinaryData + .fromString( + "{\"properties\":{\"accountId\":\"cb6c8fa7-736e-4f98-85e6-6c76de82dfb9\",\"provisioningState\":\"Deleting\",\"state\":\"Active\",\"creationTime\":\"2021-03-22T18:05:05Z\",\"lastModifiedTime\":\"2021-06-23T16:37:05Z\",\"endpoint\":\"ifpikxwczby\"},\"location\":\"cnpqxuhivyqniwby\",\"tags\":{\"mjgr\":\"xvd\"},\"id\":\"fwvuk\",\"name\":\"gaudcc\",\"type\":\"nhsjcnyej\"}") + .toObject(DataLakeStoreAccountBasicInner.class); + Assertions.assertEquals("cnpqxuhivyqniwby", model.location()); + Assertions.assertEquals("xvd", model.tags().get("mjgr")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DataLakeStoreAccountBasicInner model = + new DataLakeStoreAccountBasicInner().withLocation("cnpqxuhivyqniwby").withTags(mapOf("mjgr", "xvd")); + model = BinaryData.fromObject(model).toObject(DataLakeStoreAccountBasicInner.class); + Assertions.assertEquals("cnpqxuhivyqniwby", model.location()); + Assertions.assertEquals("xvd", model.tags().get("mjgr")); + } + + @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/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/DataLakeStoreAccountInnerTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/DataLakeStoreAccountInnerTests.java new file mode 100644 index 0000000000000..523acca39ec72 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/DataLakeStoreAccountInnerTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.fluent.models.DataLakeStoreAccountInner; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class DataLakeStoreAccountInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DataLakeStoreAccountInner model = + BinaryData + .fromString( + "{\"identity\":{\"principalId\":\"37857678-f579-4835-a368-353bc59a1bde\",\"tenantId\":\"fec7ee2b-60b8-4f65-9101-b5d7dbfaa25d\"},\"properties\":{\"defaultGroup\":\"rljdouskcqv\",\"encryptionConfig\":{\"type\":\"UserManaged\"},\"encryptionState\":\"Disabled\",\"encryptionProvisioningState\":\"Creating\",\"firewallRules\":[{\"name\":\"xbnjbiksq\",\"type\":\"lssai\",\"id\":\"p\"},{\"name\":\"zlljfmppeebvm\",\"type\":\"sabkyqduujitcjcz\",\"id\":\"evndh\"}],\"virtualNetworkRules\":[{\"name\":\"appd\",\"type\":\"dkvwrwjfe\",\"id\":\"nhutjeltmrldhugj\"},{\"name\":\"atqxho\",\"type\":\"geablgphuticndvk\",\"id\":\"zwyiftyhxhur\"},{\"name\":\"tyxolniwpwc\",\"type\":\"jfkgiawxk\",\"id\":\"ypl\"}],\"firewallState\":\"Enabled\",\"firewallAllowAzureIps\":\"Enabled\",\"trustedIdProviders\":[{\"name\":\"nddhsgcbacph\",\"type\":\"koty\",\"id\":\"gou\"},{\"name\":\"dlikwyqkgfgibma\",\"type\":\"akeqs\",\"id\":\"yb\"},{\"name\":\"e\",\"type\":\"ytb\",\"id\":\"qfou\"},{\"name\":\"mnkzsmod\",\"type\":\"lougpbkw\",\"id\":\"utduqktapspwgcu\"}],\"trustedIdProviderState\":\"Disabled\",\"newTier\":\"Consumption\",\"currentTier\":\"Commitment_1TB\",\"accountId\":\"b388aac0-af6a-4c0d-aab8-aac2e6d2fe18\",\"provisioningState\":\"Suspending\",\"state\":\"Active\",\"creationTime\":\"2021-07-16T10:53:41Z\",\"lastModifiedTime\":\"2021-03-10T22:17:50Z\",\"endpoint\":\"bbjfddgmbmbexp\"},\"location\":\"bhtqqrolfpfpsa\",\"tags\":{\"gjyjgzjaoyfhrtxi\":\"qux\",\"rkujy\":\"n\"},\"id\":\"vlejuvfqa\",\"name\":\"rlyxwjkcprbnw\",\"type\":\"xgjvtbv\"}") + .toObject(DataLakeStoreAccountInner.class); + Assertions.assertEquals("bhtqqrolfpfpsa", model.location()); + Assertions.assertEquals("qux", model.tags().get("gjyjgzjaoyfhrtxi")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DataLakeStoreAccountInner model = + new DataLakeStoreAccountInner() + .withLocation("bhtqqrolfpfpsa") + .withTags(mapOf("gjyjgzjaoyfhrtxi", "qux", "rkujy", "n")); + model = BinaryData.fromObject(model).toObject(DataLakeStoreAccountInner.class); + Assertions.assertEquals("bhtqqrolfpfpsa", model.location()); + Assertions.assertEquals("qux", model.tags().get("gjyjgzjaoyfhrtxi")); + } + + @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/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/DataLakeStoreAccountListResultTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/DataLakeStoreAccountListResultTests.java new file mode 100644 index 0000000000000..d00b433f8c7d8 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/DataLakeStoreAccountListResultTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.models.DataLakeStoreAccountListResult; + +public final class DataLakeStoreAccountListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DataLakeStoreAccountListResult model = + BinaryData + .fromString( + "{\"value\":[{\"properties\":{\"accountId\":\"236dc397-1449-41ff-8337-3fc1ae151647\",\"provisioningState\":\"Running\",\"state\":\"Suspended\",\"creationTime\":\"2021-06-18T18:26:01Z\",\"lastModifiedTime\":\"2021-08-02T07:01:22Z\",\"endpoint\":\"zm\"},\"location\":\"hmtzopbsphrup\",\"tags\":{\"ycm\":\"sybbejhph\",\"htbmuf\":\"xaobhdxbmtqioqjz\",\"rxybqsoq\":\"ownoizhw\"},\"id\":\"jgkdmbpazlobcu\",\"name\":\"pdznrbtcqqjnqgl\",\"type\":\"qgn\"},{\"properties\":{\"accountId\":\"a8905313-d95d-4c0f-baaa-f550ff3e8664\",\"provisioningState\":\"Running\",\"state\":\"Suspended\",\"creationTime\":\"2021-06-05T07:25:28Z\",\"lastModifiedTime\":\"2021-11-19T20:38:19Z\",\"endpoint\":\"esaagdfm\"},\"location\":\"lzl\",\"tags\":{\"vktsizntocipao\":\"rifkwm\",\"poyfdkfogkn\":\"ajpsquc\",\"eqsrdeupewnwreit\":\"gjofjd\"},\"id\":\"zyf\",\"name\":\"usarhmofc\",\"type\":\"hs\"},{\"properties\":{\"accountId\":\"8fde2a93-ed7c-4517-a25e-0c466641a6ca\",\"provisioningState\":\"Undeleting\",\"state\":\"Suspended\",\"creationTime\":\"2021-06-13T04:20:54Z\",\"lastModifiedTime\":\"2021-10-06T17:56:05Z\",\"endpoint\":\"kuksjtxukcdm\"},\"location\":\"arcryuanzwuxzdxt\",\"tags\":{\"u\":\"lhmwhfpmrqobm\"},\"id\":\"knryrtihfxtij\",\"name\":\"pzvgnwzsymglzufc\",\"type\":\"zk\"}],\"nextLink\":\"dbihanufhfcbj\"}") + .toObject(DataLakeStoreAccountListResult.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DataLakeStoreAccountListResult model = new DataLakeStoreAccountListResult(); + model = BinaryData.fromObject(model).toObject(DataLakeStoreAccountListResult.class); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/DataLakeStoreAccountPropertiesBasicTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/DataLakeStoreAccountPropertiesBasicTests.java new file mode 100644 index 0000000000000..6c4b70e3aa4ca --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/DataLakeStoreAccountPropertiesBasicTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.fluent.models.DataLakeStoreAccountPropertiesBasic; + +public final class DataLakeStoreAccountPropertiesBasicTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DataLakeStoreAccountPropertiesBasic model = + BinaryData + .fromString( + "{\"accountId\":\"c07fa123-1c61-41e1-a749-6c9124ac08e2\",\"provisioningState\":\"Creating\",\"state\":\"Suspended\",\"creationTime\":\"2021-01-26T08:15:51Z\",\"lastModifiedTime\":\"2021-10-27T17:34:25Z\",\"endpoint\":\"wlokjyem\"}") + .toObject(DataLakeStoreAccountPropertiesBasic.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DataLakeStoreAccountPropertiesBasic model = new DataLakeStoreAccountPropertiesBasic(); + model = BinaryData.fromObject(model).toObject(DataLakeStoreAccountPropertiesBasic.class); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/EncryptionIdentityTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/EncryptionIdentityTests.java new file mode 100644 index 0000000000000..6f9b7ccd0c643 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/EncryptionIdentityTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.models.EncryptionIdentity; + +public final class EncryptionIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EncryptionIdentity model = + BinaryData + .fromString( + "{\"principalId\":\"f39d7dac-00ea-4ef7-a22d-0e7e6a494bb8\",\"tenantId\":\"43a64341-4107-4fab-9b04-8b9b597c91af\"}") + .toObject(EncryptionIdentity.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EncryptionIdentity model = new EncryptionIdentity(); + model = BinaryData.fromObject(model).toObject(EncryptionIdentity.class); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/FirewallRuleInnerTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/FirewallRuleInnerTests.java new file mode 100644 index 0000000000000..9ebbb0ed52e7c --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/FirewallRuleInnerTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.fluent.models.FirewallRuleInner; +import org.junit.jupiter.api.Assertions; + +public final class FirewallRuleInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FirewallRuleInner model = + BinaryData + .fromString( + "{\"properties\":{\"startIpAddress\":\"tnwu\",\"endIpAddress\":\"gazxuf\"},\"name\":\"uckyf\",\"type\":\"rfidfvzwdz\",\"id\":\"tymw\"}") + .toObject(FirewallRuleInner.class); + Assertions.assertEquals("tymw", model.id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FirewallRuleInner model = new FirewallRuleInner().withId("tymw"); + model = BinaryData.fromObject(model).toObject(FirewallRuleInner.class); + Assertions.assertEquals("tymw", model.id()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/FirewallRuleListResultTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/FirewallRuleListResultTests.java new file mode 100644 index 0000000000000..78a890024b99c --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/FirewallRuleListResultTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.models.FirewallRuleListResult; + +public final class FirewallRuleListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FirewallRuleListResult model = + BinaryData + .fromString( + "{\"value\":[{\"properties\":{\"startIpAddress\":\"qkwpyeicxmqc\",\"endIpAddress\":\"q\"},\"name\":\"khixuigdtopbo\",\"type\":\"og\",\"id\":\"e\"}],\"nextLink\":\"a\"}") + .toObject(FirewallRuleListResult.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FirewallRuleListResult model = new FirewallRuleListResult(); + model = BinaryData.fromObject(model).toObject(FirewallRuleListResult.class); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulePropertiesTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulePropertiesTests.java new file mode 100644 index 0000000000000..0dbb135cfac98 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulePropertiesTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.fluent.models.FirewallRuleProperties; + +public final class FirewallRulePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FirewallRuleProperties model = + BinaryData + .fromString("{\"startIpAddress\":\"dkfthwxmnt\",\"endIpAddress\":\"waopvkmijcmmxd\"}") + .toObject(FirewallRuleProperties.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FirewallRuleProperties model = new FirewallRuleProperties(); + model = BinaryData.fromObject(model).toObject(FirewallRuleProperties.class); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesCreateOrUpdateWithResponseMockTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 0000000000000..e427b17150d30 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.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.datalakestore.DataLakeStoreManager; +import com.azure.resourcemanager.datalakestore.models.FirewallRule; +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 FirewallRulesCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"properties\":{\"startIpAddress\":\"rnwb\",\"endIpAddress\":\"hhseyv\"},\"name\":\"srtslhspkdeem\",\"type\":\"fm\",\"id\":\"gkvtmelmqkrhah\"}"; + + 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); + })); + + DataLakeStoreManager manager = + DataLakeStoreManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + FirewallRule response = + manager + .firewallRules() + .define("bkyvp") + .withExistingAccount("hdzhlrqj", "hckfrlhrx") + .withStartIpAddress("ca") + .withEndIpAddress("uzbpzkafku") + .create(); + + Assertions.assertEquals("gkvtmelmqkrhah", response.id()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesDeleteWithResponseMockTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesDeleteWithResponseMockTests.java new file mode 100644 index 0000000000000..66d3e465a12dd --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesDeleteWithResponseMockTests.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.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.datalakestore.DataLakeStoreManager; +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 FirewallRulesDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() 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(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); + })); + + DataLakeStoreManager manager = + DataLakeStoreManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager.firewallRules().deleteWithResponse("yudxytlmoy", "xv", "fudwpznt", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesGetWithResponseMockTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesGetWithResponseMockTests.java new file mode 100644 index 0000000000000..592effdd304e5 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesGetWithResponseMockTests.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.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.datalakestore.DataLakeStoreManager; +import com.azure.resourcemanager.datalakestore.models.FirewallRule; +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 FirewallRulesGetWithResponseMockTests { + @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\":{\"startIpAddress\":\"pabgyeps\",\"endIpAddress\":\"tazqugxywpmueefj\"},\"name\":\"fqkquj\",\"type\":\"suyonobglaocq\",\"id\":\"ccm\"}"; + + 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); + })); + + DataLakeStoreManager manager = + DataLakeStoreManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + FirewallRule response = + manager + .firewallRules() + .getWithResponse("nv", "t", "qnermclfplphoxu", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("ccm", response.id()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesListByAccountMockTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesListByAccountMockTests.java new file mode 100644 index 0000000000000..237d514998275 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/FirewallRulesListByAccountMockTests.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.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.datalakestore.DataLakeStoreManager; +import com.azure.resourcemanager.datalakestore.models.FirewallRule; +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 FirewallRulesListByAccountMockTests { + @Test + public void testListByAccount() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"properties\":{\"startIpAddress\":\"lxotogtwrupq\",\"endIpAddress\":\"vnm\"},\"name\":\"ykvceoveil\",\"type\":\"notyfjfcnjbkcn\",\"id\":\"hbttkphyw\"}]}"; + + 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); + })); + + DataLakeStoreManager manager = + DataLakeStoreManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = + manager.firewallRules().listByAccount("jdhtldwkyzxu", "tkncwsc", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("hbttkphyw", response.iterator().next().id()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/LocationsGetCapabilityWithResponseMockTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/LocationsGetCapabilityWithResponseMockTests.java new file mode 100644 index 0000000000000..24fbfe34fb6b6 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/LocationsGetCapabilityWithResponseMockTests.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.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.datalakestore.DataLakeStoreManager; +import com.azure.resourcemanager.datalakestore.models.CapabilityInformation; +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 LocationsGetCapabilityWithResponseMockTests { + @Test + public void testGetCapabilityWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"subscriptionId\":\"b61f4f29-acbb-4aa6-87bb-7986f7ec2459\",\"state\":\"Warned\",\"maxAccountCount\":599032545,\"accountCount\":1462971604,\"migrationState\":true}"; + + 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); + })); + + DataLakeStoreManager manager = + DataLakeStoreManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + CapabilityInformation response = + manager.locations().getCapabilityWithResponse("uhpigvp", com.azure.core.util.Context.NONE).getValue(); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/LocationsGetUsageMockTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/LocationsGetUsageMockTests.java new file mode 100644 index 0000000000000..a695baacd9de5 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/LocationsGetUsageMockTests.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.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.datalakestore.DataLakeStoreManager; +import com.azure.resourcemanager.datalakestore.models.Usage; +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 LocationsGetUsageMockTests { + @Test + public void testGetUsage() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"unit\":\"BytesPerSecond\",\"id\":\"zzhxgktrm\",\"currentValue\":591532413,\"limit\":2053919351,\"name\":{\"value\":\"t\",\"localizedValue\":\"ellwptfdy\"}}]}"; + + 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); + })); + + DataLakeStoreManager manager = + DataLakeStoreManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.locations().getUsage("edjvcslynqw", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/NameAvailabilityInformationInnerTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/NameAvailabilityInformationInnerTests.java new file mode 100644 index 0000000000000..a79853126a72b --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/NameAvailabilityInformationInnerTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.fluent.models.NameAvailabilityInformationInner; + +public final class NameAvailabilityInformationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NameAvailabilityInformationInner model = + BinaryData + .fromString("{\"nameAvailable\":true,\"reason\":\"onpc\",\"message\":\"ocohslkevleg\"}") + .toObject(NameAvailabilityInformationInner.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NameAvailabilityInformationInner model = new NameAvailabilityInformationInner(); + model = BinaryData.fromObject(model).toObject(NameAvailabilityInformationInner.class); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/OperationDisplayTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/OperationDisplayTests.java new file mode 100644 index 0000000000000..53a89c735f64e --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/OperationDisplayTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.models.OperationDisplay; + +public final class OperationDisplayTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationDisplay model = + BinaryData + .fromString( + "{\"provider\":\"yhltrpmopjmcm\",\"resource\":\"u\",\"operation\":\"thfuiuaodsfcpkvx\",\"description\":\"puozmyzydag\"}") + .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/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/OperationListResultInnerTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/OperationListResultInnerTests.java new file mode 100644 index 0000000000000..02816d92425f5 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/OperationListResultInnerTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.fluent.models.OperationListResultInner; + +public final class OperationListResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationListResultInner model = + BinaryData + .fromString( + "{\"value\":[{\"name\":\"njeaseipheofloke\",\"display\":{\"provider\":\"enjbdlwtgrhp\",\"resource\":\"pj\",\"operation\":\"asxazjpqyegualhb\",\"description\":\"hejjz\"},\"origin\":\"user,system\"},{\"name\":\"dgwdslfhot\",\"display\":{\"provider\":\"ynpwlbj\",\"resource\":\"gacftadeh\",\"operation\":\"ltyfsop\",\"description\":\"suesnzw\"},\"origin\":\"user,system\"},{\"name\":\"avo\",\"display\":{\"provider\":\"dmoh\",\"resource\":\"bqvudwxdndn\",\"operation\":\"w\",\"description\":\"jjugwdkcglhslaz\"},\"origin\":\"user\"},{\"name\":\"gdtjixhbkuofqwey\",\"display\":{\"provider\":\"enevfyexfwhybci\",\"resource\":\"yvdcsitynnaa\",\"operation\":\"ectehf\",\"description\":\"scjeypv\"},\"origin\":\"user,system\"}],\"nextLink\":\"kgqhcjrefovg\"}") + .toObject(OperationListResultInner.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OperationListResultInner model = new OperationListResultInner(); + model = BinaryData.fromObject(model).toObject(OperationListResultInner.class); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/OperationTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/OperationTests.java new file mode 100644 index 0000000000000..483a42eb9c91d --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/OperationTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.models.Operation; +import com.azure.resourcemanager.datalakestore.models.OperationDisplay; + +public final class OperationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Operation model = + BinaryData + .fromString( + "{\"name\":\"qsl\",\"display\":{\"provider\":\"vxyqjpkcattpngjc\",\"resource\":\"czsqpjhvm\",\"operation\":\"jvnysounqe\",\"description\":\"noae\"},\"origin\":\"user,system\"}") + .toObject(Operation.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Operation model = new Operation().withDisplay(new OperationDisplay()); + model = BinaryData.fromObject(model).toObject(Operation.class); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/OperationsListWithResponseMockTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/OperationsListWithResponseMockTests.java new file mode 100644 index 0000000000000..94fbf51fd9c4d --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/OperationsListWithResponseMockTests.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.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.datalakestore.DataLakeStoreManager; +import com.azure.resourcemanager.datalakestore.models.OperationListResult; +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 OperationsListWithResponseMockTests { + @Test + public void testListWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"name\":\"jpkiidzyexznelix\",\"origin\":\"system\"},{\"name\":\"folhbnxknal\",\"origin\":\"user,system\"}],\"nextLink\":\"ggdtpnapnyiro\"}"; + + 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); + })); + + DataLakeStoreManager manager = + DataLakeStoreManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + OperationListResult response = + manager.operations().listWithResponse(com.azure.core.util.Context.NONE).getValue(); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProviderInnerTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProviderInnerTests.java new file mode 100644 index 0000000000000..366785c10150b --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProviderInnerTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.fluent.models.TrustedIdProviderInner; +import org.junit.jupiter.api.Assertions; + +public final class TrustedIdProviderInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TrustedIdProviderInner model = + BinaryData + .fromString( + "{\"properties\":{\"idProvider\":\"yqrimzin\"},\"name\":\"swjdkirso\",\"type\":\"qxhcrmn\",\"id\":\"jtckwhdso\"}") + .toObject(TrustedIdProviderInner.class); + Assertions.assertEquals("jtckwhdso", model.id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TrustedIdProviderInner model = new TrustedIdProviderInner().withId("jtckwhdso"); + model = BinaryData.fromObject(model).toObject(TrustedIdProviderInner.class); + Assertions.assertEquals("jtckwhdso", model.id()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProviderListResultTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProviderListResultTests.java new file mode 100644 index 0000000000000..2fc4a4c2e707d --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProviderListResultTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.models.TrustedIdProviderListResult; + +public final class TrustedIdProviderListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TrustedIdProviderListResult model = + BinaryData + .fromString( + "{\"value\":[{\"properties\":{\"idProvider\":\"nfnbacfionlebxe\"},\"name\":\"gtzxdpn\",\"type\":\"qqwx\",\"id\":\"feallnwsu\"}],\"nextLink\":\"snjampmng\"}") + .toObject(TrustedIdProviderListResult.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TrustedIdProviderListResult model = new TrustedIdProviderListResult(); + model = BinaryData.fromObject(model).toObject(TrustedIdProviderListResult.class); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProviderPropertiesTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProviderPropertiesTests.java new file mode 100644 index 0000000000000..3f86e7825ee6f --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProviderPropertiesTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.fluent.models.TrustedIdProviderProperties; + +public final class TrustedIdProviderPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TrustedIdProviderProperties model = + BinaryData.fromString("{\"idProvider\":\"iy\"}").toObject(TrustedIdProviderProperties.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TrustedIdProviderProperties model = new TrustedIdProviderProperties(); + model = BinaryData.fromObject(model).toObject(TrustedIdProviderProperties.class); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersCreateOrUpdateWithResponseMockTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 0000000000000..f94446d487302 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.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.datalakestore.DataLakeStoreManager; +import com.azure.resourcemanager.datalakestore.models.TrustedIdProvider; +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 TrustedIdProvidersCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"properties\":{\"idProvider\":\"smv\"},\"name\":\"wyjsflhhcaalnjix\",\"type\":\"xyawj\",\"id\":\"aq\"}"; + + 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); + })); + + DataLakeStoreManager manager = + DataLakeStoreManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + TrustedIdProvider response = + manager + .trustedIdProviders() + .define("uusdttouwa") + .withExistingAccount("wozuhkf", "bsjyofdx") + .withIdProvider("oekqvk") + .create(); + + Assertions.assertEquals("aq", response.id()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersDeleteWithResponseMockTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersDeleteWithResponseMockTests.java new file mode 100644 index 0000000000000..158d1beb5e693 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersDeleteWithResponseMockTests.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.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.datalakestore.DataLakeStoreManager; +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 TrustedIdProvidersDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() 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(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); + })); + + DataLakeStoreManager manager = + DataLakeStoreManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager + .trustedIdProviders() + .deleteWithResponse("nxipeil", "jzuaejxdultskzbb", "dzumveekg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersGetWithResponseMockTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersGetWithResponseMockTests.java new file mode 100644 index 0000000000000..4f91c6bf1ef2d --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersGetWithResponseMockTests.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.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.datalakestore.DataLakeStoreManager; +import com.azure.resourcemanager.datalakestore.models.TrustedIdProvider; +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 TrustedIdProvidersGetWithResponseMockTests { + @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\":{\"idProvider\":\"y\"},\"name\":\"pvgqzcjrvxdjzlm\",\"type\":\"xkvugfhzov\",\"id\":\"jvzunluthnnp\"}"; + + 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); + })); + + DataLakeStoreManager manager = + DataLakeStoreManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + TrustedIdProvider response = + manager + .trustedIdProviders() + .getWithResponse("rmcqiby", "nojvknmefqsg", "vah", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("jvzunluthnnp", response.id()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersListByAccountMockTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersListByAccountMockTests.java new file mode 100644 index 0000000000000..ffe74dfb76c79 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/TrustedIdProvidersListByAccountMockTests.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.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.datalakestore.DataLakeStoreManager; +import com.azure.resourcemanager.datalakestore.models.TrustedIdProvider; +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 TrustedIdProvidersListByAccountMockTests { + @Test + public void testListByAccount() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"properties\":{\"idProvider\":\"gwyzm\"},\"name\":\"xongmtsavjcbpwxq\",\"type\":\"rknftguvriuhprwm\",\"id\":\"vxqtayriwwroyqbe\"}]}"; + + 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); + })); + + DataLakeStoreManager manager = + DataLakeStoreManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = + manager.trustedIdProviders().listByAccount("nmxiebwwaloayqc", "wrtz", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("vxqtayriwwroyqbe", response.iterator().next().id()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateDataLakeStoreAccountParametersTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateDataLakeStoreAccountParametersTests.java new file mode 100644 index 0000000000000..0dedc0fc6f74f --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateDataLakeStoreAccountParametersTests.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.models.FirewallAllowAzureIpsState; +import com.azure.resourcemanager.datalakestore.models.FirewallState; +import com.azure.resourcemanager.datalakestore.models.TierType; +import com.azure.resourcemanager.datalakestore.models.TrustedIdProviderState; +import com.azure.resourcemanager.datalakestore.models.UpdateDataLakeStoreAccountParameters; +import com.azure.resourcemanager.datalakestore.models.UpdateEncryptionConfig; +import com.azure.resourcemanager.datalakestore.models.UpdateFirewallRuleWithAccountParameters; +import com.azure.resourcemanager.datalakestore.models.UpdateTrustedIdProviderWithAccountParameters; +import com.azure.resourcemanager.datalakestore.models.UpdateVirtualNetworkRuleWithAccountParameters; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class UpdateDataLakeStoreAccountParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UpdateDataLakeStoreAccountParameters model = + BinaryData + .fromString( + "{\"tags\":{\"xv\":\"xsqwpgrjbznorc\",\"xqabnmocpcysh\":\"nb\",\"klj\":\"rzafbljjgpbtoqcj\"},\"properties\":{\"defaultGroup\":\"qidtqajzyu\",\"encryptionConfig\":{},\"firewallRules\":[{\"name\":\"jkrlkhbzhfepg\"}],\"virtualNetworkRules\":[{\"name\":\"xzlocxscp\"}],\"firewallState\":\"Enabled\",\"firewallAllowAzureIps\":\"Enabled\",\"trustedIdProviders\":[{\"name\":\"sglumma\"},{\"name\":\"j\"}],\"trustedIdProviderState\":\"Disabled\",\"newTier\":\"Commitment_1TB\"}}") + .toObject(UpdateDataLakeStoreAccountParameters.class); + Assertions.assertEquals("xsqwpgrjbznorc", model.tags().get("xv")); + Assertions.assertEquals("qidtqajzyu", model.defaultGroup()); + Assertions.assertEquals("jkrlkhbzhfepg", model.firewallRules().get(0).name()); + Assertions.assertEquals("xzlocxscp", model.virtualNetworkRules().get(0).name()); + Assertions.assertEquals(FirewallState.ENABLED, model.firewallState()); + Assertions.assertEquals(FirewallAllowAzureIpsState.ENABLED, model.firewallAllowAzureIps()); + Assertions.assertEquals("sglumma", model.trustedIdProviders().get(0).name()); + Assertions.assertEquals(TrustedIdProviderState.DISABLED, model.trustedIdProviderState()); + Assertions.assertEquals(TierType.COMMITMENT_1TB, model.newTier()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UpdateDataLakeStoreAccountParameters model = + new UpdateDataLakeStoreAccountParameters() + .withTags(mapOf("xv", "xsqwpgrjbznorc", "xqabnmocpcysh", "nb", "klj", "rzafbljjgpbtoqcj")) + .withDefaultGroup("qidtqajzyu") + .withEncryptionConfig(new UpdateEncryptionConfig()) + .withFirewallRules( + Arrays.asList(new UpdateFirewallRuleWithAccountParameters().withName("jkrlkhbzhfepg"))) + .withVirtualNetworkRules( + Arrays.asList(new UpdateVirtualNetworkRuleWithAccountParameters().withName("xzlocxscp"))) + .withFirewallState(FirewallState.ENABLED) + .withFirewallAllowAzureIps(FirewallAllowAzureIpsState.ENABLED) + .withTrustedIdProviders( + Arrays + .asList( + new UpdateTrustedIdProviderWithAccountParameters().withName("sglumma"), + new UpdateTrustedIdProviderWithAccountParameters().withName("j"))) + .withTrustedIdProviderState(TrustedIdProviderState.DISABLED) + .withNewTier(TierType.COMMITMENT_1TB); + model = BinaryData.fromObject(model).toObject(UpdateDataLakeStoreAccountParameters.class); + Assertions.assertEquals("xsqwpgrjbznorc", model.tags().get("xv")); + Assertions.assertEquals("qidtqajzyu", model.defaultGroup()); + Assertions.assertEquals("jkrlkhbzhfepg", model.firewallRules().get(0).name()); + Assertions.assertEquals("xzlocxscp", model.virtualNetworkRules().get(0).name()); + Assertions.assertEquals(FirewallState.ENABLED, model.firewallState()); + Assertions.assertEquals(FirewallAllowAzureIpsState.ENABLED, model.firewallAllowAzureIps()); + Assertions.assertEquals("sglumma", model.trustedIdProviders().get(0).name()); + Assertions.assertEquals(TrustedIdProviderState.DISABLED, model.trustedIdProviderState()); + Assertions.assertEquals(TierType.COMMITMENT_1TB, model.newTier()); + } + + @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/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateFirewallRuleParametersTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateFirewallRuleParametersTests.java new file mode 100644 index 0000000000000..7c537deb3851c --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateFirewallRuleParametersTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.models.UpdateFirewallRuleParameters; +import org.junit.jupiter.api.Assertions; + +public final class UpdateFirewallRuleParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UpdateFirewallRuleParameters model = + BinaryData + .fromString( + "{\"properties\":{\"startIpAddress\":\"tkftutqxlngx\",\"endIpAddress\":\"fgugnxkrxdqmid\"}}") + .toObject(UpdateFirewallRuleParameters.class); + Assertions.assertEquals("tkftutqxlngx", model.startIpAddress()); + Assertions.assertEquals("fgugnxkrxdqmid", model.endIpAddress()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UpdateFirewallRuleParameters model = + new UpdateFirewallRuleParameters().withStartIpAddress("tkftutqxlngx").withEndIpAddress("fgugnxkrxdqmid"); + model = BinaryData.fromObject(model).toObject(UpdateFirewallRuleParameters.class); + Assertions.assertEquals("tkftutqxlngx", model.startIpAddress()); + Assertions.assertEquals("fgugnxkrxdqmid", model.endIpAddress()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateFirewallRulePropertiesTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateFirewallRulePropertiesTests.java new file mode 100644 index 0000000000000..e7715390ad346 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateFirewallRulePropertiesTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.fluent.models.UpdateFirewallRuleProperties; +import org.junit.jupiter.api.Assertions; + +public final class UpdateFirewallRulePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UpdateFirewallRuleProperties model = + BinaryData + .fromString("{\"startIpAddress\":\"fmxa\",\"endIpAddress\":\"fjpgddtocjjxhvp\"}") + .toObject(UpdateFirewallRuleProperties.class); + Assertions.assertEquals("fmxa", model.startIpAddress()); + Assertions.assertEquals("fjpgddtocjjxhvp", model.endIpAddress()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UpdateFirewallRuleProperties model = + new UpdateFirewallRuleProperties().withStartIpAddress("fmxa").withEndIpAddress("fjpgddtocjjxhvp"); + model = BinaryData.fromObject(model).toObject(UpdateFirewallRuleProperties.class); + Assertions.assertEquals("fmxa", model.startIpAddress()); + Assertions.assertEquals("fjpgddtocjjxhvp", model.endIpAddress()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateFirewallRuleWithAccountParametersTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateFirewallRuleWithAccountParametersTests.java new file mode 100644 index 0000000000000..83d179c463a11 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateFirewallRuleWithAccountParametersTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.models.UpdateFirewallRuleWithAccountParameters; +import org.junit.jupiter.api.Assertions; + +public final class UpdateFirewallRuleWithAccountParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UpdateFirewallRuleWithAccountParameters model = + BinaryData + .fromString( + "{\"name\":\"jctbza\",\"properties\":{\"startIpAddress\":\"sycbkbfk\",\"endIpAddress\":\"kdkexxp\"}}") + .toObject(UpdateFirewallRuleWithAccountParameters.class); + Assertions.assertEquals("jctbza", model.name()); + Assertions.assertEquals("sycbkbfk", model.startIpAddress()); + Assertions.assertEquals("kdkexxp", model.endIpAddress()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UpdateFirewallRuleWithAccountParameters model = + new UpdateFirewallRuleWithAccountParameters() + .withName("jctbza") + .withStartIpAddress("sycbkbfk") + .withEndIpAddress("kdkexxp"); + model = BinaryData.fromObject(model).toObject(UpdateFirewallRuleWithAccountParameters.class); + Assertions.assertEquals("jctbza", model.name()); + Assertions.assertEquals("sycbkbfk", model.startIpAddress()); + Assertions.assertEquals("kdkexxp", model.endIpAddress()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateTrustedIdProviderParametersTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateTrustedIdProviderParametersTests.java new file mode 100644 index 0000000000000..5658fe6658801 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateTrustedIdProviderParametersTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.models.UpdateTrustedIdProviderParameters; +import org.junit.jupiter.api.Assertions; + +public final class UpdateTrustedIdProviderParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UpdateTrustedIdProviderParameters model = + BinaryData + .fromString("{\"properties\":{\"idProvider\":\"cbonqvpk\"}}") + .toObject(UpdateTrustedIdProviderParameters.class); + Assertions.assertEquals("cbonqvpk", model.idProvider()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UpdateTrustedIdProviderParameters model = new UpdateTrustedIdProviderParameters().withIdProvider("cbonqvpk"); + model = BinaryData.fromObject(model).toObject(UpdateTrustedIdProviderParameters.class); + Assertions.assertEquals("cbonqvpk", model.idProvider()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateTrustedIdProviderPropertiesTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateTrustedIdProviderPropertiesTests.java new file mode 100644 index 0000000000000..c158b04590f10 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateTrustedIdProviderPropertiesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.fluent.models.UpdateTrustedIdProviderProperties; +import org.junit.jupiter.api.Assertions; + +public final class UpdateTrustedIdProviderPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UpdateTrustedIdProviderProperties model = + BinaryData + .fromString("{\"idProvider\":\"uhrhcffcyddgl\"}") + .toObject(UpdateTrustedIdProviderProperties.class); + Assertions.assertEquals("uhrhcffcyddgl", model.idProvider()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UpdateTrustedIdProviderProperties model = + new UpdateTrustedIdProviderProperties().withIdProvider("uhrhcffcyddgl"); + model = BinaryData.fromObject(model).toObject(UpdateTrustedIdProviderProperties.class); + Assertions.assertEquals("uhrhcffcyddgl", model.idProvider()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateTrustedIdProviderWithAccountParametersTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateTrustedIdProviderWithAccountParametersTests.java new file mode 100644 index 0000000000000..b86c9e8a1c9bb --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateTrustedIdProviderWithAccountParametersTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.models.UpdateTrustedIdProviderWithAccountParameters; +import org.junit.jupiter.api.Assertions; + +public final class UpdateTrustedIdProviderWithAccountParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UpdateTrustedIdProviderWithAccountParameters model = + BinaryData + .fromString("{\"name\":\"qeojnxqbzvddntw\",\"properties\":{\"idProvider\":\"icbtwnpzao\"}}") + .toObject(UpdateTrustedIdProviderWithAccountParameters.class); + Assertions.assertEquals("qeojnxqbzvddntw", model.name()); + Assertions.assertEquals("icbtwnpzao", model.idProvider()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UpdateTrustedIdProviderWithAccountParameters model = + new UpdateTrustedIdProviderWithAccountParameters().withName("qeojnxqbzvddntw").withIdProvider("icbtwnpzao"); + model = BinaryData.fromObject(model).toObject(UpdateTrustedIdProviderWithAccountParameters.class); + Assertions.assertEquals("qeojnxqbzvddntw", model.name()); + Assertions.assertEquals("icbtwnpzao", model.idProvider()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateVirtualNetworkRuleParametersTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateVirtualNetworkRuleParametersTests.java new file mode 100644 index 0000000000000..0c0923c3d20e2 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateVirtualNetworkRuleParametersTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.models.UpdateVirtualNetworkRuleParameters; +import org.junit.jupiter.api.Assertions; + +public final class UpdateVirtualNetworkRuleParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UpdateVirtualNetworkRuleParameters model = + BinaryData + .fromString("{\"properties\":{\"subnetId\":\"lzu\"}}") + .toObject(UpdateVirtualNetworkRuleParameters.class); + Assertions.assertEquals("lzu", model.subnetId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UpdateVirtualNetworkRuleParameters model = new UpdateVirtualNetworkRuleParameters().withSubnetId("lzu"); + model = BinaryData.fromObject(model).toObject(UpdateVirtualNetworkRuleParameters.class); + Assertions.assertEquals("lzu", model.subnetId()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateVirtualNetworkRulePropertiesTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateVirtualNetworkRulePropertiesTests.java new file mode 100644 index 0000000000000..2ed0317594238 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateVirtualNetworkRulePropertiesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.fluent.models.UpdateVirtualNetworkRuleProperties; +import org.junit.jupiter.api.Assertions; + +public final class UpdateVirtualNetworkRulePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UpdateVirtualNetworkRuleProperties model = + BinaryData.fromString("{\"subnetId\":\"i\"}").toObject(UpdateVirtualNetworkRuleProperties.class); + Assertions.assertEquals("i", model.subnetId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UpdateVirtualNetworkRuleProperties model = new UpdateVirtualNetworkRuleProperties().withSubnetId("i"); + model = BinaryData.fromObject(model).toObject(UpdateVirtualNetworkRuleProperties.class); + Assertions.assertEquals("i", model.subnetId()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateVirtualNetworkRuleWithAccountParametersTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateVirtualNetworkRuleWithAccountParametersTests.java new file mode 100644 index 0000000000000..b5fdd1a34c21e --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UpdateVirtualNetworkRuleWithAccountParametersTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.models.UpdateVirtualNetworkRuleWithAccountParameters; +import org.junit.jupiter.api.Assertions; + +public final class UpdateVirtualNetworkRuleWithAccountParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UpdateVirtualNetworkRuleWithAccountParameters model = + BinaryData + .fromString("{\"name\":\"o\",\"properties\":{\"subnetId\":\"hd\"}}") + .toObject(UpdateVirtualNetworkRuleWithAccountParameters.class); + Assertions.assertEquals("o", model.name()); + Assertions.assertEquals("hd", model.subnetId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UpdateVirtualNetworkRuleWithAccountParameters model = + new UpdateVirtualNetworkRuleWithAccountParameters().withName("o").withSubnetId("hd"); + model = BinaryData.fromObject(model).toObject(UpdateVirtualNetworkRuleWithAccountParameters.class); + Assertions.assertEquals("o", model.name()); + Assertions.assertEquals("hd", model.subnetId()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UsageInnerTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UsageInnerTests.java new file mode 100644 index 0000000000000..cd2aa2d11e5fb --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UsageInnerTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.fluent.models.UsageInner; + +public final class UsageInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UsageInner model = + BinaryData + .fromString( + "{\"unit\":\"Bytes\",\"id\":\"bpxjmfl\",\"currentValue\":178812834,\"limit\":1423802799,\"name\":{\"value\":\"kcciwwzjuqkhr\",\"localizedValue\":\"jiwkuofoskghsau\"}}") + .toObject(UsageInner.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UsageInner model = new UsageInner(); + model = BinaryData.fromObject(model).toObject(UsageInner.class); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UsageListResultTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UsageListResultTests.java new file mode 100644 index 0000000000000..e538bd1b50e02 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UsageListResultTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.fluent.models.UsageInner; +import com.azure.resourcemanager.datalakestore.models.UsageListResult; +import java.util.Arrays; + +public final class UsageListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UsageListResult model = + BinaryData + .fromString( + "{\"value\":[{\"unit\":\"Seconds\",\"id\":\"hrdxwzywqsmbs\",\"currentValue\":854764023,\"limit\":1524544291,\"name\":{\"value\":\"ryocfsfksymdd\",\"localizedValue\":\"tki\"}},{\"unit\":\"Seconds\",\"id\":\"qyud\",\"currentValue\":2120884016,\"limit\":346344422,\"name\":{\"value\":\"poczvyifqrvkdvjs\",\"localizedValue\":\"rm\"}},{\"unit\":\"BytesPerSecond\",\"id\":\"watkpnpulexxb\",\"currentValue\":1890498246,\"limit\":1309614398,\"name\":{\"value\":\"iqzbq\",\"localizedValue\":\"sovmyokacspkwl\"}}]}") + .toObject(UsageListResult.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UsageListResult model = + new UsageListResult().withValue(Arrays.asList(new UsageInner(), new UsageInner(), new UsageInner())); + model = BinaryData.fromObject(model).toObject(UsageListResult.class); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UsageNameTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UsageNameTests.java new file mode 100644 index 0000000000000..7cf928e7288ea --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/UsageNameTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.models.UsageName; + +public final class UsageNameTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UsageName model = + BinaryData + .fromString("{\"value\":\"mjmvxieduugidyjr\",\"localizedValue\":\"byao\"}") + .toObject(UsageName.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UsageName model = new UsageName(); + model = BinaryData.fromObject(model).toObject(UsageName.class); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRuleInnerTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRuleInnerTests.java new file mode 100644 index 0000000000000..7ac9aff829d30 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRuleInnerTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.fluent.models.VirtualNetworkRuleInner; +import org.junit.jupiter.api.Assertions; + +public final class VirtualNetworkRuleInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VirtualNetworkRuleInner model = + BinaryData + .fromString( + "{\"properties\":{\"subnetId\":\"uf\"},\"name\":\"pymzidnsezcxtbzs\",\"type\":\"yc\",\"id\":\"newmdwzjeiachbo\"}") + .toObject(VirtualNetworkRuleInner.class); + Assertions.assertEquals("newmdwzjeiachbo", model.id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualNetworkRuleInner model = new VirtualNetworkRuleInner().withId("newmdwzjeiachbo"); + model = BinaryData.fromObject(model).toObject(VirtualNetworkRuleInner.class); + Assertions.assertEquals("newmdwzjeiachbo", model.id()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRuleListResultTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRuleListResultTests.java new file mode 100644 index 0000000000000..633b7f777fe00 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRuleListResultTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.models.VirtualNetworkRuleListResult; + +public final class VirtualNetworkRuleListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VirtualNetworkRuleListResult model = + BinaryData + .fromString( + "{\"value\":[{\"properties\":{\"subnetId\":\"vqdra\"},\"name\":\"jybige\",\"type\":\"qfbow\",\"id\":\"anyktzlcuiywg\"},{\"properties\":{\"subnetId\":\"gndrvynh\"},\"name\":\"pphrcgynco\",\"type\":\"ecfvmm\",\"id\":\"ofsx\"}],\"nextLink\":\"evgbmqjq\"}") + .toObject(VirtualNetworkRuleListResult.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualNetworkRuleListResult model = new VirtualNetworkRuleListResult(); + model = BinaryData.fromObject(model).toObject(VirtualNetworkRuleListResult.class); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulePropertiesTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulePropertiesTests.java new file mode 100644 index 0000000000000..bdd66da09738a --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulePropertiesTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.datalakestore.fluent.models.VirtualNetworkRuleProperties; + +public final class VirtualNetworkRulePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VirtualNetworkRuleProperties model = + BinaryData.fromString("{\"subnetId\":\"flnrosfqpteehzz\"}").toObject(VirtualNetworkRuleProperties.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VirtualNetworkRuleProperties model = new VirtualNetworkRuleProperties(); + model = BinaryData.fromObject(model).toObject(VirtualNetworkRuleProperties.class); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesCreateOrUpdateWithResponseMockTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 0000000000000..f458c9b6f5a0b --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.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.datalakestore.DataLakeStoreManager; +import com.azure.resourcemanager.datalakestore.models.VirtualNetworkRule; +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 VirtualNetworkRulesCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"properties\":{\"subnetId\":\"zqlveualupjmkhf\"},\"name\":\"bbcswsrtjri\",\"type\":\"rbpbewtghfgblcg\",\"id\":\"zvlvqhjkbegib\"}"; + + 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); + })); + + DataLakeStoreManager manager = + DataLakeStoreManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + VirtualNetworkRule response = + manager + .virtualNetworkRules() + .define("zbtd") + .withExistingAccount("klwndnhjdauwhv", "l") + .withSubnetId("xujznbmpowu") + .create(); + + Assertions.assertEquals("zvlvqhjkbegib", response.id()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesDeleteWithResponseMockTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesDeleteWithResponseMockTests.java new file mode 100644 index 0000000000000..302cb513cf6cb --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesDeleteWithResponseMockTests.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.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.datalakestore.DataLakeStoreManager; +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 VirtualNetworkRulesDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() 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(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); + })); + + DataLakeStoreManager manager = + DataLakeStoreManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager + .virtualNetworkRules() + .deleteWithResponse("iotwmcdytdxwit", "nrjawgqwg", "hniskxfbkpyc", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesGetWithResponseMockTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesGetWithResponseMockTests.java new file mode 100644 index 0000000000000..5a46067deefd6 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesGetWithResponseMockTests.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.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.datalakestore.DataLakeStoreManager; +import com.azure.resourcemanager.datalakestore.models.VirtualNetworkRule; +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 VirtualNetworkRulesGetWithResponseMockTests { + @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\":{\"subnetId\":\"shsfwxosowzxcu\"},\"name\":\"cjooxdjebwpucwwf\",\"type\":\"vbvmeu\",\"id\":\"ivyhzceuojgjrwju\"}"; + + 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); + })); + + DataLakeStoreManager manager = + DataLakeStoreManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + VirtualNetworkRule response = + manager + .virtualNetworkRules() + .getWithResponse("wkz", "ali", "urqhaka", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("ivyhzceuojgjrwju", response.id()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesListByAccountMockTests.java b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesListByAccountMockTests.java new file mode 100644 index 0000000000000..2fb0eb9dcb936 --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/java/com/azure/resourcemanager/datalakestore/generated/VirtualNetworkRulesListByAccountMockTests.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakestore.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.datalakestore.DataLakeStoreManager; +import com.azure.resourcemanager.datalakestore.models.VirtualNetworkRule; +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 VirtualNetworkRulesListByAccountMockTests { + @Test + public void testListByAccount() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"properties\":{\"subnetId\":\"pvfadmwsrcr\"},\"name\":\"xpvgo\",\"type\":\"lf\",\"id\":\"sgwbnbbeld\"}]}"; + + 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); + })); + + DataLakeStoreManager manager = + DataLakeStoreManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = + manager.virtualNetworkRules().listByAccount("ljuahaquhcdh", "duala", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("sgwbnbbeld", response.iterator().next().id()); + } +} diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker new file mode 100644 index 0000000000000..1f0955d450f0d --- /dev/null +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker @@ -0,0 +1 @@ +mock-maker-inline