From db1de1370678c6770b45427ff1d5884bbb66a3db Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 6 Jan 2025 03:38:28 -0800 Subject: [PATCH] [Automation] Generate Fluent Lite from Swagger paloaltonetworks#package-2023-09-01 (#43710) --- eng/versioning/version_client.txt | 2 +- .../CHANGELOG.md | 15 +- .../README.md | 22 +- .../SAMPLE.md | 1971 +++++++++++++---- .../pom.xml | 5 +- .../ngfw/PaloAltoNetworksNgfwManager.java | 6 +- .../ngfw/fluent/FirewallsClient.java | 2 +- .../AdvSecurityObjectListResponseInner.java | 56 +- .../ngfw/fluent/models/CertificateObject.java | 71 +- ...ateObjectGlobalRulestackResourceInner.java | 104 +- ...cateObjectLocalRulestackResourceInner.java | 104 +- .../ngfw/fluent/models/ChangelogInner.java | 65 +- .../fluent/models/CountriesResponseInner.java | 55 +- .../models/FirewallDeploymentProperties.java | 107 +- .../fluent/models/FirewallResourceInner.java | 114 +- .../fluent/models/FirewallStatusProperty.java | 57 +- .../models/FirewallStatusResourceInner.java | 102 +- .../FqdnListGlobalRulestackResourceInner.java | 103 +- .../FqdnListLocalRulestackResourceInner.java | 103 +- .../ngfw/fluent/models/FqdnObject.java | 66 +- .../models/GlobalRulestackInfoInner.java | 51 +- .../models/GlobalRulestackResourceInner.java | 116 +- .../fluent/models/ListAppIdResponseInner.java | 55 +- .../models/ListFirewallsResponseInner.java | 56 +- .../models/LocalRulesResourceInner.java | 102 +- .../models/LocalRulestackResourceInner.java | 114 +- .../ngfw/fluent/models/LogSettingsInner.java | 69 +- .../ngfw/fluent/models/OperationInner.java | 57 +- .../fluent/models/PostRulesResourceInner.java | 102 +- .../fluent/models/PreRulesResourceInner.java | 102 +- .../PredefinedUrlCategoriesResponseInner.java | 59 +- ...refixListGlobalRulestackResourceInner.java | 103 +- .../models/PrefixListResourceInner.java | 102 +- .../ngfw/fluent/models/PrefixObject.java | 66 +- .../ngfw/fluent/models/RuleCounterInner.java | 102 +- .../fluent/models/RuleCounterResetInner.java | 60 +- .../ngfw/fluent/models/RuleEntry.java | 130 +- .../fluent/models/RulestackProperties.java | 79 +- .../models/SecurityServicesResponseInner.java | 56 +- .../ngfw/fluent/models/SupportInfoInner.java | 92 +- ...icateObjectGlobalRulestacksClientImpl.java | 12 +- ...CertificateObjectGlobalRulestacksImpl.java | 6 +- ...icateObjectLocalRulestackResourceImpl.java | 6 +- ...ficateObjectLocalRulestacksClientImpl.java | 8 +- .../CertificateObjectLocalRulestacksImpl.java | 30 +- .../implementation/FirewallResourceImpl.java | 4 +- .../FirewallStatusClientImpl.java | 8 +- .../implementation/FirewallStatusImpl.java | 4 +- .../implementation/FirewallsClientImpl.java | 26 +- .../ngfw/implementation/FirewallsImpl.java | 24 +- .../FqdnListGlobalRulestacksClientImpl.java | 8 +- .../FqdnListGlobalRulestacksImpl.java | 6 +- .../FqdnListLocalRulestackResourceImpl.java | 6 +- .../FqdnListLocalRulestacksClientImpl.java | 8 +- .../FqdnListLocalRulestacksImpl.java | 30 +- .../GlobalRulestacksClientImpl.java | 8 +- .../implementation/GlobalRulestacksImpl.java | 4 +- .../implementation/LocalRulesClientImpl.java | 8 +- .../ngfw/implementation/LocalRulesImpl.java | 28 +- .../LocalRulesResourceImpl.java | 6 +- .../LocalRulestackResourceImpl.java | 4 +- .../LocalRulestacksClientImpl.java | 16 +- .../implementation/LocalRulestacksImpl.java | 24 +- .../implementation/OperationsClientImpl.java | 8 +- .../ngfw/implementation/OperationsImpl.java | 4 +- .../PaloAltoNetworksCloudngfwImpl.java | 3 +- .../implementation/PostRulesClientImpl.java | 12 +- .../ngfw/implementation/PostRulesImpl.java | 4 +- .../implementation/PreRulesClientImpl.java | 8 +- .../ngfw/implementation/PreRulesImpl.java | 4 +- .../PrefixListGlobalRulestacksClientImpl.java | 12 +- .../PrefixListGlobalRulestacksImpl.java | 6 +- .../PrefixListLocalRulestacksClientImpl.java | 8 +- .../PrefixListLocalRulestacksImpl.java | 28 +- .../PrefixListResourceImpl.java | 6 +- .../{Utils.java => ResourceManagerUtils.java} | 6 +- .../ngfw/models/ActionEnum.java | 2 - .../ngfw/models/ActionType.java | 2 - .../ngfw/models/AdvSecurityObjectModel.java | 56 +- .../models/AdvSecurityObjectTypeEnum.java | 2 - .../ngfw/models/AppSeenData.java | 55 +- .../ngfw/models/AppSeenInfo.java | 98 +- .../ngfw/models/ApplicationInsights.java | 49 +- ...ourceManagerManagedIdentityProperties.java | 70 +- ...reResourceManagerUserAssignedIdentity.java | 51 +- .../ngfw/models/BillingCycle.java | 2 - .../ngfw/models/BooleanEnum.java | 2 - .../ngfw/models/Category.java | 60 +- ...jectGlobalRulestackResourceListResult.java | 60 +- ...bjectLocalRulestackResourceListResult.java | 59 +- .../paloaltonetworks/ngfw/models/Country.java | 53 +- .../ngfw/models/DecryptionRuleTypeEnum.java | 2 - .../ngfw/models/DefaultMode.java | 2 - .../ngfw/models/DestinationAddr.java | 66 +- .../ngfw/models/DnsProxy.java | 2 - .../ngfw/models/DnsSettings.java | 56 +- .../ngfw/models/EgressNat.java | 2 - .../ngfw/models/EnabledDnsType.java | 2 - .../ngfw/models/EndpointConfiguration.java | 58 +- .../ngfw/models/EventHub.java | 61 +- .../ngfw/models/FirewallResource.java | 2 +- .../models/FirewallResourceListResult.java | 57 +- .../ngfw/models/FirewallResourceUpdate.java | 57 +- .../FirewallResourceUpdateProperties.java | 85 +- .../FirewallStatusResourceListResult.java | 58 +- .../ngfw/models/Firewalls.java | 2 +- ...ListGlobalRulestackResourceListResult.java | 59 +- ...nListLocalRulestackResourceListResult.java | 59 +- .../ngfw/models/FrontendSetting.java | 76 +- .../GlobalRulestackResourceListResult.java | 58 +- .../models/GlobalRulestackResourceUpdate.java | 56 +- ...obalRulestackResourceUpdateProperties.java | 81 +- .../ngfw/models/HealthStatus.java | 2 - .../ngfw/models/IpAddress.java | 49 +- .../ngfw/models/IpAddressSpace.java | 49 +- .../models/LocalRulesResourceListResult.java | 57 +- .../LocalRulestackResourceListResult.java | 58 +- .../models/LocalRulestackResourceUpdate.java | 58 +- ...ocalRulestackResourceUpdateProperties.java | 80 +- .../ngfw/models/LogDestination.java | 53 +- .../ngfw/models/LogOption.java | 2 - .../paloaltonetworks/ngfw/models/LogType.java | 2 - .../ngfw/models/ManagedIdentityType.java | 2 - .../ngfw/models/MarketplaceDetails.java | 67 +- .../models/MarketplaceSubscriptionStatus.java | 2 - .../ngfw/models/MonitorLog.java | 61 +- .../ngfw/models/NameDescriptionObject.java | 54 +- .../ngfw/models/NetworkProfile.java | 87 +- .../ngfw/models/NetworkType.java | 2 - .../ngfw/models/OperationDisplay.java | 65 +- .../ngfw/models/OperationListResult.java | 52 +- .../paloaltonetworks/ngfw/models/Origin.java | 2 - .../ngfw/models/PanoramaConfig.java | 75 +- .../ngfw/models/PanoramaStatus.java | 47 +- .../ngfw/models/PlanData.java | 67 +- .../models/PostRulesResourceListResult.java | 57 +- .../models/PreRulesResourceListResult.java | 57 +- .../ngfw/models/PredefinedUrlCategory.java | 58 +- ...ListGlobalRulestackResourceListResult.java | 59 +- .../models/PrefixListResourceListResult.java | 57 +- .../ngfw/models/ProtocolType.java | 2 - .../ngfw/models/ProvisioningState.java | 2 - .../models/ReadOnlyProvisioningState.java | 2 - .../ngfw/models/RulestackDetails.java | 53 +- .../ngfw/models/ScopeType.java | 2 - .../ngfw/models/SecurityServices.java | 73 +- .../ngfw/models/SecurityServicesTypeEnum.java | 2 - .../ngfw/models/SecurityServicesTypeList.java | 56 +- .../ngfw/models/ServerStatus.java | 2 - .../ngfw/models/SourceAddr.java | 61 +- .../ngfw/models/StateEnum.java | 2 - .../ngfw/models/StorageAccount.java | 53 +- .../paloaltonetworks/ngfw/models/TagInfo.java | 57 +- .../ngfw/models/UsageType.java | 2 - .../ngfw/models/VnetConfiguration.java | 71 +- .../ngfw/models/VwanConfiguration.java | 66 +- .../src/main/java/module-info.java | 5 +- .../proxy-config.json | 2 +- .../reflect-config.json | 557 +---- ...tGlobalRulestackCreateOrUpdateSamples.java | 20 +- ...ficateObjectGlobalRulestackGetSamples.java | 8 +- ...ctLocalRulestackCreateOrUpdateSamples.java | 19 +- ...cateObjectLocalRulestackDeleteSamples.java | 8 +- ...ificateObjectLocalRulestackGetSamples.java | 8 +- ...RulestackListByLocalRulestacksSamples.java | 8 +- .../FirewallsCreateOrUpdateSamples.java | 22 +- .../FirewallsGetByResourceGroupSamples.java | 8 +- .../FirewallsGetGlobalRulestackSamples.java | 8 +- .../FirewallsGetSupportInfoSamples.java | 8 +- .../FirewallsSaveLogProfileSamples.java | 104 +- .../generated/FirewallsUpdateSamples.java | 21 +- ...tGlobalRulestackCreateOrUpdateSamples.java | 19 +- ...stLocalRulestackCreateOrUpdateSamples.java | 18 +- .../FqdnListLocalRulestackGetSamples.java | 8 +- .../GlobalRulestackCreateOrUpdateSamples.java | 41 +- ...ackListAdvancedSecurityObjectsSamples.java | 10 +- .../GlobalRulestackListAppIdsSamples.java | 8 +- ...ackListPredefinedUrlCategoriesSamples.java | 8 +- ...lRulestackListSecurityServicesSamples.java | 10 +- .../GlobalRulestackUpdateSamples.java | 30 +- .../LocalRulesCreateOrUpdateSamples.java | 39 +- .../LocalRulesGetCountersSamples.java | 8 +- .../LocalRulesRefreshCountersSamples.java | 8 +- .../LocalRulesResetCountersSamples.java | 8 +- .../LocalRulestacksCreateOrUpdateSamples.java | 23 +- .../LocalRulestacksGetSupportInfoSamples.java | 8 +- ...cksListAdvancedSecurityObjectsSamples.java | 11 +- .../LocalRulestacksListAppIdsSamples.java | 9 +- .../LocalRulestacksListCountriesSamples.java | 8 +- ...cksListPredefinedUrlCategoriesSamples.java | 9 +- ...RulestacksListSecurityServicesSamples.java | 10 +- .../LocalRulestacksUpdateSamples.java | 29 +- .../PostRulesCreateOrUpdateSamples.java | 51 +- .../PreRulesCreateOrUpdateSamples.java | 51 +- ...tGlobalRulestackCreateOrUpdateSamples.java | 19 +- ...stLocalRulestackCreateOrUpdateSamples.java | 18 +- .../PrefixListLocalRulestackGetSamples.java | 8 +- ...RulestackListByLocalRulestacksSamples.java | 8 +- ...obalRulestacksCreateOrUpdateMockTests.java | 25 +- ...ObjectGlobalRulestacksDeleteMockTests.java | 25 +- ...balRulestacksGetWithResponseMockTests.java | 25 +- ...teObjectGlobalRulestacksListMockTests.java | 25 +- ...ocalRulestacksCreateOrUpdateMockTests.java | 25 +- ...eObjectLocalRulestacksDeleteMockTests.java | 25 +- ...calRulestacksGetWithResponseMockTests.java | 25 +- ...estacksListByLocalRulestacksMockTests.java | 25 +- ...irewallStatusGetWithResponseMockTests.java | 25 +- ...irewallStatusListByFirewallsMockTests.java | 25 +- .../generated/FirewallsDeleteMockTests.java | 25 +- ...tGlobalRulestackWithResponseMockTests.java | 25 +- ...lsGetSupportInfoWithResponseMockTests.java | 25 +- ...obalRulestacksCreateOrUpdateMockTests.java | 25 +- ...dnListGlobalRulestacksDeleteMockTests.java | 25 +- ...balRulestacksGetWithResponseMockTests.java | 25 +- ...FqdnListGlobalRulestacksListMockTests.java | 25 +- ...ocalRulestacksCreateOrUpdateMockTests.java | 25 +- ...qdnListLocalRulestacksDeleteMockTests.java | 25 +- ...calRulestacksGetWithResponseMockTests.java | 25 +- ...estacksListByLocalRulestacksMockTests.java | 25 +- ...obalRulestacksCreateOrUpdateMockTests.java | 25 +- .../GlobalRulestacksDeleteMockTests.java | 25 +- ...acksGetChangeLogWithResponseMockTests.java | 25 +- ...balRulestacksGetWithResponseMockTests.java | 25 +- ...dSecurityObjectsWithResponseMockTests.java | 25 +- ...stacksListAppIdsWithResponseMockTests.java | 25 +- ...cksListFirewallsWithResponseMockTests.java | 25 +- .../GlobalRulestacksListMockTests.java | 25 +- ...nedUrlCategoriesWithResponseMockTests.java | 25 +- ...SecurityServicesWithResponseMockTests.java | 25 +- ...RulestacksRevertWithResponseMockTests.java | 25 +- ...RulestacksUpdateWithResponseMockTests.java | 25 +- .../generated/LocalRulesDeleteMockTests.java | 25 +- ...RulesGetCountersWithResponseMockTests.java | 25 +- ...sRefreshCountersWithResponseMockTests.java | 25 +- ...lesResetCountersWithResponseMockTests.java | 25 +- ...ocalRulestacksCreateOrUpdateMockTests.java | 25 +- .../LocalRulestacksDeleteMockTests.java | 25 +- ...tByResourceGroupWithResponseMockTests.java | 25 +- ...acksGetChangeLogWithResponseMockTests.java | 25 +- ...ksGetSupportInfoWithResponseMockTests.java | 25 +- ...dSecurityObjectsWithResponseMockTests.java | 25 +- ...stacksListAppIdsWithResponseMockTests.java | 25 +- ...ulestacksListByResourceGroupMockTests.java | 25 +- ...cksListFirewallsWithResponseMockTests.java | 25 +- .../LocalRulestacksListMockTests.java | 25 +- ...nedUrlCategoriesWithResponseMockTests.java | 25 +- ...SecurityServicesWithResponseMockTests.java | 25 +- ...RulestacksRevertWithResponseMockTests.java | 25 +- .../generated/OperationsListMockTests.java | 25 +- .../generated/PostRulesDeleteMockTests.java | 25 +- ...RulesGetCountersWithResponseMockTests.java | 25 +- ...sRefreshCountersWithResponseMockTests.java | 25 +- ...lesResetCountersWithResponseMockTests.java | 25 +- .../generated/PreRulesDeleteMockTests.java | 25 +- ...RulesGetCountersWithResponseMockTests.java | 25 +- ...sRefreshCountersWithResponseMockTests.java | 25 +- ...lesResetCountersWithResponseMockTests.java | 25 +- ...obalRulestacksCreateOrUpdateMockTests.java | 25 +- ...ixListGlobalRulestacksDeleteMockTests.java | 25 +- ...balRulestacksGetWithResponseMockTests.java | 25 +- ...efixListGlobalRulestacksListMockTests.java | 25 +- ...ocalRulestacksCreateOrUpdateMockTests.java | 25 +- ...fixListLocalRulestacksDeleteMockTests.java | 25 +- ...calRulestacksGetWithResponseMockTests.java | 25 +- ...estacksListByLocalRulestacksMockTests.java | 25 +- 265 files changed, 7727 insertions(+), 3736 deletions(-) rename sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/{Utils.java => ResourceManagerUtils.java} (99%) diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index aec69c943eccc..6bbeb9b796516 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -433,7 +433,7 @@ com.azure.resourcemanager:azure-resourcemanager-containerservicefleet;1.1.0;1.2. com.azure.resourcemanager:azure-resourcemanager-storagemover;1.3.0;1.4.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-graphservices;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-voiceservices;1.1.0;1.2.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-paloaltonetworks-ngfw;1.1.0;1.2.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-paloaltonetworks-ngfw;1.1.0;1.2.0 com.azure.resourcemanager:azure-resourcemanager-newrelicobservability;1.2.0;1.3.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-qumulo;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-selfhelp;1.0.0;1.1.0-beta.6 diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/CHANGELOG.md b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/CHANGELOG.md index c16a57a39d9db..c3624048d7f87 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/CHANGELOG.md +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/CHANGELOG.md @@ -1,14 +1,21 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 1.2.0 (2025-01-06) -### Features Added +- Azure Resource Manager PaloAlto Networks Ngfw client library for Java. This package contains Microsoft Azure SDK for PaloAlto Networks Ngfw Management SDK. Package tag package-2023-09-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### Serialization/Deserialization change + +- `Jackson` is removed from dependency and no longer supported. + +##### Migration Guide -### Other Changes +If you are using `Jackson`/`ObjectMapper` for manual serialization/deserialization, configure your `ObjectMapper` for backward compatibility: +```java +objectMapper.registerModule(com.azure.core.serializer.json.jackson.JacksonJsonProvider.getJsonSerializableDatabindModule()); +``` ## 1.1.0 (2023-11-15) diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/README.md b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/README.md index d8eb72a1b1625..0d739675f634f 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/README.md +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-paloaltonetworks-ngfw - 1.1.0 + 1.2.0 ``` [//]: # ({x-version-update-end}) @@ -45,15 +45,11 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. - -With above configuration, `azure` client can be authenticated using the following code: +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -74,6 +70,15 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +```java +localRulestackResource = paloAltoNetworksNgfwManager.localRulestacks() + .define(localRulestackName) + .withRegion(REGION) + .withExistingResourceGroup(resourceGroupName) + .withDefaultMode(DefaultMode.NONE) + .withScope(ScopeType.LOCAL) + .create(); +``` [Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/SAMPLE.md) @@ -97,6 +102,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/SAMPLE.md b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/SAMPLE.md index 360da5e1c655a..bf3952c513596 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/SAMPLE.md +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/SAMPLE.md @@ -135,34 +135,49 @@ ```java import com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.CertificateObjectGlobalRulestackResourceInner; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum; -import java.util.stream.Collectors; /** * Samples for CertificateObjectGlobalRulestack CreateOrUpdate. */ public final class CertificateObjectGlobalRulestackCreateOrUpdateSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/CertificateObjectGlobalRulestack_CreateOrUpdate_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * CertificateObjectGlobalRulestack_CreateOrUpdate_MinimumSet_Gen.json */ /** * Sample code: CertificateObjectGlobalRulestack_CreateOrUpdate_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void certificateObjectGlobalRulestackCreateOrUpdateMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectGlobalRulestacks().createOrUpdate("praval", "armid1", new CertificateObjectGlobalRulestackResourceInner().withCertificateSelfSigned(BooleanEnum.TRUE), com.azure.core.util.Context.NONE); + public static void certificateObjectGlobalRulestackCreateOrUpdateMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.certificateObjectGlobalRulestacks() + .createOrUpdate("praval", "armid1", + new CertificateObjectGlobalRulestackResourceInner().withCertificateSelfSigned(BooleanEnum.TRUE), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/CertificateObjectGlobalRulestack_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * CertificateObjectGlobalRulestack_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: CertificateObjectGlobalRulestack_CreateOrUpdate_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void certificateObjectGlobalRulestackCreateOrUpdateMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectGlobalRulestacks().createOrUpdate("praval", "armid1", new CertificateObjectGlobalRulestackResourceInner().withCertificateSignerResourceId("").withCertificateSelfSigned(BooleanEnum.TRUE).withAuditComment("comment").withDescription("description").withEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), com.azure.core.util.Context.NONE); + public static void certificateObjectGlobalRulestackCreateOrUpdateMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.certificateObjectGlobalRulestacks() + .createOrUpdate("praval", "armid1", + new CertificateObjectGlobalRulestackResourceInner().withCertificateSignerResourceId("") + .withCertificateSelfSigned(BooleanEnum.TRUE) + .withAuditComment("comment") + .withDescription("description") + .withEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), + com.azure.core.util.Context.NONE); } } ``` @@ -175,26 +190,32 @@ public final class CertificateObjectGlobalRulestackCreateOrUpdateSamples { */ public final class CertificateObjectGlobalRulestackDeleteSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/CertificateObjectGlobalRulestack_Delete_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * CertificateObjectGlobalRulestack_Delete_MaximumSet_Gen.json */ /** * Sample code: CertificateObjectGlobalRulestack_Delete_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void certificateObjectGlobalRulestackDeleteMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void certificateObjectGlobalRulestackDeleteMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.certificateObjectGlobalRulestacks().delete("praval", "armid1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/CertificateObjectGlobalRulestack_Delete_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * CertificateObjectGlobalRulestack_Delete_MinimumSet_Gen.json */ /** * Sample code: CertificateObjectGlobalRulestack_Delete_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void certificateObjectGlobalRulestackDeleteMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void certificateObjectGlobalRulestackDeleteMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.certificateObjectGlobalRulestacks().delete("praval", "armid1", com.azure.core.util.Context.NONE); } } @@ -208,27 +229,35 @@ public final class CertificateObjectGlobalRulestackDeleteSamples { */ public final class CertificateObjectGlobalRulestackGetSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/CertificateObjectGlobalRulestack_Get_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * CertificateObjectGlobalRulestack_Get_MinimumSet_Gen.json */ /** * Sample code: CertificateObjectGlobalRulestack_Get_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void certificateObjectGlobalRulestackGetMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectGlobalRulestacks().getWithResponse("praval", "armid1", com.azure.core.util.Context.NONE); + public static void certificateObjectGlobalRulestackGetMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.certificateObjectGlobalRulestacks() + .getWithResponse("praval", "armid1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/CertificateObjectGlobalRulestack_Get_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * CertificateObjectGlobalRulestack_Get_MaximumSet_Gen.json */ /** * Sample code: CertificateObjectGlobalRulestack_Get_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void certificateObjectGlobalRulestackGetMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectGlobalRulestacks().getWithResponse("praval", "armid1", com.azure.core.util.Context.NONE); + public static void certificateObjectGlobalRulestackGetMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.certificateObjectGlobalRulestacks() + .getWithResponse("praval", "armid1", com.azure.core.util.Context.NONE); } } ``` @@ -241,26 +270,32 @@ public final class CertificateObjectGlobalRulestackGetSamples { */ public final class CertificateObjectGlobalRulestackListSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/CertificateObjectGlobalRulestack_List_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * CertificateObjectGlobalRulestack_List_MaximumSet_Gen.json */ /** * Sample code: CertificateObjectGlobalRulestack_List_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void certificateObjectGlobalRulestackListMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void certificateObjectGlobalRulestackListMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.certificateObjectGlobalRulestacks().list("praval", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/CertificateObjectGlobalRulestack_List_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * CertificateObjectGlobalRulestack_List_MinimumSet_Gen.json */ /** * Sample code: CertificateObjectGlobalRulestack_List_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void certificateObjectGlobalRulestackListMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void certificateObjectGlobalRulestackListMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.certificateObjectGlobalRulestacks().list("praval", com.azure.core.util.Context.NONE); } } @@ -270,34 +305,51 @@ public final class CertificateObjectGlobalRulestackListSamples { ```java import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum; -import java.util.stream.Collectors; /** * Samples for CertificateObjectLocalRulestack CreateOrUpdate. */ public final class CertificateObjectLocalRulestackCreateOrUpdateSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/CertificateObjectLocalRulestack_CreateOrUpdate_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * CertificateObjectLocalRulestack_CreateOrUpdate_MinimumSet_Gen.json */ /** * Sample code: CertificateObjectLocalRulestack_CreateOrUpdate_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void certificateObjectLocalRulestackCreateOrUpdateMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectLocalRulestacks().define("armid1").withExistingLocalRulestack("rgopenapi", "lrs1").withCertificateSelfSigned(BooleanEnum.TRUE).create(); + public static void certificateObjectLocalRulestackCreateOrUpdateMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.certificateObjectLocalRulestacks() + .define("armid1") + .withExistingLocalRulestack("rgopenapi", "lrs1") + .withCertificateSelfSigned(BooleanEnum.TRUE) + .create(); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/CertificateObjectLocalRulestack_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * CertificateObjectLocalRulestack_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: CertificateObjectLocalRulestack_CreateOrUpdate_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void certificateObjectLocalRulestackCreateOrUpdateMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectLocalRulestacks().define("armid1").withExistingLocalRulestack("rgopenapi", "lrs1").withCertificateSelfSigned(BooleanEnum.TRUE).withCertificateSignerResourceId("").withAuditComment("comment").withDescription("description").withEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c27").create(); + public static void certificateObjectLocalRulestackCreateOrUpdateMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.certificateObjectLocalRulestacks() + .define("armid1") + .withExistingLocalRulestack("rgopenapi", "lrs1") + .withCertificateSelfSigned(BooleanEnum.TRUE) + .withCertificateSignerResourceId("") + .withAuditComment("comment") + .withDescription("description") + .withEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c27") + .create(); } } ``` @@ -310,27 +362,35 @@ public final class CertificateObjectLocalRulestackCreateOrUpdateSamples { */ public final class CertificateObjectLocalRulestackDeleteSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/CertificateObjectLocalRulestack_Delete_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * CertificateObjectLocalRulestack_Delete_MaximumSet_Gen.json */ /** * Sample code: CertificateObjectLocalRulestack_Delete_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void certificateObjectLocalRulestackDeleteMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectLocalRulestacks().delete("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); + public static void certificateObjectLocalRulestackDeleteMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.certificateObjectLocalRulestacks() + .delete("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/CertificateObjectLocalRulestack_Delete_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * CertificateObjectLocalRulestack_Delete_MinimumSet_Gen.json */ /** * Sample code: CertificateObjectLocalRulestack_Delete_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void certificateObjectLocalRulestackDeleteMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectLocalRulestacks().delete("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); + public static void certificateObjectLocalRulestackDeleteMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.certificateObjectLocalRulestacks() + .delete("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); } } ``` @@ -343,27 +403,35 @@ public final class CertificateObjectLocalRulestackDeleteSamples { */ public final class CertificateObjectLocalRulestackGetSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/CertificateObjectLocalRulestack_Get_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * CertificateObjectLocalRulestack_Get_MaximumSet_Gen.json */ /** * Sample code: CertificateObjectLocalRulestack_Get_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void certificateObjectLocalRulestackGetMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectLocalRulestacks().getWithResponse("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); + public static void certificateObjectLocalRulestackGetMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.certificateObjectLocalRulestacks() + .getWithResponse("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/CertificateObjectLocalRulestack_Get_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * CertificateObjectLocalRulestack_Get_MinimumSet_Gen.json */ /** * Sample code: CertificateObjectLocalRulestack_Get_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void certificateObjectLocalRulestackGetMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectLocalRulestacks().getWithResponse("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); + public static void certificateObjectLocalRulestackGetMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.certificateObjectLocalRulestacks() + .getWithResponse("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); } } ``` @@ -376,27 +444,35 @@ public final class CertificateObjectLocalRulestackGetSamples { */ public final class CertificateObjectLocalRulestackListByLocalRulestacksSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/CertificateObjectLocalRulestack_ListByLocalRulestacks_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * CertificateObjectLocalRulestack_ListByLocalRulestacks_MaximumSet_Gen.json */ /** * Sample code: CertificateObjectLocalRulestack_ListByLocalRulestacks_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void certificateObjectLocalRulestackListByLocalRulestacksMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectLocalRulestacks().listByLocalRulestacks("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); + public static void certificateObjectLocalRulestackListByLocalRulestacksMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.certificateObjectLocalRulestacks() + .listByLocalRulestacks("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/CertificateObjectLocalRulestack_ListByLocalRulestacks_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * CertificateObjectLocalRulestack_ListByLocalRulestacks_MinimumSet_Gen.json */ /** * Sample code: CertificateObjectLocalRulestack_ListByLocalRulestacks_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void certificateObjectLocalRulestackListByLocalRulestacksMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectLocalRulestacks().listByLocalRulestacks("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); + public static void certificateObjectLocalRulestackListByLocalRulestacksMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.certificateObjectLocalRulestacks() + .listByLocalRulestacks("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); } } ``` @@ -409,26 +485,32 @@ public final class CertificateObjectLocalRulestackListByLocalRulestacksSamples { */ public final class FirewallStatusGetSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/FirewallStatus_Get_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * FirewallStatus_Get_MinimumSet_Gen.json */ /** * Sample code: FirewallStatus_Get_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallStatusGetMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void firewallStatusGetMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.firewallStatus().getWithResponse("rgopenapi", "firewall1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/FirewallStatus_Get_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * FirewallStatus_Get_MaximumSet_Gen.json */ /** * Sample code: FirewallStatus_Get_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallStatusGetMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void firewallStatusGetMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.firewallStatus().getWithResponse("rgopenapi", "firewall1", com.azure.core.util.Context.NONE); } } @@ -442,26 +524,32 @@ public final class FirewallStatusGetSamples { */ public final class FirewallStatusListByFirewallsSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/FirewallStatus_ListByFirewalls_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * FirewallStatus_ListByFirewalls_MaximumSet_Gen.json */ /** * Sample code: FirewallStatus_ListByFirewalls_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallStatusListByFirewallsMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void firewallStatusListByFirewallsMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.firewallStatus().listByFirewalls("rgopenapi", "firewall1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/FirewallStatus_ListByFirewalls_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * FirewallStatus_ListByFirewalls_MinimumSet_Gen.json */ /** * Sample code: FirewallStatus_ListByFirewalls_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallStatusListByFirewallsMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void firewallStatusListByFirewallsMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.firewallStatus().listByFirewalls("rgopenapi", "firewall1", com.azure.core.util.Context.NONE); } } @@ -497,34 +585,123 @@ import com.azure.resourcemanager.paloaltonetworks.ngfw.models.VwanConfiguration; import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import java.util.stream.Collectors; /** * Samples for Firewalls CreateOrUpdate. */ public final class FirewallsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/Firewalls_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * Firewalls_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: Firewalls_CreateOrUpdate_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallsCreateOrUpdateMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.firewalls().define("firewall1").withRegion("eastus").withExistingResourceGroup("firewall-rg").withNetworkProfile(new NetworkProfile().withVnetConfiguration(new VnetConfiguration().withVnet(new IpAddressSpace().withResourceId("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet").withAddressSpace("10.1.0.0/16")).withTrustSubnet(new IpAddressSpace().withResourceId("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-trust-subnet").withAddressSpace("10.1.1.0/24")).withUnTrustSubnet(new IpAddressSpace().withResourceId("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet").withAddressSpace("10.1.1.0/24")).withIpOfTrustSubnetForUdr(new IpAddress().withResourceId("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet").withAddress("10.1.1.0/24"))).withVwanConfiguration(new VwanConfiguration().withNetworkVirtualApplianceId("2bf4a339-294d-4c25-b0b2-ef649e9f5c12").withVHub(new IpAddressSpace().withResourceId("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet").withAddressSpace("10.1.1.0/24")).withTrustSubnet(new IpAddressSpace().withResourceId("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-trust-subnet").withAddressSpace("10.1.1.0/24")).withUnTrustSubnet(new IpAddressSpace().withResourceId("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet").withAddressSpace("10.1.1.0/24")).withIpOfTrustSubnetForUdr(new IpAddress().withResourceId("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet").withAddress("10.1.1.0/24"))).withNetworkType(NetworkType.VNET).withPublicIps(Arrays.asList(new IpAddress().withResourceId("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-PublicIp1").withAddress("20.22.92.11"))).withEnableEgressNat(EgressNat.ENABLED).withEgressNatIp(Arrays.asList(new IpAddress().withResourceId("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-egressNatIp1").withAddress("20.22.92.111"))).withTrustedRanges(Arrays.asList("20.22.92.11"))).withDnsSettings(new DnsSettings().withEnableDnsProxy(DnsProxy.DISABLED).withEnabledDnsType(EnabledDnsType.CUSTOM).withDnsServers(Arrays.asList(new IpAddress().withResourceId("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-egressNatIp1").withAddress("20.22.92.111")))).withPlanData(new PlanData().withUsageType(UsageType.PAYG).withBillingCycle(BillingCycle.MONTHLY).withPlanId("liftrpantestplan")).withMarketplaceDetails(new MarketplaceDetails().withOfferId("liftr-pan-ame-test").withPublisherId("isvtestuklegacy").withMarketplaceSubscriptionStatus(MarketplaceSubscriptionStatus.PENDING_FULFILLMENT_START)).withTags(mapOf("tagName", "value")).withIdentity(new AzureResourceManagerManagedIdentityProperties().withType(ManagedIdentityType.NONE).withUserAssignedIdentities(mapOf("key16", new AzureResourceManagerUserAssignedIdentity().withClientId("aaaa").withPrincipalId("aaaaaaaaaaaaaaa")))).withPanEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c12").withIsPanoramaManaged(BooleanEnum.TRUE).withPanoramaConfig(new PanoramaConfig().withConfigString("bas64EncodedString")).withAssociatedRulestack(new RulestackDetails().withResourceId("lrs1").withRulestackId("PANRSID").withLocation("eastus")).withFrontEndSettings(Arrays.asList(new FrontendSetting().withName("frontendsetting11").withProtocol(ProtocolType.TCP).withFrontendConfiguration(new EndpointConfiguration().withPort("80").withAddress(new IpAddress().withResourceId("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-frontendSettingIp1").withAddress("20.22.91.251"))).withBackendConfiguration(new EndpointConfiguration().withPort("80").withAddress(new IpAddress().withResourceId("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-frontendSettingIp2").withAddress("20.22.32.136"))))).create(); - } - - /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/Firewalls_CreateOrUpdate_MinimumSet_Gen.json + public static void firewallsCreateOrUpdateMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.firewalls() + .define("firewall1") + .withRegion("eastus") + .withExistingResourceGroup("firewall-rg") + .withNetworkProfile(new NetworkProfile().withVnetConfiguration(new VnetConfiguration() + .withVnet(new IpAddressSpace().withResourceId( + "/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet") + .withAddressSpace("10.1.0.0/16")) + .withTrustSubnet(new IpAddressSpace().withResourceId( + "/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-trust-subnet") + .withAddressSpace("10.1.1.0/24")) + .withUnTrustSubnet(new IpAddressSpace().withResourceId( + "/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet") + .withAddressSpace("10.1.1.0/24")) + .withIpOfTrustSubnetForUdr(new IpAddress().withResourceId( + "/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet") + .withAddress("10.1.1.0/24"))) + .withVwanConfiguration(new VwanConfiguration() + .withNetworkVirtualApplianceId("2bf4a339-294d-4c25-b0b2-ef649e9f5c12") + .withVHub(new IpAddressSpace().withResourceId( + "/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet") + .withAddressSpace("10.1.1.0/24")) + .withTrustSubnet(new IpAddressSpace().withResourceId( + "/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-trust-subnet") + .withAddressSpace("10.1.1.0/24")) + .withUnTrustSubnet(new IpAddressSpace().withResourceId( + "/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet") + .withAddressSpace("10.1.1.0/24")) + .withIpOfTrustSubnetForUdr(new IpAddress().withResourceId( + "/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet") + .withAddress("10.1.1.0/24"))) + .withNetworkType(NetworkType.VNET) + .withPublicIps(Arrays.asList(new IpAddress().withResourceId( + "/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-PublicIp1") + .withAddress("20.22.92.11"))) + .withEnableEgressNat(EgressNat.ENABLED) + .withEgressNatIp(Arrays.asList(new IpAddress().withResourceId( + "/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-egressNatIp1") + .withAddress("20.22.92.111"))) + .withTrustedRanges(Arrays.asList("20.22.92.11"))) + .withDnsSettings(new DnsSettings().withEnableDnsProxy(DnsProxy.DISABLED) + .withEnabledDnsType(EnabledDnsType.CUSTOM) + .withDnsServers(Arrays.asList(new IpAddress().withResourceId( + "/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-egressNatIp1") + .withAddress("20.22.92.111")))) + .withPlanData(new PlanData().withUsageType(UsageType.PAYG) + .withBillingCycle(BillingCycle.MONTHLY) + .withPlanId("liftrpantestplan")) + .withMarketplaceDetails(new MarketplaceDetails().withOfferId("liftr-pan-ame-test") + .withPublisherId("isvtestuklegacy") + .withMarketplaceSubscriptionStatus(MarketplaceSubscriptionStatus.PENDING_FULFILLMENT_START)) + .withTags(mapOf("tagName", "value")) + .withIdentity(new AzureResourceManagerManagedIdentityProperties().withType(ManagedIdentityType.NONE) + .withUserAssignedIdentities(mapOf("key16", + new AzureResourceManagerUserAssignedIdentity().withClientId("aaaa") + .withPrincipalId("aaaaaaaaaaaaaaa")))) + .withPanEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c12") + .withIsPanoramaManaged(BooleanEnum.TRUE) + .withPanoramaConfig(new PanoramaConfig().withConfigString("bas64EncodedString")) + .withAssociatedRulestack( + new RulestackDetails().withResourceId("lrs1").withRulestackId("PANRSID").withLocation("eastus")) + .withFrontEndSettings(Arrays.asList(new FrontendSetting().withName("frontendsetting11") + .withProtocol(ProtocolType.TCP) + .withFrontendConfiguration(new EndpointConfiguration().withPort("80") + .withAddress(new IpAddress().withResourceId( + "/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-frontendSettingIp1") + .withAddress("20.22.91.251"))) + .withBackendConfiguration(new EndpointConfiguration().withPort("80") + .withAddress(new IpAddress().withResourceId( + "/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-frontendSettingIp2") + .withAddress("20.22.32.136"))))) + .create(); + } + + /* + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * Firewalls_CreateOrUpdate_MinimumSet_Gen.json */ /** * Sample code: Firewalls_CreateOrUpdate_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallsCreateOrUpdateMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.firewalls().define("firewall1").withRegion("eastus").withExistingResourceGroup("firewall-rg").withNetworkProfile(new NetworkProfile().withNetworkType(NetworkType.VNET).withPublicIps(Arrays.asList(new IpAddress().withResourceId("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-PublicIp1").withAddress("20.22.92.11"))).withEnableEgressNat(EgressNat.ENABLED)).withDnsSettings(new DnsSettings()).withPlanData(new PlanData().withBillingCycle(BillingCycle.MONTHLY).withPlanId("liftrpantestplan")).withMarketplaceDetails(new MarketplaceDetails().withOfferId("liftr-pan-ame-test").withPublisherId("isvtestuklegacy")).create(); + public static void firewallsCreateOrUpdateMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.firewalls() + .define("firewall1") + .withRegion("eastus") + .withExistingResourceGroup("firewall-rg") + .withNetworkProfile(new NetworkProfile().withNetworkType(NetworkType.VNET) + .withPublicIps(Arrays.asList(new IpAddress().withResourceId( + "/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-PublicIp1") + .withAddress("20.22.92.11"))) + .withEnableEgressNat(EgressNat.ENABLED)) + .withDnsSettings(new DnsSettings()) + .withPlanData(new PlanData().withBillingCycle(BillingCycle.MONTHLY).withPlanId("liftrpantestplan")) + .withMarketplaceDetails( + new MarketplaceDetails().withOfferId("liftr-pan-ame-test").withPublisherId("isvtestuklegacy")) + .create(); } // Use "Map.of" if available @@ -549,26 +726,32 @@ public final class FirewallsCreateOrUpdateSamples { */ public final class FirewallsDeleteSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/Firewalls_Delete_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * Firewalls_Delete_MinimumSet_Gen.json */ /** * Sample code: Firewalls_Delete_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallsDeleteMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void firewallsDeleteMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.firewalls().delete("firewall-rg", "firewall1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/Firewalls_Delete_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * Firewalls_Delete_MaximumSet_Gen.json */ /** * Sample code: Firewalls_Delete_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallsDeleteMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void firewallsDeleteMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.firewalls().delete("firewall-rg", "firewall1", com.azure.core.util.Context.NONE); } } @@ -582,27 +765,35 @@ public final class FirewallsDeleteSamples { */ public final class FirewallsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/Firewalls_Get_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * Firewalls_Get_MaximumSet_Gen.json */ /** * Sample code: Firewalls_Get_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallsGetMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.firewalls().getByResourceGroupWithResponse("firewall-rg", "firewall1", com.azure.core.util.Context.NONE); + public static void + firewallsGetMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.firewalls() + .getByResourceGroupWithResponse("firewall-rg", "firewall1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/Firewalls_Get_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * Firewalls_Get_MinimumSet_Gen.json */ /** * Sample code: Firewalls_Get_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallsGetMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.firewalls().getByResourceGroupWithResponse("firewall-rg", "firewall1", com.azure.core.util.Context.NONE); + public static void + firewallsGetMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.firewalls() + .getByResourceGroupWithResponse("firewall-rg", "firewall1", com.azure.core.util.Context.NONE); } } ``` @@ -615,27 +806,35 @@ public final class FirewallsGetByResourceGroupSamples { */ public final class FirewallsGetGlobalRulestackSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/Firewalls_getGlobalRulestack_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * Firewalls_getGlobalRulestack_MaximumSet_Gen.json */ /** * Sample code: Firewalls_getGlobalRulestack_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallsGetGlobalRulestackMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.firewalls().getGlobalRulestackWithResponse("firewall-rg", "firewall1", com.azure.core.util.Context.NONE); + public static void firewallsGetGlobalRulestackMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.firewalls() + .getGlobalRulestackWithResponse("firewall-rg", "firewall1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/Firewalls_getGlobalRulestack_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * Firewalls_getGlobalRulestack_MinimumSet_Gen.json */ /** * Sample code: Firewalls_getGlobalRulestack_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallsGetGlobalRulestackMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.firewalls().getGlobalRulestackWithResponse("firewall-rg", "firewall1", com.azure.core.util.Context.NONE); + public static void firewallsGetGlobalRulestackMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.firewalls() + .getGlobalRulestackWithResponse("firewall-rg", "firewall1", com.azure.core.util.Context.NONE); } } ``` @@ -648,26 +847,32 @@ public final class FirewallsGetGlobalRulestackSamples { */ public final class FirewallsGetLogProfileSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/Firewalls_getLogProfile_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * Firewalls_getLogProfile_MinimumSet_Gen.json */ /** * Sample code: Firewalls_getLogProfile_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallsGetLogProfileMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void firewallsGetLogProfileMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.firewalls().getLogProfileWithResponse("firewall-rg", "firewall1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/Firewalls_getLogProfile_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * Firewalls_getLogProfile_MaximumSet_Gen.json */ /** * Sample code: Firewalls_getLogProfile_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallsGetLogProfileMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void firewallsGetLogProfileMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.firewalls().getLogProfileWithResponse("firewall-rg", "firewall1", com.azure.core.util.Context.NONE); } } @@ -681,27 +886,35 @@ public final class FirewallsGetLogProfileSamples { */ public final class FirewallsGetSupportInfoSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/Firewalls_getSupportInfo_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * Firewalls_getSupportInfo_MinimumSet_Gen.json */ /** * Sample code: Firewalls_getSupportInfo_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallsGetSupportInfoMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.firewalls().getSupportInfoWithResponse("rgopenapi", "firewall1", null, com.azure.core.util.Context.NONE); + public static void firewallsGetSupportInfoMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.firewalls() + .getSupportInfoWithResponse("rgopenapi", "firewall1", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/Firewalls_getSupportInfo_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * Firewalls_getSupportInfo_MaximumSet_Gen.json */ /** * Sample code: Firewalls_getSupportInfo_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallsGetSupportInfoMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.firewalls().getSupportInfoWithResponse("rgopenapi", "firewall1", "user1@domain.com", com.azure.core.util.Context.NONE); + public static void firewallsGetSupportInfoMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.firewalls() + .getSupportInfoWithResponse("rgopenapi", "firewall1", "user1@domain.com", com.azure.core.util.Context.NONE); } } ``` @@ -714,26 +927,32 @@ public final class FirewallsGetSupportInfoSamples { */ public final class FirewallsListSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/Firewalls_ListBySubscription_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * Firewalls_ListBySubscription_MinimumSet_Gen.json */ /** * Sample code: Firewalls_ListBySubscription_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallsListBySubscriptionMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void firewallsListBySubscriptionMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.firewalls().list(com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/Firewalls_ListBySubscription_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * Firewalls_ListBySubscription_MaximumSet_Gen.json */ /** * Sample code: Firewalls_ListBySubscription_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallsListBySubscriptionMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void firewallsListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.firewalls().list(com.azure.core.util.Context.NONE); } } @@ -747,26 +966,32 @@ public final class FirewallsListSamples { */ public final class FirewallsListByResourceGroupSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/Firewalls_ListByResourceGroup_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * Firewalls_ListByResourceGroup_MaximumSet_Gen.json */ /** * Sample code: Firewalls_ListByResourceGroup_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallsListByResourceGroupMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void firewallsListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.firewalls().listByResourceGroup("firewall-rg", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/Firewalls_ListByResourceGroup_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * Firewalls_ListByResourceGroup_MinimumSet_Gen.json */ /** * Sample code: Firewalls_ListByResourceGroup_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallsListByResourceGroupMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void firewallsListByResourceGroupMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.firewalls().listByResourceGroup("firewall-rg", com.azure.core.util.Context.NONE); } } @@ -783,34 +1008,102 @@ import com.azure.resourcemanager.paloaltonetworks.ngfw.models.LogOption; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.LogType; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.MonitorLog; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.StorageAccount; -import java.util.stream.Collectors; /** * Samples for Firewalls SaveLogProfile. */ public final class FirewallsSaveLogProfileSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/Firewalls_saveLogProfile_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * Firewalls_saveLogProfile_MaximumSet_Gen.json */ /** * Sample code: Firewalls_saveLogProfile_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallsSaveLogProfileMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.firewalls().saveLogProfileWithResponse("firewall-rg", "firewall1", new LogSettingsInner().withLogType(LogType.TRAFFIC).withLogOption(LogOption.SAME_DESTINATION).withApplicationInsights(new ApplicationInsights().withId("aaaaaaaaaaaaaaaa").withKey("fakeTokenPlaceholder")).withCommonDestination(new LogDestination().withStorageConfigurations(new StorageAccount().withId("aaaaaaaaaaaaaaa").withSubscriptionId("aaaaaaaaa").withAccountName("aaaaaaaaaaaaaaaaaaaaaaa")).withEventHubConfigurations(new EventHub().withId("aaaaaaaaaa").withSubscriptionId("aaaaaaaaaa").withName("aaaaaaaa").withNameSpace("aaaaaaaaaaaaaaaaaaaaa").withPolicyName("aaaaaaaaaaaa")).withMonitorConfigurations(new MonitorLog().withId("aaaaaaaaaaaaaaaaaaa").withSubscriptionId("aaaaaaaaaaaaa").withWorkspace("aaaaaaaaaaa").withPrimaryKey("fakeTokenPlaceholder").withSecondaryKey("fakeTokenPlaceholder"))).withTrafficLogDestination(new LogDestination().withStorageConfigurations(new StorageAccount().withId("aaaaaaaaaaaaaaa").withSubscriptionId("aaaaaaaaa").withAccountName("aaaaaaaaaaaaaaaaaaaaaaa")).withEventHubConfigurations(new EventHub().withId("aaaaaaaaaa").withSubscriptionId("aaaaaaaaaa").withName("aaaaaaaa").withNameSpace("aaaaaaaaaaaaaaaaaaaaa").withPolicyName("aaaaaaaaaaaa")).withMonitorConfigurations(new MonitorLog().withId("aaaaaaaaaaaaaaaaaaa").withSubscriptionId("aaaaaaaaaaaaa").withWorkspace("aaaaaaaaaaa").withPrimaryKey("fakeTokenPlaceholder").withSecondaryKey("fakeTokenPlaceholder"))).withThreatLogDestination(new LogDestination().withStorageConfigurations(new StorageAccount().withId("aaaaaaaaaaaaaaa").withSubscriptionId("aaaaaaaaa").withAccountName("aaaaaaaaaaaaaaaaaaaaaaa")).withEventHubConfigurations(new EventHub().withId("aaaaaaaaaa").withSubscriptionId("aaaaaaaaaa").withName("aaaaaaaa").withNameSpace("aaaaaaaaaaaaaaaaaaaaa").withPolicyName("aaaaaaaaaaaa")).withMonitorConfigurations(new MonitorLog().withId("aaaaaaaaaaaaaaaaaaa").withSubscriptionId("aaaaaaaaaaaaa").withWorkspace("aaaaaaaaaaa").withPrimaryKey("fakeTokenPlaceholder").withSecondaryKey("fakeTokenPlaceholder"))).withDecryptLogDestination(new LogDestination().withStorageConfigurations(new StorageAccount().withId("aaaaaaaaaaaaaaa").withSubscriptionId("aaaaaaaaa").withAccountName("aaaaaaaaaaaaaaaaaaaaaaa")).withEventHubConfigurations(new EventHub().withId("aaaaaaaaaa").withSubscriptionId("aaaaaaaaaa").withName("aaaaaaaa").withNameSpace("aaaaaaaaaaaaaaaaaaaaa").withPolicyName("aaaaaaaaaaaa")).withMonitorConfigurations(new MonitorLog().withId("aaaaaaaaaaaaaaaaaaa").withSubscriptionId("aaaaaaaaaaaaa").withWorkspace("aaaaaaaaaaa").withPrimaryKey("fakeTokenPlaceholder").withSecondaryKey("fakeTokenPlaceholder"))), com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/Firewalls_saveLogProfile_MinimumSet_Gen.json + public static void firewallsSaveLogProfileMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.firewalls() + .saveLogProfileWithResponse("firewall-rg", "firewall1", + new LogSettingsInner().withLogType(LogType.TRAFFIC) + .withLogOption(LogOption.SAME_DESTINATION) + .withApplicationInsights( + new ApplicationInsights().withId("aaaaaaaaaaaaaaaa").withKey("fakeTokenPlaceholder")) + .withCommonDestination(new LogDestination() + .withStorageConfigurations(new StorageAccount().withId("aaaaaaaaaaaaaaa") + .withSubscriptionId("aaaaaaaaa") + .withAccountName("aaaaaaaaaaaaaaaaaaaaaaa")) + .withEventHubConfigurations(new EventHub().withId("aaaaaaaaaa") + .withSubscriptionId("aaaaaaaaaa") + .withName("aaaaaaaa") + .withNameSpace("aaaaaaaaaaaaaaaaaaaaa") + .withPolicyName("aaaaaaaaaaaa")) + .withMonitorConfigurations(new MonitorLog().withId("aaaaaaaaaaaaaaaaaaa") + .withSubscriptionId("aaaaaaaaaaaaa") + .withWorkspace("aaaaaaaaaaa") + .withPrimaryKey("fakeTokenPlaceholder") + .withSecondaryKey("fakeTokenPlaceholder"))) + .withTrafficLogDestination(new LogDestination() + .withStorageConfigurations(new StorageAccount().withId("aaaaaaaaaaaaaaa") + .withSubscriptionId("aaaaaaaaa") + .withAccountName("aaaaaaaaaaaaaaaaaaaaaaa")) + .withEventHubConfigurations(new EventHub().withId("aaaaaaaaaa") + .withSubscriptionId("aaaaaaaaaa") + .withName("aaaaaaaa") + .withNameSpace("aaaaaaaaaaaaaaaaaaaaa") + .withPolicyName("aaaaaaaaaaaa")) + .withMonitorConfigurations(new MonitorLog().withId("aaaaaaaaaaaaaaaaaaa") + .withSubscriptionId("aaaaaaaaaaaaa") + .withWorkspace("aaaaaaaaaaa") + .withPrimaryKey("fakeTokenPlaceholder") + .withSecondaryKey("fakeTokenPlaceholder"))) + .withThreatLogDestination(new LogDestination() + .withStorageConfigurations(new StorageAccount().withId("aaaaaaaaaaaaaaa") + .withSubscriptionId("aaaaaaaaa") + .withAccountName("aaaaaaaaaaaaaaaaaaaaaaa")) + .withEventHubConfigurations(new EventHub().withId("aaaaaaaaaa") + .withSubscriptionId("aaaaaaaaaa") + .withName("aaaaaaaa") + .withNameSpace("aaaaaaaaaaaaaaaaaaaaa") + .withPolicyName("aaaaaaaaaaaa")) + .withMonitorConfigurations(new MonitorLog().withId("aaaaaaaaaaaaaaaaaaa") + .withSubscriptionId("aaaaaaaaaaaaa") + .withWorkspace("aaaaaaaaaaa") + .withPrimaryKey("fakeTokenPlaceholder") + .withSecondaryKey("fakeTokenPlaceholder"))) + .withDecryptLogDestination(new LogDestination() + .withStorageConfigurations(new StorageAccount().withId("aaaaaaaaaaaaaaa") + .withSubscriptionId("aaaaaaaaa") + .withAccountName("aaaaaaaaaaaaaaaaaaaaaaa")) + .withEventHubConfigurations(new EventHub().withId("aaaaaaaaaa") + .withSubscriptionId("aaaaaaaaaa") + .withName("aaaaaaaa") + .withNameSpace("aaaaaaaaaaaaaaaaaaaaa") + .withPolicyName("aaaaaaaaaaaa")) + .withMonitorConfigurations(new MonitorLog().withId("aaaaaaaaaaaaaaaaaaa") + .withSubscriptionId("aaaaaaaaaaaaa") + .withWorkspace("aaaaaaaaaaa") + .withPrimaryKey("fakeTokenPlaceholder") + .withSecondaryKey("fakeTokenPlaceholder"))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * Firewalls_saveLogProfile_MinimumSet_Gen.json */ /** * Sample code: Firewalls_saveLogProfile_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallsSaveLogProfileMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.firewalls().saveLogProfileWithResponse("firewall-rg", "firewall1", null, com.azure.core.util.Context.NONE); + public static void firewallsSaveLogProfileMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.firewalls() + .saveLogProfileWithResponse("firewall-rg", "firewall1", null, com.azure.core.util.Context.NONE); } } ``` @@ -847,36 +1140,114 @@ import com.azure.resourcemanager.paloaltonetworks.ngfw.models.VwanConfiguration; import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import java.util.stream.Collectors; /** * Samples for Firewalls Update. */ public final class FirewallsUpdateSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/Firewalls_Update_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * Firewalls_Update_MinimumSet_Gen.json */ /** * Sample code: Firewalls_Update_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallsUpdateMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - FirewallResource resource = manager.firewalls().getByResourceGroupWithResponse("firewall-rg", "firewall1", com.azure.core.util.Context.NONE).getValue(); + public static void firewallsUpdateMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + FirewallResource resource = manager.firewalls() + .getByResourceGroupWithResponse("firewall-rg", "firewall1", com.azure.core.util.Context.NONE) + .getValue(); resource.update().apply(); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/Firewalls_Update_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * Firewalls_Update_MaximumSet_Gen.json */ /** * Sample code: Firewalls_Update_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void firewallsUpdateMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - FirewallResource resource = manager.firewalls().getByResourceGroupWithResponse("firewall-rg", "firewall1", com.azure.core.util.Context.NONE).getValue(); - resource.update().withTags(mapOf("tagName", "value")).withIdentity(new AzureResourceManagerManagedIdentityProperties().withType(ManagedIdentityType.NONE).withUserAssignedIdentities(mapOf("key16", new AzureResourceManagerUserAssignedIdentity().withClientId("aaaa").withPrincipalId("aaaaaaaaaaaaaaa")))).withProperties(new FirewallResourceUpdateProperties().withPanEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c12").withNetworkProfile(new NetworkProfile().withVnetConfiguration(new VnetConfiguration().withVnet(new IpAddressSpace().withResourceId("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet").withAddressSpace("10.1.0.0/16")).withTrustSubnet(new IpAddressSpace().withResourceId("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-trust-subnet").withAddressSpace("10.1.1.0/24")).withUnTrustSubnet(new IpAddressSpace().withResourceId("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet").withAddressSpace("10.1.1.0/24")).withIpOfTrustSubnetForUdr(new IpAddress().withResourceId("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet").withAddress("10.1.1.0/24"))).withVwanConfiguration(new VwanConfiguration().withNetworkVirtualApplianceId("2bf4a339-294d-4c25-b0b2-ef649e9f5c12").withVHub(new IpAddressSpace().withResourceId("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet").withAddressSpace("10.1.1.0/24")).withTrustSubnet(new IpAddressSpace().withResourceId("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-trust-subnet").withAddressSpace("10.1.1.0/24")).withUnTrustSubnet(new IpAddressSpace().withResourceId("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet").withAddressSpace("10.1.1.0/24")).withIpOfTrustSubnetForUdr(new IpAddress().withResourceId("/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet").withAddress("10.1.1.0/24"))).withNetworkType(NetworkType.VNET).withPublicIps(Arrays.asList(new IpAddress().withResourceId("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-PublicIp1").withAddress("20.22.92.11"))).withEnableEgressNat(EgressNat.ENABLED).withEgressNatIp(Arrays.asList(new IpAddress().withResourceId("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-egressNatIp1").withAddress("20.22.92.111"))).withTrustedRanges(Arrays.asList("20.22.92.11"))).withIsPanoramaManaged(BooleanEnum.TRUE).withPanoramaConfig(new PanoramaConfig().withConfigString("bas64EncodedString")).withAssociatedRulestack(new RulestackDetails().withResourceId("aaaaaaaaaa").withRulestackId("aaaaaaaaaaaaaaaa").withLocation("eastus")).withDnsSettings(new DnsSettings().withEnableDnsProxy(DnsProxy.DISABLED).withEnabledDnsType(EnabledDnsType.CUSTOM).withDnsServers(Arrays.asList(new IpAddress().withResourceId("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-egressNatIp1").withAddress("20.22.92.111")))).withFrontEndSettings(Arrays.asList(new FrontendSetting().withName("frontendsetting11").withProtocol(ProtocolType.TCP).withFrontendConfiguration(new EndpointConfiguration().withPort("80").withAddress(new IpAddress().withResourceId("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-frontendSettingIp1").withAddress("20.22.91.251"))).withBackendConfiguration(new EndpointConfiguration().withPort("80").withAddress(new IpAddress().withResourceId("/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-frontendSettingIp2").withAddress("20.22.32.136"))))).withPlanData(new PlanData().withUsageType(UsageType.PAYG).withBillingCycle(BillingCycle.WEEKLY).withPlanId("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")).withMarketplaceDetails(new MarketplaceDetails().withOfferId("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa").withPublisherId("aaaa").withMarketplaceSubscriptionStatus(MarketplaceSubscriptionStatus.PENDING_FULFILLMENT_START))).apply(); + public static void firewallsUpdateMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + FirewallResource resource = manager.firewalls() + .getByResourceGroupWithResponse("firewall-rg", "firewall1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("tagName", "value")) + .withIdentity(new AzureResourceManagerManagedIdentityProperties().withType(ManagedIdentityType.NONE) + .withUserAssignedIdentities(mapOf("key16", + new AzureResourceManagerUserAssignedIdentity().withClientId("aaaa") + .withPrincipalId("aaaaaaaaaaaaaaa")))) + .withProperties(new FirewallResourceUpdateProperties().withPanEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c12") + .withNetworkProfile(new NetworkProfile().withVnetConfiguration(new VnetConfiguration() + .withVnet(new IpAddressSpace().withResourceId( + "/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet") + .withAddressSpace("10.1.0.0/16")) + .withTrustSubnet(new IpAddressSpace().withResourceId( + "/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-trust-subnet") + .withAddressSpace("10.1.1.0/24")) + .withUnTrustSubnet(new IpAddressSpace().withResourceId( + "/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet") + .withAddressSpace("10.1.1.0/24")) + .withIpOfTrustSubnetForUdr(new IpAddress().withResourceId( + "/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet") + .withAddress("10.1.1.0/24"))) + .withVwanConfiguration(new VwanConfiguration() + .withNetworkVirtualApplianceId("2bf4a339-294d-4c25-b0b2-ef649e9f5c12") + .withVHub(new IpAddressSpace().withResourceId( + "/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet") + .withAddressSpace("10.1.1.0/24")) + .withTrustSubnet(new IpAddressSpace().withResourceId( + "/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-trust-subnet") + .withAddressSpace("10.1.1.0/24")) + .withUnTrustSubnet(new IpAddressSpace().withResourceId( + "/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet") + .withAddressSpace("10.1.1.0/24")) + .withIpOfTrustSubnetForUdr(new IpAddress().withResourceId( + "/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet/subnets/os-liftr-integration-untrust-subnet") + .withAddress("10.1.1.0/24"))) + .withNetworkType(NetworkType.VNET) + .withPublicIps(Arrays.asList(new IpAddress().withResourceId( + "/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-PublicIp1") + .withAddress("20.22.92.11"))) + .withEnableEgressNat(EgressNat.ENABLED) + .withEgressNatIp(Arrays.asList(new IpAddress().withResourceId( + "/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-egressNatIp1") + .withAddress("20.22.92.111"))) + .withTrustedRanges(Arrays.asList("20.22.92.11"))) + .withIsPanoramaManaged(BooleanEnum.TRUE) + .withPanoramaConfig(new PanoramaConfig().withConfigString("bas64EncodedString")) + .withAssociatedRulestack(new RulestackDetails().withResourceId("aaaaaaaaaa") + .withRulestackId("aaaaaaaaaaaaaaaa") + .withLocation("eastus")) + .withDnsSettings(new DnsSettings().withEnableDnsProxy(DnsProxy.DISABLED) + .withEnabledDnsType(EnabledDnsType.CUSTOM) + .withDnsServers(Arrays.asList(new IpAddress().withResourceId( + "/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-egressNatIp1") + .withAddress("20.22.92.111")))) + .withFrontEndSettings(Arrays.asList(new FrontendSetting().withName("frontendsetting11") + .withProtocol(ProtocolType.TCP) + .withFrontendConfiguration(new EndpointConfiguration().withPort("80") + .withAddress(new IpAddress().withResourceId( + "/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-frontendSettingIp1") + .withAddress("20.22.91.251"))) + .withBackendConfiguration(new EndpointConfiguration().withPort("80") + .withAddress(new IpAddress().withResourceId( + "/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-frontendSettingIp2") + .withAddress("20.22.32.136"))))) + .withPlanData(new PlanData().withUsageType(UsageType.PAYG) + .withBillingCycle(BillingCycle.WEEKLY) + .withPlanId("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) + .withMarketplaceDetails(new MarketplaceDetails().withOfferId("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + .withPublisherId("aaaa") + .withMarketplaceSubscriptionStatus(MarketplaceSubscriptionStatus.PENDING_FULFILLMENT_START))) + .apply(); } // Use "Map.of" if available @@ -904,27 +1275,42 @@ import java.util.Arrays; */ public final class FqdnListGlobalRulestackCreateOrUpdateSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/FqdnListGlobalRulestack_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * FqdnListGlobalRulestack_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: FqdnListGlobalRulestack_CreateOrUpdate_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void fqdnListGlobalRulestackCreateOrUpdateMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.fqdnListGlobalRulestacks().createOrUpdate("praval", "armid1", new FqdnListGlobalRulestackResourceInner().withDescription("string").withFqdnList(Arrays.asList("string1", "string2")).withEtag("aaaaaaaaaaaaaaaaaa").withAuditComment("string"), com.azure.core.util.Context.NONE); + public static void fqdnListGlobalRulestackCreateOrUpdateMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.fqdnListGlobalRulestacks() + .createOrUpdate("praval", "armid1", + new FqdnListGlobalRulestackResourceInner().withDescription("string") + .withFqdnList(Arrays.asList("string1", "string2")) + .withEtag("aaaaaaaaaaaaaaaaaa") + .withAuditComment("string"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/FqdnListGlobalRulestack_CreateOrUpdate_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * FqdnListGlobalRulestack_CreateOrUpdate_MinimumSet_Gen.json */ /** * Sample code: FqdnListGlobalRulestack_CreateOrUpdate_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void fqdnListGlobalRulestackCreateOrUpdateMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.fqdnListGlobalRulestacks().createOrUpdate("praval", "armid1", new FqdnListGlobalRulestackResourceInner().withFqdnList(Arrays.asList("string1", "string2")), com.azure.core.util.Context.NONE); + public static void fqdnListGlobalRulestackCreateOrUpdateMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.fqdnListGlobalRulestacks() + .createOrUpdate("praval", "armid1", + new FqdnListGlobalRulestackResourceInner().withFqdnList(Arrays.asList("string1", "string2")), + com.azure.core.util.Context.NONE); } } ``` @@ -937,26 +1323,32 @@ public final class FqdnListGlobalRulestackCreateOrUpdateSamples { */ public final class FqdnListGlobalRulestackDeleteSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/FqdnListGlobalRulestack_Delete_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * FqdnListGlobalRulestack_Delete_MaximumSet_Gen.json */ /** * Sample code: FqdnListGlobalRulestack_Delete_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void fqdnListGlobalRulestackDeleteMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void fqdnListGlobalRulestackDeleteMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.fqdnListGlobalRulestacks().delete("praval", "armid1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/FqdnListGlobalRulestack_Delete_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * FqdnListGlobalRulestack_Delete_MinimumSet_Gen.json */ /** * Sample code: FqdnListGlobalRulestack_Delete_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void fqdnListGlobalRulestackDeleteMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void fqdnListGlobalRulestackDeleteMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.fqdnListGlobalRulestacks().delete("praval", "armid1", com.azure.core.util.Context.NONE); } } @@ -970,26 +1362,32 @@ public final class FqdnListGlobalRulestackDeleteSamples { */ public final class FqdnListGlobalRulestackGetSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/FqdnListGlobalRulestack_Get_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * FqdnListGlobalRulestack_Get_MaximumSet_Gen.json */ /** * Sample code: FqdnListGlobalRulestack_Get_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void fqdnListGlobalRulestackGetMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void fqdnListGlobalRulestackGetMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.fqdnListGlobalRulestacks().getWithResponse("praval", "armid1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/FqdnListGlobalRulestack_Get_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * FqdnListGlobalRulestack_Get_MinimumSet_Gen.json */ /** * Sample code: FqdnListGlobalRulestack_Get_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void fqdnListGlobalRulestackGetMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void fqdnListGlobalRulestackGetMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.fqdnListGlobalRulestacks().getWithResponse("praval", "armid1", com.azure.core.util.Context.NONE); } } @@ -1003,26 +1401,32 @@ public final class FqdnListGlobalRulestackGetSamples { */ public final class FqdnListGlobalRulestackListSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/FqdnListGlobalRulestack_List_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * FqdnListGlobalRulestack_List_MinimumSet_Gen.json */ /** * Sample code: FqdnListGlobalRulestack_List_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void fqdnListGlobalRulestackListMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void fqdnListGlobalRulestackListMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.fqdnListGlobalRulestacks().list("praval", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/FqdnListGlobalRulestack_List_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * FqdnListGlobalRulestack_List_MaximumSet_Gen.json */ /** * Sample code: FqdnListGlobalRulestack_List_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void fqdnListGlobalRulestackListMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void fqdnListGlobalRulestackListMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.fqdnListGlobalRulestacks().list("praval", com.azure.core.util.Context.NONE); } } @@ -1038,27 +1442,44 @@ import java.util.Arrays; */ public final class FqdnListLocalRulestackCreateOrUpdateSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/FqdnListLocalRulestack_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * FqdnListLocalRulestack_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: FqdnListLocalRulestack_CreateOrUpdate_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void fqdnListLocalRulestackCreateOrUpdateMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.fqdnListLocalRulestacks().define("armid1").withExistingLocalRulestack("rgopenapi", "lrs1").withFqdnList(Arrays.asList("string1", "string2")).withDescription("string").withEtag("aaaaaaaaaaaaaaaaaa").withAuditComment("string").create(); + public static void fqdnListLocalRulestackCreateOrUpdateMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.fqdnListLocalRulestacks() + .define("armid1") + .withExistingLocalRulestack("rgopenapi", "lrs1") + .withFqdnList(Arrays.asList("string1", "string2")) + .withDescription("string") + .withEtag("aaaaaaaaaaaaaaaaaa") + .withAuditComment("string") + .create(); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/FqdnListLocalRulestack_CreateOrUpdate_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * FqdnListLocalRulestack_CreateOrUpdate_MinimumSet_Gen.json */ /** * Sample code: FqdnListLocalRulestack_CreateOrUpdate_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void fqdnListLocalRulestackCreateOrUpdateMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.fqdnListLocalRulestacks().define("armid1").withExistingLocalRulestack("rgopenapi", "lrs1").withFqdnList(Arrays.asList("string1", "string2")).create(); + public static void fqdnListLocalRulestackCreateOrUpdateMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.fqdnListLocalRulestacks() + .define("armid1") + .withExistingLocalRulestack("rgopenapi", "lrs1") + .withFqdnList(Arrays.asList("string1", "string2")) + .create(); } } ``` @@ -1071,26 +1492,32 @@ public final class FqdnListLocalRulestackCreateOrUpdateSamples { */ public final class FqdnListLocalRulestackDeleteSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/FqdnListLocalRulestack_Delete_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * FqdnListLocalRulestack_Delete_MinimumSet_Gen.json */ /** * Sample code: FqdnListLocalRulestack_Delete_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void fqdnListLocalRulestackDeleteMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void fqdnListLocalRulestackDeleteMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.fqdnListLocalRulestacks().delete("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/FqdnListLocalRulestack_Delete_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * FqdnListLocalRulestack_Delete_MaximumSet_Gen.json */ /** * Sample code: FqdnListLocalRulestack_Delete_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void fqdnListLocalRulestackDeleteMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void fqdnListLocalRulestackDeleteMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.fqdnListLocalRulestacks().delete("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); } } @@ -1104,27 +1531,35 @@ public final class FqdnListLocalRulestackDeleteSamples { */ public final class FqdnListLocalRulestackGetSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/FqdnListLocalRulestack_Get_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * FqdnListLocalRulestack_Get_MinimumSet_Gen.json */ /** * Sample code: FqdnListLocalRulestack_Get_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void fqdnListLocalRulestackGetMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.fqdnListLocalRulestacks().getWithResponse("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); + public static void fqdnListLocalRulestackGetMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.fqdnListLocalRulestacks() + .getWithResponse("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/FqdnListLocalRulestack_Get_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * FqdnListLocalRulestack_Get_MaximumSet_Gen.json */ /** * Sample code: FqdnListLocalRulestack_Get_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void fqdnListLocalRulestackGetMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.fqdnListLocalRulestacks().getWithResponse("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); + public static void fqdnListLocalRulestackGetMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.fqdnListLocalRulestacks() + .getWithResponse("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); } } ``` @@ -1137,26 +1572,32 @@ public final class FqdnListLocalRulestackGetSamples { */ public final class FqdnListLocalRulestackListByLocalRulestacksSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/FqdnListLocalRulestack_ListByLocalRulestacks_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * FqdnListLocalRulestack_ListByLocalRulestacks_MinimumSet_Gen.json */ /** * Sample code: FqdnListLocalRulestack_ListByLocalRulestacks_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void fqdnListLocalRulestackListByLocalRulestacksMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void fqdnListLocalRulestackListByLocalRulestacksMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.fqdnListLocalRulestacks().listByLocalRulestacks("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/FqdnListLocalRulestack_ListByLocalRulestacks_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * FqdnListLocalRulestack_ListByLocalRulestacks_MaximumSet_Gen.json */ /** * Sample code: FqdnListLocalRulestack_ListByLocalRulestacks_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void fqdnListLocalRulestackListByLocalRulestacksMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void fqdnListLocalRulestackListByLocalRulestacksMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.fqdnListLocalRulestacks().listByLocalRulestacks("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); } } @@ -1170,26 +1611,32 @@ public final class FqdnListLocalRulestackListByLocalRulestacksSamples { */ public final class GlobalRulestackCommitSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_commit_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_commit_MaximumSet_Gen.json */ /** * Sample code: GlobalRulestack_commit_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackCommitMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void globalRulestackCommitMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.globalRulestacks().commit("praval", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_commit_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_commit_MinimumSet_Gen.json */ /** * Sample code: GlobalRulestack_commit_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackCommitMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void globalRulestackCommitMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.globalRulestacks().commit("praval", com.azure.core.util.Context.NONE); } } @@ -1208,34 +1655,63 @@ import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SecurityServices; import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import java.util.stream.Collectors; /** * Samples for GlobalRulestack CreateOrUpdate. */ public final class GlobalRulestackCreateOrUpdateSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_CreateOrUpdate_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_CreateOrUpdate_MinimumSet_Gen.json */ /** * Sample code: GlobalRulestack_CreateOrUpdate_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackCreateOrUpdateMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().createOrUpdate("praval", new GlobalRulestackResourceInner().withLocation("eastus"), com.azure.core.util.Context.NONE); + public static void globalRulestackCreateOrUpdateMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.globalRulestacks() + .createOrUpdate("praval", new GlobalRulestackResourceInner().withLocation("eastus"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: GlobalRulestack_CreateOrUpdate_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackCreateOrUpdateMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().createOrUpdate("praval", new GlobalRulestackResourceInner().withLocation("eastus").withIdentity(new AzureResourceManagerManagedIdentityProperties().withType(ManagedIdentityType.NONE).withUserAssignedIdentities(mapOf("key16", new AzureResourceManagerUserAssignedIdentity().withClientId("aaaa").withPrincipalId("aaaaaaaaaaaaaaa")))).withPanEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c12").withPanLocation("eastus").withScope(ScopeType.GLOBAL).withAssociatedSubscriptions(Arrays.asList("2bf4a339-294d-4c25-b0b2-ef649e9f5c27")).withDescription("global rulestacks").withDefaultMode(DefaultMode.IPS).withMinAppIdVersion("8.5.3").withSecurityServices(new SecurityServices().withVulnerabilityProfile("default").withAntiSpywareProfile("default").withAntiVirusProfile("default").withUrlFilteringProfile("default").withFileBlockingProfile("default").withDnsSubscription("default").withOutboundUnTrustCertificate("default").withOutboundTrustCertificate("default")), com.azure.core.util.Context.NONE); + public static void globalRulestackCreateOrUpdateMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.globalRulestacks() + .createOrUpdate("praval", + new GlobalRulestackResourceInner().withLocation("eastus") + .withIdentity(new AzureResourceManagerManagedIdentityProperties().withType(ManagedIdentityType.NONE) + .withUserAssignedIdentities(mapOf("key16", + new AzureResourceManagerUserAssignedIdentity().withClientId("aaaa") + .withPrincipalId("aaaaaaaaaaaaaaa")))) + .withPanEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c12") + .withPanLocation("eastus") + .withScope(ScopeType.GLOBAL) + .withAssociatedSubscriptions(Arrays.asList("2bf4a339-294d-4c25-b0b2-ef649e9f5c27")) + .withDescription("global rulestacks") + .withDefaultMode(DefaultMode.IPS) + .withMinAppIdVersion("8.5.3") + .withSecurityServices(new SecurityServices().withVulnerabilityProfile("default") + .withAntiSpywareProfile("default") + .withAntiVirusProfile("default") + .withUrlFilteringProfile("default") + .withFileBlockingProfile("default") + .withDnsSubscription("default") + .withOutboundUnTrustCertificate("default") + .withOutboundTrustCertificate("default")), + com.azure.core.util.Context.NONE); } // Use "Map.of" if available @@ -1260,26 +1736,32 @@ public final class GlobalRulestackCreateOrUpdateSamples { */ public final class GlobalRulestackDeleteSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_Delete_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_Delete_MaximumSet_Gen.json */ /** * Sample code: GlobalRulestack_Delete_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackDeleteMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void globalRulestackDeleteMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.globalRulestacks().delete("praval", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_Delete_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_Delete_MinimumSet_Gen.json */ /** * Sample code: GlobalRulestack_Delete_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackDeleteMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void globalRulestackDeleteMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.globalRulestacks().delete("praval", com.azure.core.util.Context.NONE); } } @@ -1293,26 +1775,32 @@ public final class GlobalRulestackDeleteSamples { */ public final class GlobalRulestackGetSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_Get_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_Get_MinimumSet_Gen.json */ /** * Sample code: GlobalRulestack_Get_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackGetMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void globalRulestackGetMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.globalRulestacks().getWithResponse("praval", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_Get_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_Get_MaximumSet_Gen.json */ /** * Sample code: GlobalRulestack_Get_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackGetMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void globalRulestackGetMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.globalRulestacks().getWithResponse("praval", com.azure.core.util.Context.NONE); } } @@ -1326,26 +1814,32 @@ public final class GlobalRulestackGetSamples { */ public final class GlobalRulestackGetChangeLogSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_getChangeLog_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_getChangeLog_MinimumSet_Gen.json */ /** * Sample code: GlobalRulestack_getChangeLog_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackGetChangeLogMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void globalRulestackGetChangeLogMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.globalRulestacks().getChangeLogWithResponse("praval", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_getChangeLog_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_getChangeLog_MaximumSet_Gen.json */ /** * Sample code: GlobalRulestack_getChangeLog_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackGetChangeLogMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void globalRulestackGetChangeLogMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.globalRulestacks().getChangeLogWithResponse("praval", com.azure.core.util.Context.NONE); } } @@ -1359,26 +1853,32 @@ public final class GlobalRulestackGetChangeLogSamples { */ public final class GlobalRulestackListSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_List_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_List_MinimumSet_Gen.json */ /** * Sample code: GlobalRulestack_List_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackListMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void globalRulestackListMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.globalRulestacks().list(com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_List_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_List_MaximumSet_Gen.json */ /** * Sample code: GlobalRulestack_List_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackListMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void globalRulestackListMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.globalRulestacks().list(com.azure.core.util.Context.NONE); } } @@ -1388,34 +1888,43 @@ public final class GlobalRulestackListSamples { ```java import com.azure.resourcemanager.paloaltonetworks.ngfw.models.AdvSecurityObjectTypeEnum; -import java.util.stream.Collectors; /** * Samples for GlobalRulestack ListAdvancedSecurityObjects. */ public final class GlobalRulestackListAdvancedSecurityObjectsSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_listAdvancedSecurityObjects_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_listAdvancedSecurityObjects_MaximumSet_Gen.json */ /** * Sample code: GlobalRulestack_listAdvancedSecurityObjects_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackListAdvancedSecurityObjectsMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().listAdvancedSecurityObjectsWithResponse("praval", AdvSecurityObjectTypeEnum.fromString("globalRulestacks"), "a6a321", 20, com.azure.core.util.Context.NONE); + public static void globalRulestackListAdvancedSecurityObjectsMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.globalRulestacks() + .listAdvancedSecurityObjectsWithResponse("praval", AdvSecurityObjectTypeEnum.fromString("globalRulestacks"), + "a6a321", 20, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_listAdvancedSecurityObjects_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_listAdvancedSecurityObjects_MinimumSet_Gen.json */ /** * Sample code: GlobalRulestack_listAdvancedSecurityObjects_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackListAdvancedSecurityObjectsMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().listAdvancedSecurityObjectsWithResponse("praval", AdvSecurityObjectTypeEnum.fromString("globalRulestacks"), null, null, com.azure.core.util.Context.NONE); + public static void globalRulestackListAdvancedSecurityObjectsMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.globalRulestacks() + .listAdvancedSecurityObjectsWithResponse("praval", AdvSecurityObjectTypeEnum.fromString("globalRulestacks"), + null, null, com.azure.core.util.Context.NONE); } } ``` @@ -1428,27 +1937,35 @@ public final class GlobalRulestackListAdvancedSecurityObjectsSamples { */ public final class GlobalRulestackListAppIdsSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_listAppIds_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_listAppIds_MaximumSet_Gen.json */ /** * Sample code: GlobalRulestack_listAppIds_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackListAppIdsMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().listAppIdsWithResponse("praval", "8543", "pref", "a6a321", 20, com.azure.core.util.Context.NONE); + public static void globalRulestackListAppIdsMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.globalRulestacks() + .listAppIdsWithResponse("praval", "8543", "pref", "a6a321", 20, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_listAppIds_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_listAppIds_MinimumSet_Gen.json */ /** * Sample code: GlobalRulestack_listAppIds_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackListAppIdsMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().listAppIdsWithResponse("praval", null, null, null, null, com.azure.core.util.Context.NONE); + public static void globalRulestackListAppIdsMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.globalRulestacks() + .listAppIdsWithResponse("praval", null, null, null, null, com.azure.core.util.Context.NONE); } } ``` @@ -1461,26 +1978,32 @@ public final class GlobalRulestackListAppIdsSamples { */ public final class GlobalRulestackListCountriesSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_listCountries_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_listCountries_MinimumSet_Gen.json */ /** * Sample code: GlobalRulestack_listCountries_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackListCountriesMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void globalRulestackListCountriesMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.globalRulestacks().listCountriesWithResponse("praval", null, null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_listCountries_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_listCountries_MaximumSet_Gen.json */ /** * Sample code: GlobalRulestack_listCountries_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackListCountriesMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void globalRulestackListCountriesMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.globalRulestacks().listCountriesWithResponse("praval", "a6a321", 20, com.azure.core.util.Context.NONE); } } @@ -1494,26 +2017,32 @@ public final class GlobalRulestackListCountriesSamples { */ public final class GlobalRulestackListFirewallsSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_listFirewalls_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_listFirewalls_MaximumSet_Gen.json */ /** * Sample code: GlobalRulestack_listFirewalls_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackListFirewallsMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void globalRulestackListFirewallsMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.globalRulestacks().listFirewallsWithResponse("praval", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_listFirewalls_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_listFirewalls_MinimumSet_Gen.json */ /** * Sample code: GlobalRulestack_listFirewalls_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackListFirewallsMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void globalRulestackListFirewallsMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.globalRulestacks().listFirewallsWithResponse("praval", com.azure.core.util.Context.NONE); } } @@ -1527,27 +2056,35 @@ public final class GlobalRulestackListFirewallsSamples { */ public final class GlobalRulestackListPredefinedUrlCategoriesSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_listPredefinedUrlCategories_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_listPredefinedUrlCategories_MaximumSet_Gen.json */ /** * Sample code: GlobalRulestack_listPredefinedUrlCategories_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackListPredefinedUrlCategoriesMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().listPredefinedUrlCategoriesWithResponse("praval", "a6a321", 20, com.azure.core.util.Context.NONE); + public static void globalRulestackListPredefinedUrlCategoriesMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.globalRulestacks() + .listPredefinedUrlCategoriesWithResponse("praval", "a6a321", 20, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_listPredefinedUrlCategories_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_listPredefinedUrlCategories_MinimumSet_Gen.json */ /** * Sample code: GlobalRulestack_listPredefinedUrlCategories_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackListPredefinedUrlCategoriesMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().listPredefinedUrlCategoriesWithResponse("praval", null, null, com.azure.core.util.Context.NONE); + public static void globalRulestackListPredefinedUrlCategoriesMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.globalRulestacks() + .listPredefinedUrlCategoriesWithResponse("praval", null, null, com.azure.core.util.Context.NONE); } } ``` @@ -1556,34 +2093,43 @@ public final class GlobalRulestackListPredefinedUrlCategoriesSamples { ```java import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SecurityServicesTypeEnum; -import java.util.stream.Collectors; /** * Samples for GlobalRulestack ListSecurityServices. */ public final class GlobalRulestackListSecurityServicesSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_listSecurityServices_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_listSecurityServices_MinimumSet_Gen.json */ /** * Sample code: GlobalRulestack_listSecurityServices_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackListSecurityServicesMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().listSecurityServicesWithResponse("praval", SecurityServicesTypeEnum.fromString("globalRulestacks"), null, null, com.azure.core.util.Context.NONE); + public static void globalRulestackListSecurityServicesMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.globalRulestacks() + .listSecurityServicesWithResponse("praval", SecurityServicesTypeEnum.fromString("globalRulestacks"), null, + null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_listSecurityServices_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_listSecurityServices_MaximumSet_Gen.json */ /** * Sample code: GlobalRulestack_listSecurityServices_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackListSecurityServicesMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().listSecurityServicesWithResponse("praval", SecurityServicesTypeEnum.fromString("globalRulestacks"), "a6a321", 20, com.azure.core.util.Context.NONE); + public static void globalRulestackListSecurityServicesMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.globalRulestacks() + .listSecurityServicesWithResponse("praval", SecurityServicesTypeEnum.fromString("globalRulestacks"), + "a6a321", 20, com.azure.core.util.Context.NONE); } } ``` @@ -1596,26 +2142,32 @@ public final class GlobalRulestackListSecurityServicesSamples { */ public final class GlobalRulestackRevertSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_revert_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_revert_MinimumSet_Gen.json */ /** * Sample code: GlobalRulestack_revert_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackRevertMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void globalRulestackRevertMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.globalRulestacks().revertWithResponse("praval", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_revert_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_revert_MaximumSet_Gen.json */ /** * Sample code: GlobalRulestack_revert_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackRevertMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void globalRulestackRevertMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.globalRulestacks().revertWithResponse("praval", com.azure.core.util.Context.NONE); } } @@ -1635,34 +2187,62 @@ import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SecurityServices; import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import java.util.stream.Collectors; /** * Samples for GlobalRulestack Update. */ public final class GlobalRulestackUpdateSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_Update_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_Update_MaximumSet_Gen.json */ /** * Sample code: GlobalRulestack_Update_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackUpdateMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().updateWithResponse("praval", new GlobalRulestackResourceUpdate().withLocation("eastus").withIdentity(new AzureResourceManagerManagedIdentityProperties().withType(ManagedIdentityType.NONE).withUserAssignedIdentities(mapOf("key16", new AzureResourceManagerUserAssignedIdentity().withClientId("aaaa").withPrincipalId("aaaaaaaaaaaaaaa")))).withProperties(new GlobalRulestackResourceUpdateProperties().withPanEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c12").withPanLocation("eastus").withScope(ScopeType.GLOBAL).withAssociatedSubscriptions(Arrays.asList("2bf4a339-294d-4c25-b0b2-ef649e9f5c27")).withDescription("global rulestacks").withDefaultMode(DefaultMode.IPS).withMinAppIdVersion("8.5.3").withSecurityServices(new SecurityServices().withVulnerabilityProfile("default").withAntiSpywareProfile("default").withAntiVirusProfile("default").withUrlFilteringProfile("default").withFileBlockingProfile("default").withDnsSubscription("default").withOutboundUnTrustCertificate("default").withOutboundTrustCertificate("default"))), com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/GlobalRulestack_Update_MinimumSet_Gen.json + public static void globalRulestackUpdateMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.globalRulestacks() + .updateWithResponse("praval", new GlobalRulestackResourceUpdate().withLocation("eastus") + .withIdentity(new AzureResourceManagerManagedIdentityProperties().withType(ManagedIdentityType.NONE) + .withUserAssignedIdentities(mapOf("key16", + new AzureResourceManagerUserAssignedIdentity().withClientId("aaaa") + .withPrincipalId("aaaaaaaaaaaaaaa")))) + .withProperties( + new GlobalRulestackResourceUpdateProperties().withPanEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c12") + .withPanLocation("eastus") + .withScope(ScopeType.GLOBAL) + .withAssociatedSubscriptions(Arrays.asList("2bf4a339-294d-4c25-b0b2-ef649e9f5c27")) + .withDescription("global rulestacks") + .withDefaultMode(DefaultMode.IPS) + .withMinAppIdVersion("8.5.3") + .withSecurityServices(new SecurityServices().withVulnerabilityProfile("default") + .withAntiSpywareProfile("default") + .withAntiVirusProfile("default") + .withUrlFilteringProfile("default") + .withFileBlockingProfile("default") + .withDnsSubscription("default") + .withOutboundUnTrustCertificate("default") + .withOutboundTrustCertificate("default"))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * GlobalRulestack_Update_MinimumSet_Gen.json */ /** * Sample code: GlobalRulestack_Update_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void globalRulestackUpdateMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().updateWithResponse("praval", new GlobalRulestackResourceUpdate(), com.azure.core.util.Context.NONE); + public static void globalRulestackUpdateMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.globalRulestacks() + .updateWithResponse("praval", new GlobalRulestackResourceUpdate(), com.azure.core.util.Context.NONE); } // Use "Map.of" if available @@ -1691,34 +2271,72 @@ import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SourceAddr; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.StateEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.TagInfo; import java.util.Arrays; -import java.util.stream.Collectors; /** * Samples for LocalRules CreateOrUpdate. */ public final class LocalRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRules_CreateOrUpdate_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRules_CreateOrUpdate_MinimumSet_Gen.json */ /** * Sample code: LocalRules_CreateOrUpdate_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulesCreateOrUpdateMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRules().define("1").withExistingLocalRulestack("firewall-rg", "lrs1").withRuleName("localRule1").create(); + public static void localRulesCreateOrUpdateMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.localRules() + .define("1") + .withExistingLocalRulestack("firewall-rg", "lrs1") + .withRuleName("localRule1") + .create(); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRules_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRules_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: LocalRules_CreateOrUpdate_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulesCreateOrUpdateMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRules().define("1").withExistingLocalRulestack("firewall-rg", "lrs1").withRuleName("localRule1").withTags(Arrays.asList(new TagInfo().withKey("fakeTokenPlaceholder").withValue("value"))).withEtag("c18e6eef-ba3e-49ee-8a85-2b36c863a9d0").withDescription("description of local rule").withRuleState(StateEnum.DISABLED).withSource(new SourceAddr().withCidrs(Arrays.asList("1.0.0.1/10")).withCountries(Arrays.asList("India")).withFeeds(Arrays.asList("feed")).withPrefixLists(Arrays.asList("PL1"))).withNegateSource(BooleanEnum.TRUE).withDestination(new DestinationAddr().withCidrs(Arrays.asList("1.0.0.1/10")).withCountries(Arrays.asList("India")).withFeeds(Arrays.asList("feed")).withPrefixLists(Arrays.asList("PL1")).withFqdnLists(Arrays.asList("FQDN1"))).withNegateDestination(BooleanEnum.TRUE).withApplications(Arrays.asList("app1")).withCategory(new Category().withUrlCustom(Arrays.asList("https://microsoft.com")).withFeeds(Arrays.asList("feed"))).withProtocol("HTTP").withProtocolPortList(Arrays.asList("80")).withInboundInspectionCertificate("cert1").withAuditComment("example comment").withActionType(ActionEnum.ALLOW).withEnableLogging(StateEnum.DISABLED).withDecryptionRuleType(DecryptionRuleTypeEnum.SSLOUTBOUND_INSPECTION).create(); + public static void localRulesCreateOrUpdateMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.localRules() + .define("1") + .withExistingLocalRulestack("firewall-rg", "lrs1") + .withRuleName("localRule1") + .withTags(Arrays.asList(new TagInfo().withKey("fakeTokenPlaceholder").withValue("value"))) + .withEtag("c18e6eef-ba3e-49ee-8a85-2b36c863a9d0") + .withDescription("description of local rule") + .withRuleState(StateEnum.DISABLED) + .withSource(new SourceAddr().withCidrs(Arrays.asList("1.0.0.1/10")) + .withCountries(Arrays.asList("India")) + .withFeeds(Arrays.asList("feed")) + .withPrefixLists(Arrays.asList("PL1"))) + .withNegateSource(BooleanEnum.TRUE) + .withDestination(new DestinationAddr().withCidrs(Arrays.asList("1.0.0.1/10")) + .withCountries(Arrays.asList("India")) + .withFeeds(Arrays.asList("feed")) + .withPrefixLists(Arrays.asList("PL1")) + .withFqdnLists(Arrays.asList("FQDN1"))) + .withNegateDestination(BooleanEnum.TRUE) + .withApplications(Arrays.asList("app1")) + .withCategory( + new Category().withUrlCustom(Arrays.asList("https://microsoft.com")).withFeeds(Arrays.asList("feed"))) + .withProtocol("HTTP") + .withProtocolPortList(Arrays.asList("80")) + .withInboundInspectionCertificate("cert1") + .withAuditComment("example comment") + .withActionType(ActionEnum.ALLOW) + .withEnableLogging(StateEnum.DISABLED) + .withDecryptionRuleType(DecryptionRuleTypeEnum.SSLOUTBOUND_INSPECTION) + .create(); } } ``` @@ -1731,26 +2349,32 @@ public final class LocalRulesCreateOrUpdateSamples { */ public final class LocalRulesDeleteSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRules_Delete_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRules_Delete_MaximumSet_Gen.json */ /** * Sample code: LocalRules_Delete_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulesDeleteMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void localRulesDeleteMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.localRules().delete("firewall-rg", "lrs1", "1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRules_Delete_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRules_Delete_MinimumSet_Gen.json */ /** * Sample code: LocalRules_Delete_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulesDeleteMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void localRulesDeleteMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.localRules().delete("firewall-rg", "lrs1", "1", com.azure.core.util.Context.NONE); } } @@ -1764,26 +2388,32 @@ public final class LocalRulesDeleteSamples { */ public final class LocalRulesGetSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRules_Get_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRules_Get_MaximumSet_Gen.json */ /** * Sample code: LocalRules_Get_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulesGetMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void localRulesGetMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.localRules().getWithResponse("firewall-rg", "lrs1", "1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRules_Get_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRules_Get_MinimumSet_Gen.json */ /** * Sample code: LocalRules_Get_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulesGetMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void localRulesGetMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.localRules().getWithResponse("firewall-rg", "lrs1", "1", com.azure.core.util.Context.NONE); } } @@ -1797,27 +2427,35 @@ public final class LocalRulesGetSamples { */ public final class LocalRulesGetCountersSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRules_getCounters_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRules_getCounters_MaximumSet_Gen.json */ /** * Sample code: LocalRules_getCounters_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulesGetCountersMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRules().getCountersWithResponse("firewall-rg", "lrs1", "1", "firewall1", com.azure.core.util.Context.NONE); + public static void localRulesGetCountersMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.localRules() + .getCountersWithResponse("firewall-rg", "lrs1", "1", "firewall1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRules_getCounters_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRules_getCounters_MinimumSet_Gen.json */ /** * Sample code: LocalRules_getCounters_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulesGetCountersMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRules().getCountersWithResponse("firewall-rg", "lrs1", "1", null, com.azure.core.util.Context.NONE); + public static void localRulesGetCountersMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.localRules() + .getCountersWithResponse("firewall-rg", "lrs1", "1", null, com.azure.core.util.Context.NONE); } } ``` @@ -1830,26 +2468,32 @@ public final class LocalRulesGetCountersSamples { */ public final class LocalRulesListByLocalRulestacksSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRules_ListByLocalRulestacks_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRules_ListByLocalRulestacks_MinimumSet_Gen.json */ /** * Sample code: LocalRules_ListByLocalRulestacks_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulesListByLocalRulestacksMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void localRulesListByLocalRulestacksMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.localRules().listByLocalRulestacks("firewall-rg", "lrs1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRules_ListByLocalRulestacks_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRules_ListByLocalRulestacks_MaximumSet_Gen.json */ /** * Sample code: LocalRules_ListByLocalRulestacks_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulesListByLocalRulestacksMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void localRulesListByLocalRulestacksMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.localRules().listByLocalRulestacks("firewall-rg", "lrs1", com.azure.core.util.Context.NONE); } } @@ -1863,27 +2507,35 @@ public final class LocalRulesListByLocalRulestacksSamples { */ public final class LocalRulesRefreshCountersSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRules_refreshCounters_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRules_refreshCounters_MinimumSet_Gen.json */ /** * Sample code: LocalRules_refreshCounters_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulesRefreshCountersMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRules().refreshCountersWithResponse("firewall-rg", "lrs1", "1", null, com.azure.core.util.Context.NONE); + public static void localRulesRefreshCountersMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.localRules() + .refreshCountersWithResponse("firewall-rg", "lrs1", "1", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRules_refreshCounters_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRules_refreshCounters_MaximumSet_Gen.json */ /** * Sample code: LocalRules_refreshCounters_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulesRefreshCountersMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRules().refreshCountersWithResponse("firewall-rg", "lrs1", "1", "firewall1", com.azure.core.util.Context.NONE); + public static void localRulesRefreshCountersMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.localRules() + .refreshCountersWithResponse("firewall-rg", "lrs1", "1", "firewall1", com.azure.core.util.Context.NONE); } } ``` @@ -1896,27 +2548,35 @@ public final class LocalRulesRefreshCountersSamples { */ public final class LocalRulesResetCountersSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRules_resetCounters_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRules_resetCounters_MaximumSet_Gen.json */ /** * Sample code: LocalRules_resetCounters_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulesResetCountersMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRules().resetCountersWithResponse("firewall-rg", "lrs1", "1", "firewall1", com.azure.core.util.Context.NONE); + public static void localRulesResetCountersMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.localRules() + .resetCountersWithResponse("firewall-rg", "lrs1", "1", "firewall1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRules_resetCounters_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRules_resetCounters_MinimumSet_Gen.json */ /** * Sample code: LocalRules_resetCounters_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulesResetCountersMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRules().resetCountersWithResponse("firewall-rg", "lrs1", "1", null, com.azure.core.util.Context.NONE); + public static void localRulesResetCountersMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.localRules() + .resetCountersWithResponse("firewall-rg", "lrs1", "1", null, com.azure.core.util.Context.NONE); } } ``` @@ -1929,26 +2589,32 @@ public final class LocalRulesResetCountersSamples { */ public final class LocalRulestacksCommitSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_commit_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_commit_MinimumSet_Gen.json */ /** * Sample code: LocalRulestacks_commit_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksCommitMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void localRulestacksCommitMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.localRulestacks().commit("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_commit_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_commit_MaximumSet_Gen.json */ /** * Sample code: LocalRulestacks_commit_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksCommitMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void localRulestacksCommitMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.localRulestacks().commit("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); } } @@ -1966,34 +2632,63 @@ import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SecurityServices; import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import java.util.stream.Collectors; /** * Samples for LocalRulestacks CreateOrUpdate. */ public final class LocalRulestacksCreateOrUpdateSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_CreateOrUpdate_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_CreateOrUpdate_MinimumSet_Gen.json */ /** * Sample code: LocalRulestacks_CreateOrUpdate_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksCreateOrUpdateMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void localRulestacksCreateOrUpdateMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.localRulestacks().define("lrs1").withRegion("eastus").withExistingResourceGroup("rgopenapi").create(); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: LocalRulestacks_CreateOrUpdate_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksCreateOrUpdateMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().define("lrs1").withRegion("eastus").withExistingResourceGroup("rgopenapi").withTags(mapOf("tagName", "value")).withIdentity(new AzureResourceManagerManagedIdentityProperties().withType(ManagedIdentityType.NONE).withUserAssignedIdentities(mapOf("key16", new AzureResourceManagerUserAssignedIdentity().withClientId("aaaa").withPrincipalId("aaaaaaaaaaaaaaa")))).withPanEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c12").withPanLocation("eastus").withScope(ScopeType.LOCAL).withAssociatedSubscriptions(Arrays.asList("2bf4a339-294d-4c25-b0b2-ef649e9f5c27")).withDescription("local rulestacks").withDefaultMode(DefaultMode.IPS).withMinAppIdVersion("8.5.3").withSecurityServices(new SecurityServices().withVulnerabilityProfile("default").withAntiSpywareProfile("default").withAntiVirusProfile("default").withUrlFilteringProfile("default").withFileBlockingProfile("default").withDnsSubscription("default").withOutboundUnTrustCertificate("default").withOutboundTrustCertificate("default")).create(); + public static void localRulestacksCreateOrUpdateMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.localRulestacks() + .define("lrs1") + .withRegion("eastus") + .withExistingResourceGroup("rgopenapi") + .withTags(mapOf("tagName", "value")) + .withIdentity(new AzureResourceManagerManagedIdentityProperties().withType(ManagedIdentityType.NONE) + .withUserAssignedIdentities(mapOf("key16", + new AzureResourceManagerUserAssignedIdentity().withClientId("aaaa") + .withPrincipalId("aaaaaaaaaaaaaaa")))) + .withPanEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c12") + .withPanLocation("eastus") + .withScope(ScopeType.LOCAL) + .withAssociatedSubscriptions(Arrays.asList("2bf4a339-294d-4c25-b0b2-ef649e9f5c27")) + .withDescription("local rulestacks") + .withDefaultMode(DefaultMode.IPS) + .withMinAppIdVersion("8.5.3") + .withSecurityServices(new SecurityServices().withVulnerabilityProfile("default") + .withAntiSpywareProfile("default") + .withAntiVirusProfile("default") + .withUrlFilteringProfile("default") + .withFileBlockingProfile("default") + .withDnsSubscription("default") + .withOutboundUnTrustCertificate("default") + .withOutboundTrustCertificate("default")) + .create(); } // Use "Map.of" if available @@ -2018,26 +2713,32 @@ public final class LocalRulestacksCreateOrUpdateSamples { */ public final class LocalRulestacksDeleteSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_Delete_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_Delete_MaximumSet_Gen.json */ /** * Sample code: LocalRulestacks_Delete_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksDeleteMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void localRulestacksDeleteMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.localRulestacks().delete("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_Delete_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_Delete_MinimumSet_Gen.json */ /** * Sample code: LocalRulestacks_Delete_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksDeleteMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void localRulestacksDeleteMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.localRulestacks().delete("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); } } @@ -2051,26 +2752,32 @@ public final class LocalRulestacksDeleteSamples { */ public final class LocalRulestacksGetByResourceGroupSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_Get_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_Get_MaximumSet_Gen.json */ /** * Sample code: LocalRulestacks_Get_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksGetMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void localRulestacksGetMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.localRulestacks().getByResourceGroupWithResponse("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_Get_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_Get_MinimumSet_Gen.json */ /** * Sample code: LocalRulestacks_Get_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksGetMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void localRulestacksGetMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.localRulestacks().getByResourceGroupWithResponse("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); } } @@ -2084,26 +2791,32 @@ public final class LocalRulestacksGetByResourceGroupSamples { */ public final class LocalRulestacksGetChangeLogSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_getChangeLog_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_getChangeLog_MinimumSet_Gen.json */ /** * Sample code: LocalRulestacks_getChangeLog_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksGetChangeLogMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void localRulestacksGetChangeLogMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.localRulestacks().getChangeLogWithResponse("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_getChangeLog_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_getChangeLog_MaximumSet_Gen.json */ /** * Sample code: LocalRulestacks_getChangeLog_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksGetChangeLogMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void localRulestacksGetChangeLogMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.localRulestacks().getChangeLogWithResponse("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); } } @@ -2117,27 +2830,35 @@ public final class LocalRulestacksGetChangeLogSamples { */ public final class LocalRulestacksGetSupportInfoSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_getSupportInfo_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_getSupportInfo_MinimumSet_Gen.json */ /** * Sample code: LocalRulestacks_getSupportInfo_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksGetSupportInfoMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().getSupportInfoWithResponse("rgopenapi", "lrs1", null, com.azure.core.util.Context.NONE); + public static void localRulestacksGetSupportInfoMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.localRulestacks() + .getSupportInfoWithResponse("rgopenapi", "lrs1", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_getSupportInfo_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_getSupportInfo_MaximumSet_Gen.json */ /** * Sample code: LocalRulestacks_getSupportInfo_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksGetSupportInfoMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().getSupportInfoWithResponse("rgopenapi", "lrs1", "user1@domain.com", com.azure.core.util.Context.NONE); + public static void localRulestacksGetSupportInfoMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.localRulestacks() + .getSupportInfoWithResponse("rgopenapi", "lrs1", "user1@domain.com", com.azure.core.util.Context.NONE); } } ``` @@ -2150,26 +2871,32 @@ public final class LocalRulestacksGetSupportInfoSamples { */ public final class LocalRulestacksListSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_ListBySubscription_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_ListBySubscription_MaximumSet_Gen.json */ /** * Sample code: LocalRulestacks_ListBySubscription_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksListBySubscriptionMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void localRulestacksListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.localRulestacks().list(com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_ListBySubscription_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_ListBySubscription_MinimumSet_Gen.json */ /** * Sample code: LocalRulestacks_ListBySubscription_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksListBySubscriptionMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void localRulestacksListBySubscriptionMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.localRulestacks().list(com.azure.core.util.Context.NONE); } } @@ -2179,34 +2906,44 @@ public final class LocalRulestacksListSamples { ```java import com.azure.resourcemanager.paloaltonetworks.ngfw.models.AdvSecurityObjectTypeEnum; -import java.util.stream.Collectors; /** * Samples for LocalRulestacks ListAdvancedSecurityObjects. */ public final class LocalRulestacksListAdvancedSecurityObjectsSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_listAdvancedSecurityObjects_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_listAdvancedSecurityObjects_MaximumSet_Gen.json */ /** * Sample code: LocalRulestacks_listAdvancedSecurityObjects_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksListAdvancedSecurityObjectsMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().listAdvancedSecurityObjectsWithResponse("rgopenapi", "lrs1", AdvSecurityObjectTypeEnum.fromString("localRulestacks"), "a6a321", 20, com.azure.core.util.Context.NONE); + public static void localRulestacksListAdvancedSecurityObjectsMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.localRulestacks() + .listAdvancedSecurityObjectsWithResponse("rgopenapi", "lrs1", + AdvSecurityObjectTypeEnum.fromString("localRulestacks"), "a6a321", 20, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_listAdvancedSecurityObjects_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_listAdvancedSecurityObjects_MinimumSet_Gen.json */ /** * Sample code: LocalRulestacks_listAdvancedSecurityObjects_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksListAdvancedSecurityObjectsMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().listAdvancedSecurityObjectsWithResponse("rgopenapi", "lrs1", AdvSecurityObjectTypeEnum.fromString("localRulestacks"), null, null, com.azure.core.util.Context.NONE); + public static void localRulestacksListAdvancedSecurityObjectsMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.localRulestacks() + .listAdvancedSecurityObjectsWithResponse("rgopenapi", "lrs1", + AdvSecurityObjectTypeEnum.fromString("localRulestacks"), null, null, com.azure.core.util.Context.NONE); } } ``` @@ -2219,27 +2956,36 @@ public final class LocalRulestacksListAdvancedSecurityObjectsSamples { */ public final class LocalRulestacksListAppIdsSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_listAppIds_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_listAppIds_MaximumSet_Gen.json */ /** * Sample code: LocalRulestacks_listAppIds_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksListAppIdsMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().listAppIdsWithResponse("rgopenapi", "lrs1", "8543", "pref", "a6a321", 20, com.azure.core.util.Context.NONE); + public static void localRulestacksListAppIdsMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.localRulestacks() + .listAppIdsWithResponse("rgopenapi", "lrs1", "8543", "pref", "a6a321", 20, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_listAppIds_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_listAppIds_MinimumSet_Gen.json */ /** * Sample code: LocalRulestacks_listAppIds_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksListAppIdsMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().listAppIdsWithResponse("rgopenapi", "lrs1", null, null, null, null, com.azure.core.util.Context.NONE); + public static void localRulestacksListAppIdsMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.localRulestacks() + .listAppIdsWithResponse("rgopenapi", "lrs1", null, null, null, null, com.azure.core.util.Context.NONE); } } ``` @@ -2252,26 +2998,32 @@ public final class LocalRulestacksListAppIdsSamples { */ public final class LocalRulestacksListByResourceGroupSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_ListByResourceGroup_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_ListByResourceGroup_MaximumSet_Gen.json */ /** * Sample code: LocalRulestacks_ListByResourceGroup_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksListByResourceGroupMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void localRulestacksListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.localRulestacks().listByResourceGroup("rgopenapi", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_ListByResourceGroup_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_ListByResourceGroup_MinimumSet_Gen.json */ /** * Sample code: LocalRulestacks_ListByResourceGroup_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksListByResourceGroupMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void localRulestacksListByResourceGroupMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.localRulestacks().listByResourceGroup("rgopenapi", com.azure.core.util.Context.NONE); } } @@ -2285,27 +3037,35 @@ public final class LocalRulestacksListByResourceGroupSamples { */ public final class LocalRulestacksListCountriesSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_listCountries_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_listCountries_MaximumSet_Gen.json */ /** * Sample code: LocalRulestacks_listCountries_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksListCountriesMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().listCountriesWithResponse("rgopenapi", "lrs1", "a6a321", 20, com.azure.core.util.Context.NONE); + public static void localRulestacksListCountriesMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.localRulestacks() + .listCountriesWithResponse("rgopenapi", "lrs1", "a6a321", 20, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_listCountries_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_listCountries_MinimumSet_Gen.json */ /** * Sample code: LocalRulestacks_listCountries_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksListCountriesMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().listCountriesWithResponse("rgopenapi", "lrs1", null, null, com.azure.core.util.Context.NONE); + public static void localRulestacksListCountriesMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.localRulestacks() + .listCountriesWithResponse("rgopenapi", "lrs1", null, null, com.azure.core.util.Context.NONE); } } ``` @@ -2318,26 +3078,32 @@ public final class LocalRulestacksListCountriesSamples { */ public final class LocalRulestacksListFirewallsSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_listFirewalls_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_listFirewalls_MinimumSet_Gen.json */ /** * Sample code: LocalRulestacks_listFirewalls_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksListFirewallsMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void localRulestacksListFirewallsMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.localRulestacks().listFirewallsWithResponse("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_listFirewalls_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_listFirewalls_MaximumSet_Gen.json */ /** * Sample code: LocalRulestacks_listFirewalls_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksListFirewallsMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void localRulestacksListFirewallsMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.localRulestacks().listFirewallsWithResponse("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); } } @@ -2351,27 +3117,36 @@ public final class LocalRulestacksListFirewallsSamples { */ public final class LocalRulestacksListPredefinedUrlCategoriesSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_listPredefinedUrlCategories_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_listPredefinedUrlCategories_MinimumSet_Gen.json */ /** * Sample code: LocalRulestacks_listPredefinedUrlCategories_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksListPredefinedUrlCategoriesMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().listPredefinedUrlCategoriesWithResponse("rgopenapi", "lrs1", null, null, com.azure.core.util.Context.NONE); + public static void localRulestacksListPredefinedUrlCategoriesMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.localRulestacks() + .listPredefinedUrlCategoriesWithResponse("rgopenapi", "lrs1", null, null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_listPredefinedUrlCategories_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_listPredefinedUrlCategories_MaximumSet_Gen.json */ /** * Sample code: LocalRulestacks_listPredefinedUrlCategories_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksListPredefinedUrlCategoriesMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().listPredefinedUrlCategoriesWithResponse("rgopenapi", "lrs1", "a6a321", 20, com.azure.core.util.Context.NONE); + public static void localRulestacksListPredefinedUrlCategoriesMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.localRulestacks() + .listPredefinedUrlCategoriesWithResponse("rgopenapi", "lrs1", "a6a321", 20, + com.azure.core.util.Context.NONE); } } ``` @@ -2380,34 +3155,43 @@ public final class LocalRulestacksListPredefinedUrlCategoriesSamples { ```java import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SecurityServicesTypeEnum; -import java.util.stream.Collectors; /** * Samples for LocalRulestacks ListSecurityServices. */ public final class LocalRulestacksListSecurityServicesSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_listSecurityServices_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_listSecurityServices_MinimumSet_Gen.json */ /** * Sample code: LocalRulestacks_listSecurityServices_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksListSecurityServicesMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().listSecurityServicesWithResponse("rgopenapi", "lrs1", SecurityServicesTypeEnum.fromString("localRulestacks"), null, null, com.azure.core.util.Context.NONE); + public static void localRulestacksListSecurityServicesMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.localRulestacks() + .listSecurityServicesWithResponse("rgopenapi", "lrs1", + SecurityServicesTypeEnum.fromString("localRulestacks"), null, null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_listSecurityServices_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_listSecurityServices_MaximumSet_Gen.json */ /** * Sample code: LocalRulestacks_listSecurityServices_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksListSecurityServicesMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().listSecurityServicesWithResponse("rgopenapi", "lrs1", SecurityServicesTypeEnum.fromString("localRulestacks"), "a6a321", 20, com.azure.core.util.Context.NONE); + public static void localRulestacksListSecurityServicesMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.localRulestacks() + .listSecurityServicesWithResponse("rgopenapi", "lrs1", + SecurityServicesTypeEnum.fromString("localRulestacks"), "a6a321", 20, com.azure.core.util.Context.NONE); } } ``` @@ -2420,26 +3204,32 @@ public final class LocalRulestacksListSecurityServicesSamples { */ public final class LocalRulestacksRevertSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_revert_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_revert_MaximumSet_Gen.json */ /** * Sample code: LocalRulestacks_revert_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksRevertMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void localRulestacksRevertMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.localRulestacks().revertWithResponse("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_revert_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_revert_MinimumSet_Gen.json */ /** * Sample code: LocalRulestacks_revert_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksRevertMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void localRulestacksRevertMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.localRulestacks().revertWithResponse("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); } } @@ -2459,35 +3249,66 @@ import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SecurityServices; import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import java.util.stream.Collectors; /** * Samples for LocalRulestacks Update. */ public final class LocalRulestacksUpdateSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_Update_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_Update_MaximumSet_Gen.json */ /** * Sample code: LocalRulestacks_Update_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksUpdateMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - LocalRulestackResource resource = manager.localRulestacks().getByResourceGroupWithResponse("rgopenapi", "lrs1", com.azure.core.util.Context.NONE).getValue(); - resource.update().withTags(mapOf("tagName", "value")).withIdentity(new AzureResourceManagerManagedIdentityProperties().withType(ManagedIdentityType.NONE).withUserAssignedIdentities(mapOf("key16", new AzureResourceManagerUserAssignedIdentity().withClientId("aaaa").withPrincipalId("aaaaaaaaaaaaaaa")))).withProperties(new LocalRulestackResourceUpdateProperties().withPanEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c12").withPanLocation("eastus").withScope(ScopeType.LOCAL).withAssociatedSubscriptions(Arrays.asList("2bf4a339-294d-4c25-b0b2-ef649e9f5c27")).withDescription("local rulestacks").withDefaultMode(DefaultMode.IPS).withMinAppIdVersion("8.5.3").withSecurityServices(new SecurityServices().withVulnerabilityProfile("default").withAntiSpywareProfile("default").withAntiVirusProfile("default").withUrlFilteringProfile("default").withFileBlockingProfile("default").withDnsSubscription("default").withOutboundUnTrustCertificate("default").withOutboundTrustCertificate("default"))).apply(); - } - - /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/LocalRulestacks_Update_MinimumSet_Gen.json + public static void localRulestacksUpdateMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + LocalRulestackResource resource = manager.localRulestacks() + .getByResourceGroupWithResponse("rgopenapi", "lrs1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("tagName", "value")) + .withIdentity(new AzureResourceManagerManagedIdentityProperties().withType(ManagedIdentityType.NONE) + .withUserAssignedIdentities(mapOf("key16", + new AzureResourceManagerUserAssignedIdentity().withClientId("aaaa") + .withPrincipalId("aaaaaaaaaaaaaaa")))) + .withProperties( + new LocalRulestackResourceUpdateProperties().withPanEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c12") + .withPanLocation("eastus") + .withScope(ScopeType.LOCAL) + .withAssociatedSubscriptions(Arrays.asList("2bf4a339-294d-4c25-b0b2-ef649e9f5c27")) + .withDescription("local rulestacks") + .withDefaultMode(DefaultMode.IPS) + .withMinAppIdVersion("8.5.3") + .withSecurityServices(new SecurityServices().withVulnerabilityProfile("default") + .withAntiSpywareProfile("default") + .withAntiVirusProfile("default") + .withUrlFilteringProfile("default") + .withFileBlockingProfile("default") + .withDnsSubscription("default") + .withOutboundUnTrustCertificate("default") + .withOutboundTrustCertificate("default"))) + .apply(); + } + + /* + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * LocalRulestacks_Update_MinimumSet_Gen.json */ /** * Sample code: LocalRulestacks_Update_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void localRulestacksUpdateMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - LocalRulestackResource resource = manager.localRulestacks().getByResourceGroupWithResponse("rgopenapi", "lrs1", com.azure.core.util.Context.NONE).getValue(); + public static void localRulestacksUpdateMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + LocalRulestackResource resource = manager.localRulestacks() + .getByResourceGroupWithResponse("rgopenapi", "lrs1", com.azure.core.util.Context.NONE) + .getValue(); resource.update().apply(); } @@ -2513,26 +3334,32 @@ public final class LocalRulestacksUpdateSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/Operations_List_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * Operations_List_MinimumSet_Gen.json */ /** * Sample code: Operations_List_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void operationsListMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void operationsListMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.operations().list(com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/Operations_List_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * Operations_List_MaximumSet_Gen.json */ /** * Sample code: Operations_List_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void operationsListMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void operationsListMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.operations().list(com.azure.core.util.Context.NONE); } } @@ -2551,34 +3378,69 @@ import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SourceAddr; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.StateEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.TagInfo; import java.util.Arrays; -import java.util.stream.Collectors; /** * Samples for PostRules CreateOrUpdate. */ public final class PostRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PostRules_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PostRules_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: PostRules_CreateOrUpdate_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void postRulesCreateOrUpdateMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.postRules().createOrUpdate("lrs1", "1", new PostRulesResourceInner().withEtag("c18e6eef-ba3e-49ee-8a85-2b36c863a9d0").withRuleName("postRule1").withDescription("description of post rule").withRuleState(StateEnum.DISABLED).withSource(new SourceAddr().withCidrs(Arrays.asList("1.0.0.1/10")).withCountries(Arrays.asList("India")).withFeeds(Arrays.asList("feed")).withPrefixLists(Arrays.asList("PL1"))).withNegateSource(BooleanEnum.TRUE).withDestination(new DestinationAddr().withCidrs(Arrays.asList("1.0.0.1/10")).withCountries(Arrays.asList("India")).withFeeds(Arrays.asList("feed")).withPrefixLists(Arrays.asList("PL1")).withFqdnLists(Arrays.asList("FQDN1"))).withNegateDestination(BooleanEnum.TRUE).withApplications(Arrays.asList("app1")).withCategory(new Category().withUrlCustom(Arrays.asList("https://microsoft.com")).withFeeds(Arrays.asList("feed"))).withProtocol("HTTP").withProtocolPortList(Arrays.asList("80")).withInboundInspectionCertificate("cert1").withAuditComment("example comment").withActionType(ActionEnum.ALLOW).withEnableLogging(StateEnum.DISABLED).withDecryptionRuleType(DecryptionRuleTypeEnum.SSLOUTBOUND_INSPECTION).withTags(Arrays.asList(new TagInfo().withKey("fakeTokenPlaceholder").withValue("value"))), com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PostRules_CreateOrUpdate_MinimumSet_Gen.json + public static void postRulesCreateOrUpdateMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.postRules() + .createOrUpdate("lrs1", "1", + new PostRulesResourceInner().withEtag("c18e6eef-ba3e-49ee-8a85-2b36c863a9d0") + .withRuleName("postRule1") + .withDescription("description of post rule") + .withRuleState(StateEnum.DISABLED) + .withSource(new SourceAddr().withCidrs(Arrays.asList("1.0.0.1/10")) + .withCountries(Arrays.asList("India")) + .withFeeds(Arrays.asList("feed")) + .withPrefixLists(Arrays.asList("PL1"))) + .withNegateSource(BooleanEnum.TRUE) + .withDestination(new DestinationAddr().withCidrs(Arrays.asList("1.0.0.1/10")) + .withCountries(Arrays.asList("India")) + .withFeeds(Arrays.asList("feed")) + .withPrefixLists(Arrays.asList("PL1")) + .withFqdnLists(Arrays.asList("FQDN1"))) + .withNegateDestination(BooleanEnum.TRUE) + .withApplications(Arrays.asList("app1")) + .withCategory(new Category().withUrlCustom(Arrays.asList("https://microsoft.com")) + .withFeeds(Arrays.asList("feed"))) + .withProtocol("HTTP") + .withProtocolPortList(Arrays.asList("80")) + .withInboundInspectionCertificate("cert1") + .withAuditComment("example comment") + .withActionType(ActionEnum.ALLOW) + .withEnableLogging(StateEnum.DISABLED) + .withDecryptionRuleType(DecryptionRuleTypeEnum.SSLOUTBOUND_INSPECTION) + .withTags(Arrays.asList(new TagInfo().withKey("fakeTokenPlaceholder").withValue("value"))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PostRules_CreateOrUpdate_MinimumSet_Gen.json */ /** * Sample code: PostRules_CreateOrUpdate_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void postRulesCreateOrUpdateMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.postRules().createOrUpdate("lrs1", "1", new PostRulesResourceInner().withRuleName("postRule1"), com.azure.core.util.Context.NONE); + public static void postRulesCreateOrUpdateMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.postRules() + .createOrUpdate("lrs1", "1", new PostRulesResourceInner().withRuleName("postRule1"), + com.azure.core.util.Context.NONE); } } ``` @@ -2591,26 +3453,32 @@ public final class PostRulesCreateOrUpdateSamples { */ public final class PostRulesDeleteSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PostRules_Delete_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PostRules_Delete_MinimumSet_Gen.json */ /** * Sample code: PostRules_Delete_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void postRulesDeleteMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void postRulesDeleteMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.postRules().delete("lrs1", "1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PostRules_Delete_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PostRules_Delete_MaximumSet_Gen.json */ /** * Sample code: PostRules_Delete_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void postRulesDeleteMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void postRulesDeleteMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.postRules().delete("lrs1", "1", com.azure.core.util.Context.NONE); } } @@ -2624,26 +3492,32 @@ public final class PostRulesDeleteSamples { */ public final class PostRulesGetSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PostRules_Get_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PostRules_Get_MinimumSet_Gen.json */ /** * Sample code: PostRules_Get_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void postRulesGetMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void + postRulesGetMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.postRules().getWithResponse("lrs1", "1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PostRules_Get_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PostRules_Get_MaximumSet_Gen.json */ /** * Sample code: PostRules_Get_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void postRulesGetMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void + postRulesGetMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.postRules().getWithResponse("lrs1", "1", com.azure.core.util.Context.NONE); } } @@ -2657,26 +3531,32 @@ public final class PostRulesGetSamples { */ public final class PostRulesGetCountersSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PostRules_getCounters_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PostRules_getCounters_MinimumSet_Gen.json */ /** * Sample code: PostRules_getCounters_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void postRulesGetCountersMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void postRulesGetCountersMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.postRules().getCountersWithResponse("lrs1", "1", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PostRules_getCounters_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PostRules_getCounters_MaximumSet_Gen.json */ /** * Sample code: PostRules_getCounters_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void postRulesGetCountersMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void postRulesGetCountersMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.postRules().getCountersWithResponse("lrs1", "1", "firewall1", com.azure.core.util.Context.NONE); } } @@ -2690,26 +3570,32 @@ public final class PostRulesGetCountersSamples { */ public final class PostRulesListSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PostRules_List_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PostRules_List_MinimumSet_Gen.json */ /** * Sample code: PostRules_List_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void postRulesListMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void postRulesListMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.postRules().list("lrs1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PostRules_List_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PostRules_List_MaximumSet_Gen.json */ /** * Sample code: PostRules_List_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void postRulesListMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void postRulesListMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.postRules().list("lrs1", com.azure.core.util.Context.NONE); } } @@ -2723,26 +3609,32 @@ public final class PostRulesListSamples { */ public final class PostRulesRefreshCountersSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PostRules_refreshCounters_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PostRules_refreshCounters_MaximumSet_Gen.json */ /** * Sample code: PostRules_refreshCounters_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void postRulesRefreshCountersMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void postRulesRefreshCountersMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.postRules().refreshCountersWithResponse("lrs1", "1", "firewall1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PostRules_refreshCounters_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PostRules_refreshCounters_MinimumSet_Gen.json */ /** * Sample code: PostRules_refreshCounters_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void postRulesRefreshCountersMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void postRulesRefreshCountersMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.postRules().refreshCountersWithResponse("lrs1", "1", null, com.azure.core.util.Context.NONE); } } @@ -2756,26 +3648,32 @@ public final class PostRulesRefreshCountersSamples { */ public final class PostRulesResetCountersSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PostRules_resetCounters_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PostRules_resetCounters_MaximumSet_Gen.json */ /** * Sample code: PostRules_resetCounters_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void postRulesResetCountersMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void postRulesResetCountersMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.postRules().resetCountersWithResponse("lrs1", "1", "firewall1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PostRules_resetCounters_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PostRules_resetCounters_MinimumSet_Gen.json */ /** * Sample code: PostRules_resetCounters_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void postRulesResetCountersMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void postRulesResetCountersMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.postRules().resetCountersWithResponse("lrs1", "1", null, com.azure.core.util.Context.NONE); } } @@ -2794,34 +3692,69 @@ import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SourceAddr; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.StateEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.TagInfo; import java.util.Arrays; -import java.util.stream.Collectors; /** * Samples for PreRules CreateOrUpdate. */ public final class PreRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PreRules_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PreRules_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: PreRules_CreateOrUpdate_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void preRulesCreateOrUpdateMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.preRules().createOrUpdate("lrs1", "1", new PreRulesResourceInner().withEtag("c18e6eef-ba3e-49ee-8a85-2b36c863a9d0").withRuleName("preRule1").withDescription("description of pre rule").withRuleState(StateEnum.DISABLED).withSource(new SourceAddr().withCidrs(Arrays.asList("1.0.0.1/10")).withCountries(Arrays.asList("India")).withFeeds(Arrays.asList("feed")).withPrefixLists(Arrays.asList("PL1"))).withNegateSource(BooleanEnum.TRUE).withDestination(new DestinationAddr().withCidrs(Arrays.asList("1.0.0.1/10")).withCountries(Arrays.asList("India")).withFeeds(Arrays.asList("feed")).withPrefixLists(Arrays.asList("PL1")).withFqdnLists(Arrays.asList("FQDN1"))).withNegateDestination(BooleanEnum.TRUE).withApplications(Arrays.asList("app1")).withCategory(new Category().withUrlCustom(Arrays.asList("https://microsoft.com")).withFeeds(Arrays.asList("feed"))).withProtocol("HTTP").withProtocolPortList(Arrays.asList("80")).withInboundInspectionCertificate("cert1").withAuditComment("example comment").withActionType(ActionEnum.ALLOW).withEnableLogging(StateEnum.DISABLED).withDecryptionRuleType(DecryptionRuleTypeEnum.SSLOUTBOUND_INSPECTION).withTags(Arrays.asList(new TagInfo().withKey("fakeTokenPlaceholder").withValue("value"))), com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PreRules_CreateOrUpdate_MinimumSet_Gen.json + public static void preRulesCreateOrUpdateMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.preRules() + .createOrUpdate("lrs1", "1", + new PreRulesResourceInner().withEtag("c18e6eef-ba3e-49ee-8a85-2b36c863a9d0") + .withRuleName("preRule1") + .withDescription("description of pre rule") + .withRuleState(StateEnum.DISABLED) + .withSource(new SourceAddr().withCidrs(Arrays.asList("1.0.0.1/10")) + .withCountries(Arrays.asList("India")) + .withFeeds(Arrays.asList("feed")) + .withPrefixLists(Arrays.asList("PL1"))) + .withNegateSource(BooleanEnum.TRUE) + .withDestination(new DestinationAddr().withCidrs(Arrays.asList("1.0.0.1/10")) + .withCountries(Arrays.asList("India")) + .withFeeds(Arrays.asList("feed")) + .withPrefixLists(Arrays.asList("PL1")) + .withFqdnLists(Arrays.asList("FQDN1"))) + .withNegateDestination(BooleanEnum.TRUE) + .withApplications(Arrays.asList("app1")) + .withCategory(new Category().withUrlCustom(Arrays.asList("https://microsoft.com")) + .withFeeds(Arrays.asList("feed"))) + .withProtocol("HTTP") + .withProtocolPortList(Arrays.asList("80")) + .withInboundInspectionCertificate("cert1") + .withAuditComment("example comment") + .withActionType(ActionEnum.ALLOW) + .withEnableLogging(StateEnum.DISABLED) + .withDecryptionRuleType(DecryptionRuleTypeEnum.SSLOUTBOUND_INSPECTION) + .withTags(Arrays.asList(new TagInfo().withKey("fakeTokenPlaceholder").withValue("value"))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PreRules_CreateOrUpdate_MinimumSet_Gen.json */ /** * Sample code: PreRules_CreateOrUpdate_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void preRulesCreateOrUpdateMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.preRules().createOrUpdate("lrs1", "1", new PreRulesResourceInner().withRuleName("preRule1"), com.azure.core.util.Context.NONE); + public static void preRulesCreateOrUpdateMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.preRules() + .createOrUpdate("lrs1", "1", new PreRulesResourceInner().withRuleName("preRule1"), + com.azure.core.util.Context.NONE); } } ``` @@ -2834,26 +3767,32 @@ public final class PreRulesCreateOrUpdateSamples { */ public final class PreRulesDeleteSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PreRules_Delete_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PreRules_Delete_MinimumSet_Gen.json */ /** * Sample code: PreRules_Delete_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void preRulesDeleteMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void preRulesDeleteMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.preRules().delete("lrs1", "1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PreRules_Delete_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PreRules_Delete_MaximumSet_Gen.json */ /** * Sample code: PreRules_Delete_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void preRulesDeleteMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void preRulesDeleteMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.preRules().delete("lrs1", "1", com.azure.core.util.Context.NONE); } } @@ -2867,26 +3806,32 @@ public final class PreRulesDeleteSamples { */ public final class PreRulesGetSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PreRules_Get_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PreRules_Get_MaximumSet_Gen.json */ /** * Sample code: PreRules_Get_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void preRulesGetMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void + preRulesGetMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.preRules().getWithResponse("lrs1", "1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PreRules_Get_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PreRules_Get_MinimumSet_Gen.json */ /** * Sample code: PreRules_Get_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void preRulesGetMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void + preRulesGetMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.preRules().getWithResponse("lrs1", "1", com.azure.core.util.Context.NONE); } } @@ -2900,26 +3845,32 @@ public final class PreRulesGetSamples { */ public final class PreRulesGetCountersSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PreRules_getCounters_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PreRules_getCounters_MinimumSet_Gen.json */ /** * Sample code: PreRules_getCounters_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void preRulesGetCountersMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void preRulesGetCountersMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.preRules().getCountersWithResponse("lrs1", "1", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PreRules_getCounters_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PreRules_getCounters_MaximumSet_Gen.json */ /** * Sample code: PreRules_getCounters_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void preRulesGetCountersMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void preRulesGetCountersMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.preRules().getCountersWithResponse("lrs1", "1", "firewall1", com.azure.core.util.Context.NONE); } } @@ -2933,26 +3884,32 @@ public final class PreRulesGetCountersSamples { */ public final class PreRulesListSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PreRules_List_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PreRules_List_MinimumSet_Gen.json */ /** * Sample code: PreRules_List_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void preRulesListMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void + preRulesListMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.preRules().list("lrs1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PreRules_List_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PreRules_List_MaximumSet_Gen.json */ /** * Sample code: PreRules_List_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void preRulesListMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void + preRulesListMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.preRules().list("lrs1", com.azure.core.util.Context.NONE); } } @@ -2966,26 +3923,32 @@ public final class PreRulesListSamples { */ public final class PreRulesRefreshCountersSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PreRules_refreshCounters_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PreRules_refreshCounters_MaximumSet_Gen.json */ /** * Sample code: PreRules_refreshCounters_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void preRulesRefreshCountersMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void preRulesRefreshCountersMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.preRules().refreshCountersWithResponse("lrs1", "1", "firewall1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PreRules_refreshCounters_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PreRules_refreshCounters_MinimumSet_Gen.json */ /** * Sample code: PreRules_refreshCounters_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void preRulesRefreshCountersMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void preRulesRefreshCountersMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.preRules().refreshCountersWithResponse("lrs1", "1", null, com.azure.core.util.Context.NONE); } } @@ -2999,26 +3962,32 @@ public final class PreRulesRefreshCountersSamples { */ public final class PreRulesResetCountersSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PreRules_resetCounters_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PreRules_resetCounters_MinimumSet_Gen.json */ /** * Sample code: PreRules_resetCounters_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void preRulesResetCountersMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void preRulesResetCountersMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.preRules().resetCountersWithResponse("lrs1", "1", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PreRules_resetCounters_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PreRules_resetCounters_MaximumSet_Gen.json */ /** * Sample code: PreRules_resetCounters_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void preRulesResetCountersMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void preRulesResetCountersMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.preRules().resetCountersWithResponse("lrs1", "1", "firewall1", com.azure.core.util.Context.NONE); } } @@ -3035,27 +4004,42 @@ import java.util.Arrays; */ public final class PrefixListGlobalRulestackCreateOrUpdateSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PrefixListGlobalRulestack_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PrefixListGlobalRulestack_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: PrefixListGlobalRulestack_CreateOrUpdate_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void prefixListGlobalRulestackCreateOrUpdateMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.prefixListGlobalRulestacks().createOrUpdate("praval", "armid1", new PrefixListGlobalRulestackResourceInner().withDescription("string").withPrefixList(Arrays.asList("1.0.0.0/24")).withEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c27").withAuditComment("comment"), com.azure.core.util.Context.NONE); + public static void prefixListGlobalRulestackCreateOrUpdateMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.prefixListGlobalRulestacks() + .createOrUpdate("praval", "armid1", + new PrefixListGlobalRulestackResourceInner().withDescription("string") + .withPrefixList(Arrays.asList("1.0.0.0/24")) + .withEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c27") + .withAuditComment("comment"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PrefixListGlobalRulestack_CreateOrUpdate_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PrefixListGlobalRulestack_CreateOrUpdate_MinimumSet_Gen.json */ /** * Sample code: PrefixListGlobalRulestack_CreateOrUpdate_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void prefixListGlobalRulestackCreateOrUpdateMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.prefixListGlobalRulestacks().createOrUpdate("praval", "armid1", new PrefixListGlobalRulestackResourceInner().withPrefixList(Arrays.asList("1.0.0.0/24")), com.azure.core.util.Context.NONE); + public static void prefixListGlobalRulestackCreateOrUpdateMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.prefixListGlobalRulestacks() + .createOrUpdate("praval", "armid1", + new PrefixListGlobalRulestackResourceInner().withPrefixList(Arrays.asList("1.0.0.0/24")), + com.azure.core.util.Context.NONE); } } ``` @@ -3068,26 +4052,32 @@ public final class PrefixListGlobalRulestackCreateOrUpdateSamples { */ public final class PrefixListGlobalRulestackDeleteSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PrefixListGlobalRulestack_Delete_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PrefixListGlobalRulestack_Delete_MaximumSet_Gen.json */ /** * Sample code: PrefixListGlobalRulestack_Delete_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void prefixListGlobalRulestackDeleteMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void prefixListGlobalRulestackDeleteMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.prefixListGlobalRulestacks().delete("praval", "armid1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PrefixListGlobalRulestack_Delete_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PrefixListGlobalRulestack_Delete_MinimumSet_Gen.json */ /** * Sample code: PrefixListGlobalRulestack_Delete_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void prefixListGlobalRulestackDeleteMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void prefixListGlobalRulestackDeleteMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.prefixListGlobalRulestacks().delete("praval", "armid1", com.azure.core.util.Context.NONE); } } @@ -3101,26 +4091,32 @@ public final class PrefixListGlobalRulestackDeleteSamples { */ public final class PrefixListGlobalRulestackGetSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PrefixListGlobalRulestack_Get_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PrefixListGlobalRulestack_Get_MinimumSet_Gen.json */ /** * Sample code: PrefixListGlobalRulestack_Get_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void prefixListGlobalRulestackGetMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void prefixListGlobalRulestackGetMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.prefixListGlobalRulestacks().getWithResponse("praval", "armid1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PrefixListGlobalRulestack_Get_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PrefixListGlobalRulestack_Get_MaximumSet_Gen.json */ /** * Sample code: PrefixListGlobalRulestack_Get_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void prefixListGlobalRulestackGetMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void prefixListGlobalRulestackGetMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.prefixListGlobalRulestacks().getWithResponse("praval", "armid1", com.azure.core.util.Context.NONE); } } @@ -3134,26 +4130,32 @@ public final class PrefixListGlobalRulestackGetSamples { */ public final class PrefixListGlobalRulestackListSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PrefixListGlobalRulestack_List_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PrefixListGlobalRulestack_List_MaximumSet_Gen.json */ /** * Sample code: PrefixListGlobalRulestack_List_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void prefixListGlobalRulestackListMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void prefixListGlobalRulestackListMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.prefixListGlobalRulestacks().list("praval", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PrefixListGlobalRulestack_List_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PrefixListGlobalRulestack_List_MinimumSet_Gen.json */ /** * Sample code: PrefixListGlobalRulestack_List_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void prefixListGlobalRulestackListMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void prefixListGlobalRulestackListMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.prefixListGlobalRulestacks().list("praval", com.azure.core.util.Context.NONE); } } @@ -3169,27 +4171,44 @@ import java.util.Arrays; */ public final class PrefixListLocalRulestackCreateOrUpdateSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PrefixListLocalRulestack_CreateOrUpdate_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PrefixListLocalRulestack_CreateOrUpdate_MinimumSet_Gen.json */ /** * Sample code: PrefixListLocalRulestack_CreateOrUpdate_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void prefixListLocalRulestackCreateOrUpdateMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.prefixListLocalRulestacks().define("armid1").withExistingLocalRulestack("rgopenapi", "lrs1").withPrefixList(Arrays.asList("1.0.0.0/24")).create(); + public static void prefixListLocalRulestackCreateOrUpdateMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.prefixListLocalRulestacks() + .define("armid1") + .withExistingLocalRulestack("rgopenapi", "lrs1") + .withPrefixList(Arrays.asList("1.0.0.0/24")) + .create(); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PrefixListLocalRulestack_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PrefixListLocalRulestack_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: PrefixListLocalRulestack_CreateOrUpdate_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void prefixListLocalRulestackCreateOrUpdateMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.prefixListLocalRulestacks().define("armid1").withExistingLocalRulestack("rgopenapi", "lrs1").withPrefixList(Arrays.asList("1.0.0.0/24")).withDescription("string").withEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c27").withAuditComment("comment").create(); + public static void prefixListLocalRulestackCreateOrUpdateMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.prefixListLocalRulestacks() + .define("armid1") + .withExistingLocalRulestack("rgopenapi", "lrs1") + .withPrefixList(Arrays.asList("1.0.0.0/24")) + .withDescription("string") + .withEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c27") + .withAuditComment("comment") + .create(); } } ``` @@ -3202,26 +4221,32 @@ public final class PrefixListLocalRulestackCreateOrUpdateSamples { */ public final class PrefixListLocalRulestackDeleteSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PrefixListLocalRulestack_Delete_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PrefixListLocalRulestack_Delete_MinimumSet_Gen.json */ /** * Sample code: PrefixListLocalRulestack_Delete_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void prefixListLocalRulestackDeleteMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void prefixListLocalRulestackDeleteMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.prefixListLocalRulestacks().delete("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PrefixListLocalRulestack_Delete_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PrefixListLocalRulestack_Delete_MaximumSet_Gen.json */ /** * Sample code: PrefixListLocalRulestack_Delete_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void prefixListLocalRulestackDeleteMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + public static void prefixListLocalRulestackDeleteMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { manager.prefixListLocalRulestacks().delete("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); } } @@ -3235,27 +4260,35 @@ public final class PrefixListLocalRulestackDeleteSamples { */ public final class PrefixListLocalRulestackGetSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PrefixListLocalRulestack_Get_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PrefixListLocalRulestack_Get_MinimumSet_Gen.json */ /** * Sample code: PrefixListLocalRulestack_Get_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void prefixListLocalRulestackGetMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.prefixListLocalRulestacks().getWithResponse("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); + public static void prefixListLocalRulestackGetMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.prefixListLocalRulestacks() + .getWithResponse("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PrefixListLocalRulestack_Get_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PrefixListLocalRulestack_Get_MaximumSet_Gen.json */ /** * Sample code: PrefixListLocalRulestack_Get_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void prefixListLocalRulestackGetMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.prefixListLocalRulestacks().getWithResponse("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); + public static void prefixListLocalRulestackGetMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.prefixListLocalRulestacks() + .getWithResponse("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); } } ``` @@ -3268,27 +4301,35 @@ public final class PrefixListLocalRulestackGetSamples { */ public final class PrefixListLocalRulestackListByLocalRulestacksSamples { /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PrefixListLocalRulestack_ListByLocalRulestacks_MaximumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PrefixListLocalRulestack_ListByLocalRulestacks_MaximumSet_Gen.json */ /** * Sample code: PrefixListLocalRulestack_ListByLocalRulestacks_MaximumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void prefixListLocalRulestackListByLocalRulestacksMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.prefixListLocalRulestacks().listByLocalRulestacks("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); + public static void prefixListLocalRulestackListByLocalRulestacksMaximumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.prefixListLocalRulestacks() + .listByLocalRulestacks("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/PrefixListLocalRulestack_ListByLocalRulestacks_MinimumSet_Gen.json + * x-ms-original-file: + * specification/paloaltonetworks/resource-manager/PaloAltoNetworks.Cloudngfw/stable/2023-09-01/examples/ + * PrefixListLocalRulestack_ListByLocalRulestacks_MinimumSet_Gen.json */ /** * Sample code: PrefixListLocalRulestack_ListByLocalRulestacks_MinimumSet_Gen. * * @param manager Entry point to PaloAltoNetworksNgfwManager. */ - public static void prefixListLocalRulestackListByLocalRulestacksMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.prefixListLocalRulestacks().listByLocalRulestacks("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); + public static void prefixListLocalRulestackListByLocalRulestacksMinimumSetGen( + com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { + manager.prefixListLocalRulestacks() + .listByLocalRulestacks("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/pom.xml b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/pom.xml index 11e285a6fdc52..00c0ec1aafc15 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/pom.xml +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/pom.xml @@ -14,7 +14,7 @@ com.azure.resourcemanager azure-resourcemanager-paloaltonetworks-ngfw - 1.2.0-beta.1 + 1.2.0 jar Microsoft Azure SDK for PaloAlto Networks Ngfw Management @@ -45,6 +45,7 @@ UTF-8 0 0 + false @@ -81,8 +82,6 @@ 4.11.0 test - - net.bytebuddy byte-buddy diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/PaloAltoNetworksNgfwManager.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/PaloAltoNetworksNgfwManager.java index eac8a634204a3..9feb12a9ebb2b 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/PaloAltoNetworksNgfwManager.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/PaloAltoNetworksNgfwManager.java @@ -11,6 +11,7 @@ import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -19,7 +20,6 @@ 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; @@ -256,7 +256,7 @@ public PaloAltoNetworksNgfwManager authenticate(TokenCredential credential, Azur .append("-") .append("com.azure.resourcemanager.paloaltonetworks.ngfw") .append("/") - .append("1.1.0"); + .append("1.2.0"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -289,7 +289,7 @@ public PaloAltoNetworksNgfwManager authenticate(TokenCredential credential, Azur 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, scopes.toArray(new String[0]))); policies.addAll(this.policies.stream() .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) .collect(Collectors.toList())); diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/FirewallsClient.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/FirewallsClient.java index 9cf104738a0c9..9f9b9e47fbc3f 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/FirewallsClient.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/FirewallsClient.java @@ -329,7 +329,7 @@ Response getSupportInfoWithResponse(String resourceGroupName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param firewallName Firewall resource name. - * @param logSettings Log Settings for Firewall. + * @param logSettings The logSettings parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/AdvSecurityObjectListResponseInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/AdvSecurityObjectListResponseInner.java index d7ceaba17c911..501b95e339dec 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/AdvSecurityObjectListResponseInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/AdvSecurityObjectListResponseInner.java @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.AdvSecurityObjectModel; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * advanced security object. */ @Fluent -public final class AdvSecurityObjectListResponseInner { +public final class AdvSecurityObjectListResponseInner implements JsonSerializable { /* * response value */ - @JsonProperty(value = "value", required = true) private AdvSecurityObjectModel value; /* * next link */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -79,12 +81,54 @@ public AdvSecurityObjectListResponseInner withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property value in model AdvSecurityObjectListResponseInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model AdvSecurityObjectListResponseInner")); } else { value().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(AdvSecurityObjectListResponseInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("value", this.value); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdvSecurityObjectListResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdvSecurityObjectListResponseInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AdvSecurityObjectListResponseInner. + */ + public static AdvSecurityObjectListResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdvSecurityObjectListResponseInner deserializedAdvSecurityObjectListResponseInner + = new AdvSecurityObjectListResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedAdvSecurityObjectListResponseInner.value = AdvSecurityObjectModel.fromJson(reader); + } else if ("nextLink".equals(fieldName)) { + deserializedAdvSecurityObjectListResponseInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAdvSecurityObjectListResponseInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/CertificateObject.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/CertificateObject.java index 523542ae1a9cf..aa46d40b7f1b7 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/CertificateObject.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/CertificateObject.java @@ -6,49 +6,47 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * certificate used for inbound and outbound decryption. */ @Fluent -public final class CertificateObject { +public final class CertificateObject implements JsonSerializable { /* * Resource Id of certificate signer, to be populated only when certificateSelfSigned is false */ - @JsonProperty(value = "certificateSignerResourceId") private String certificateSignerResourceId; /* * use certificate self signed */ - @JsonProperty(value = "certificateSelfSigned", required = true) private BooleanEnum certificateSelfSigned; /* * comment for this object */ - @JsonProperty(value = "auditComment") private String auditComment; /* * user description for this object */ - @JsonProperty(value = "description") private String description; /* * read only string representing last create or update */ - @JsonProperty(value = "etag") private String etag; /* * Provisioning state of the resource. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /** @@ -175,10 +173,63 @@ public ProvisioningState provisioningState() { */ public void validate() { if (certificateSelfSigned() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property certificateSelfSigned in model CertificateObject")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property certificateSelfSigned in model CertificateObject")); } } private static final ClientLogger LOGGER = new ClientLogger(CertificateObject.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("certificateSelfSigned", + this.certificateSelfSigned == null ? null : this.certificateSelfSigned.toString()); + jsonWriter.writeStringField("certificateSignerResourceId", this.certificateSignerResourceId); + jsonWriter.writeStringField("auditComment", this.auditComment); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CertificateObject from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CertificateObject if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CertificateObject. + */ + public static CertificateObject fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CertificateObject deserializedCertificateObject = new CertificateObject(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("certificateSelfSigned".equals(fieldName)) { + deserializedCertificateObject.certificateSelfSigned = BooleanEnum.fromString(reader.getString()); + } else if ("certificateSignerResourceId".equals(fieldName)) { + deserializedCertificateObject.certificateSignerResourceId = reader.getString(); + } else if ("auditComment".equals(fieldName)) { + deserializedCertificateObject.auditComment = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedCertificateObject.description = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedCertificateObject.etag = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedCertificateObject.provisioningState = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCertificateObject; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/CertificateObjectGlobalRulestackResourceInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/CertificateObjectGlobalRulestackResourceInner.java index 65040d7386be4..7296c806ec5bc 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/CertificateObjectGlobalRulestackResourceInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/CertificateObjectGlobalRulestackResourceInner.java @@ -8,9 +8,12 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * GlobalRulestack Certificate Object. @@ -20,15 +23,28 @@ public final class CertificateObjectGlobalRulestackResourceInner extends ProxyRe /* * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties", required = true) private CertificateObject innerProperties = new CertificateObject(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of CertificateObjectGlobalRulestackResourceInner class. */ @@ -53,6 +69,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the certificateSignerResourceId property: Resource Id of certificate signer, to be populated only when * certificateSelfSigned is false. @@ -187,12 +233,60 @@ public ProvisioningState provisioningState() { */ public void validate() { if (innerProperties() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property innerProperties in model CertificateObjectGlobalRulestackResourceInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model CertificateObjectGlobalRulestackResourceInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(CertificateObjectGlobalRulestackResourceInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CertificateObjectGlobalRulestackResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CertificateObjectGlobalRulestackResourceInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CertificateObjectGlobalRulestackResourceInner. + */ + public static CertificateObjectGlobalRulestackResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CertificateObjectGlobalRulestackResourceInner deserializedCertificateObjectGlobalRulestackResourceInner + = new CertificateObjectGlobalRulestackResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCertificateObjectGlobalRulestackResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCertificateObjectGlobalRulestackResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCertificateObjectGlobalRulestackResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedCertificateObjectGlobalRulestackResourceInner.innerProperties + = CertificateObject.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCertificateObjectGlobalRulestackResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCertificateObjectGlobalRulestackResourceInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/CertificateObjectLocalRulestackResourceInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/CertificateObjectLocalRulestackResourceInner.java index 1236e1b335886..8ab06b6cb94ba 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/CertificateObjectLocalRulestackResourceInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/CertificateObjectLocalRulestackResourceInner.java @@ -8,9 +8,12 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * LocalRulestack Certificate Object. @@ -20,15 +23,28 @@ public final class CertificateObjectLocalRulestackResourceInner extends ProxyRes /* * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties", required = true) private CertificateObject innerProperties = new CertificateObject(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of CertificateObjectLocalRulestackResourceInner class. */ @@ -53,6 +69,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the certificateSignerResourceId property: Resource Id of certificate signer, to be populated only when * certificateSelfSigned is false. @@ -187,12 +233,60 @@ public ProvisioningState provisioningState() { */ public void validate() { if (innerProperties() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property innerProperties in model CertificateObjectLocalRulestackResourceInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model CertificateObjectLocalRulestackResourceInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(CertificateObjectLocalRulestackResourceInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CertificateObjectLocalRulestackResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CertificateObjectLocalRulestackResourceInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CertificateObjectLocalRulestackResourceInner. + */ + public static CertificateObjectLocalRulestackResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CertificateObjectLocalRulestackResourceInner deserializedCertificateObjectLocalRulestackResourceInner + = new CertificateObjectLocalRulestackResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCertificateObjectLocalRulestackResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCertificateObjectLocalRulestackResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCertificateObjectLocalRulestackResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedCertificateObjectLocalRulestackResourceInner.innerProperties + = CertificateObject.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCertificateObjectLocalRulestackResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCertificateObjectLocalRulestackResourceInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/ChangelogInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/ChangelogInner.java index 441a91745f120..8b86e7280e015 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/ChangelogInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/ChangelogInner.java @@ -5,32 +5,35 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** * Changelog list. */ @Fluent -public final class ChangelogInner { +public final class ChangelogInner implements JsonSerializable { /* * list of changes */ - @JsonProperty(value = "changes", required = true) private List changes; /* * lastCommitted timestamp */ - @JsonProperty(value = "lastCommitted") private OffsetDateTime lastCommitted; /* * lastModified timestamp */ - @JsonProperty(value = "lastModified") private OffsetDateTime lastModified; /** @@ -106,10 +109,58 @@ public ChangelogInner withLastModified(OffsetDateTime lastModified) { */ public void validate() { if (changes() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property changes in model ChangelogInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property changes in model ChangelogInner")); } } private static final ClientLogger LOGGER = new ClientLogger(ChangelogInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("changes", this.changes, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("lastCommitted", + this.lastCommitted == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastCommitted)); + jsonWriter.writeStringField("lastModified", + this.lastModified == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModified)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChangelogInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChangelogInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ChangelogInner. + */ + public static ChangelogInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChangelogInner deserializedChangelogInner = new ChangelogInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("changes".equals(fieldName)) { + List changes = reader.readArray(reader1 -> reader1.getString()); + deserializedChangelogInner.changes = changes; + } else if ("lastCommitted".equals(fieldName)) { + deserializedChangelogInner.lastCommitted = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModified".equals(fieldName)) { + deserializedChangelogInner.lastModified = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedChangelogInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/CountriesResponseInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/CountriesResponseInner.java index 7d293299a6e68..dbcc12cd6bbe0 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/CountriesResponseInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/CountriesResponseInner.java @@ -6,25 +6,27 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.Country; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Countries Response Object. */ @Fluent -public final class CountriesResponseInner { +public final class CountriesResponseInner implements JsonSerializable { /* * List of countries */ - @JsonProperty(value = "value", required = true) private List value; /* * next link */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,53 @@ public CountriesResponseInner withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model CountriesResponseInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model CountriesResponseInner")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(CountriesResponseInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CountriesResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CountriesResponseInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CountriesResponseInner. + */ + public static CountriesResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CountriesResponseInner deserializedCountriesResponseInner = new CountriesResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> Country.fromJson(reader1)); + deserializedCountriesResponseInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCountriesResponseInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCountriesResponseInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FirewallDeploymentProperties.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FirewallDeploymentProperties.java index 8dd56edbcbf00..07933a0fffa9c 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FirewallDeploymentProperties.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FirewallDeploymentProperties.java @@ -6,6 +6,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.DnsSettings; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.FrontendSetting; @@ -15,72 +19,62 @@ import com.azure.resourcemanager.paloaltonetworks.ngfw.models.PlanData; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ProvisioningState; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.RulestackDetails; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Properties specific to the Firewall resource deployment. */ @Fluent -public final class FirewallDeploymentProperties { +public final class FirewallDeploymentProperties implements JsonSerializable { /* * panEtag info */ - @JsonProperty(value = "panEtag") private String panEtag; /* * Network settings */ - @JsonProperty(value = "networkProfile", required = true) private NetworkProfile networkProfile; /* * Panorama Managed: Default is False. Default will be CloudSec managed */ - @JsonProperty(value = "isPanoramaManaged") private BooleanEnum isPanoramaManaged; /* * Panorama Configuration */ - @JsonProperty(value = "panoramaConfig") private PanoramaConfig panoramaConfig; /* * Associated Rulestack */ - @JsonProperty(value = "associatedRulestack") private RulestackDetails associatedRulestack; /* * DNS settings for Firewall */ - @JsonProperty(value = "dnsSettings", required = true) private DnsSettings dnsSettings; /* * Frontend settings for Firewall */ - @JsonProperty(value = "frontEndSettings") private List frontEndSettings; /* * Provisioning state of the resource. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /* * Billing plan information. */ - @JsonProperty(value = "planData", required = true) private PlanData planData; /* * Marketplace details */ - @JsonProperty(value = "marketplaceDetails", required = true) private MarketplaceDetails marketplaceDetails; /** @@ -285,8 +279,9 @@ public FirewallDeploymentProperties withMarketplaceDetails(MarketplaceDetails ma */ public void validate() { if (networkProfile() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property networkProfile in model FirewallDeploymentProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property networkProfile in model FirewallDeploymentProperties")); } else { networkProfile().validate(); } @@ -297,8 +292,9 @@ public void validate() { associatedRulestack().validate(); } if (dnsSettings() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property dnsSettings in model FirewallDeploymentProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dnsSettings in model FirewallDeploymentProperties")); } else { dnsSettings().validate(); } @@ -306,18 +302,89 @@ public void validate() { frontEndSettings().forEach(e -> e.validate()); } if (planData() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property planData in model FirewallDeploymentProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property planData in model FirewallDeploymentProperties")); } else { planData().validate(); } if (marketplaceDetails() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property marketplaceDetails in model FirewallDeploymentProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property marketplaceDetails in model FirewallDeploymentProperties")); } else { marketplaceDetails().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(FirewallDeploymentProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("networkProfile", this.networkProfile); + jsonWriter.writeJsonField("dnsSettings", this.dnsSettings); + jsonWriter.writeJsonField("planData", this.planData); + jsonWriter.writeJsonField("marketplaceDetails", this.marketplaceDetails); + jsonWriter.writeStringField("panEtag", this.panEtag); + jsonWriter.writeStringField("isPanoramaManaged", + this.isPanoramaManaged == null ? null : this.isPanoramaManaged.toString()); + jsonWriter.writeJsonField("panoramaConfig", this.panoramaConfig); + jsonWriter.writeJsonField("associatedRulestack", this.associatedRulestack); + jsonWriter.writeArrayField("frontEndSettings", this.frontEndSettings, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallDeploymentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallDeploymentProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FirewallDeploymentProperties. + */ + public static FirewallDeploymentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallDeploymentProperties deserializedFirewallDeploymentProperties = new FirewallDeploymentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkProfile".equals(fieldName)) { + deserializedFirewallDeploymentProperties.networkProfile = NetworkProfile.fromJson(reader); + } else if ("dnsSettings".equals(fieldName)) { + deserializedFirewallDeploymentProperties.dnsSettings = DnsSettings.fromJson(reader); + } else if ("planData".equals(fieldName)) { + deserializedFirewallDeploymentProperties.planData = PlanData.fromJson(reader); + } else if ("marketplaceDetails".equals(fieldName)) { + deserializedFirewallDeploymentProperties.marketplaceDetails = MarketplaceDetails.fromJson(reader); + } else if ("panEtag".equals(fieldName)) { + deserializedFirewallDeploymentProperties.panEtag = reader.getString(); + } else if ("isPanoramaManaged".equals(fieldName)) { + deserializedFirewallDeploymentProperties.isPanoramaManaged + = BooleanEnum.fromString(reader.getString()); + } else if ("panoramaConfig".equals(fieldName)) { + deserializedFirewallDeploymentProperties.panoramaConfig = PanoramaConfig.fromJson(reader); + } else if ("associatedRulestack".equals(fieldName)) { + deserializedFirewallDeploymentProperties.associatedRulestack = RulestackDetails.fromJson(reader); + } else if ("frontEndSettings".equals(fieldName)) { + List frontEndSettings + = reader.readArray(reader1 -> FrontendSetting.fromJson(reader1)); + deserializedFirewallDeploymentProperties.frontEndSettings = frontEndSettings; + } else if ("provisioningState".equals(fieldName)) { + deserializedFirewallDeploymentProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallDeploymentProperties; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FirewallResourceInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FirewallResourceInner.java index 2dd90716bcda6..eade02126846b 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FirewallResourceInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FirewallResourceInner.java @@ -8,6 +8,9 @@ import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.AzureResourceManagerManagedIdentityProperties; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.DnsSettings; @@ -18,7 +21,7 @@ import com.azure.resourcemanager.paloaltonetworks.ngfw.models.PlanData; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ProvisioningState; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.RulestackDetails; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -30,21 +33,33 @@ public final class FirewallResourceInner extends Resource { /* * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties", required = true) private FirewallDeploymentProperties innerProperties = new FirewallDeploymentProperties(); /* * The managed service identities assigned to this resource. */ - @JsonProperty(value = "identity") private AzureResourceManagerManagedIdentityProperties identity; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of FirewallResourceInner class. */ @@ -89,6 +104,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * {@inheritDoc} */ @@ -330,8 +375,9 @@ public FirewallResourceInner withMarketplaceDetails(MarketplaceDetails marketpla */ public void validate() { if (innerProperties() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property innerProperties in model FirewallResourceInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model FirewallResourceInner")); } else { innerProperties().validate(); } @@ -341,4 +387,60 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(FirewallResourceInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallResourceInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FirewallResourceInner. + */ + public static FirewallResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallResourceInner deserializedFirewallResourceInner = new FirewallResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFirewallResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFirewallResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFirewallResourceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedFirewallResourceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedFirewallResourceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedFirewallResourceInner.innerProperties = FirewallDeploymentProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedFirewallResourceInner.identity + = AzureResourceManagerManagedIdentityProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedFirewallResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallResourceInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FirewallStatusProperty.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FirewallStatusProperty.java index efdcc91b801ea..057a0d23964b8 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FirewallStatusProperty.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FirewallStatusProperty.java @@ -5,45 +5,44 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.HealthStatus; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.PanoramaStatus; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ReadOnlyProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Firewall Status. */ @Immutable -public final class FirewallStatusProperty { +public final class FirewallStatusProperty implements JsonSerializable { /* * Panorama Managed: Default is False. Default will be CloudSec managed */ - @JsonProperty(value = "isPanoramaManaged", access = JsonProperty.Access.WRITE_ONLY) private BooleanEnum isPanoramaManaged; /* * Current status of the Firewall */ - @JsonProperty(value = "healthStatus", access = JsonProperty.Access.WRITE_ONLY) private HealthStatus healthStatus; /* * Detail description of current health of the Firewall */ - @JsonProperty(value = "healthReason", access = JsonProperty.Access.WRITE_ONLY) private String healthReason; /* * Panorama Status */ - @JsonProperty(value = "panoramaStatus", access = JsonProperty.Access.WRITE_ONLY) private PanoramaStatus panoramaStatus; /* * Provisioning state of the resource. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ReadOnlyProvisioningState provisioningState; /** @@ -107,4 +106,48 @@ public void validate() { panoramaStatus().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallStatusProperty from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallStatusProperty if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallStatusProperty. + */ + public static FirewallStatusProperty fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallStatusProperty deserializedFirewallStatusProperty = new FirewallStatusProperty(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isPanoramaManaged".equals(fieldName)) { + deserializedFirewallStatusProperty.isPanoramaManaged = BooleanEnum.fromString(reader.getString()); + } else if ("healthStatus".equals(fieldName)) { + deserializedFirewallStatusProperty.healthStatus = HealthStatus.fromString(reader.getString()); + } else if ("healthReason".equals(fieldName)) { + deserializedFirewallStatusProperty.healthReason = reader.getString(); + } else if ("panoramaStatus".equals(fieldName)) { + deserializedFirewallStatusProperty.panoramaStatus = PanoramaStatus.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedFirewallStatusProperty.provisioningState + = ReadOnlyProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallStatusProperty; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FirewallStatusResourceInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FirewallStatusResourceInner.java index 4ff1ecc252732..df2f9deb3163c 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FirewallStatusResourceInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FirewallStatusResourceInner.java @@ -8,11 +8,14 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.HealthStatus; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.PanoramaStatus; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ReadOnlyProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Firewall Status. @@ -22,15 +25,28 @@ public final class FirewallStatusResourceInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties", required = true) private FirewallStatusProperty innerProperties = new FirewallStatusProperty(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of FirewallStatusResourceInner class. */ @@ -55,6 +71,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the isPanoramaManaged property: Panorama Managed: Default is False. Default will be CloudSec managed. * @@ -107,12 +153,58 @@ public ReadOnlyProvisioningState provisioningState() { */ public void validate() { if (innerProperties() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property innerProperties in model FirewallStatusResourceInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model FirewallStatusResourceInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(FirewallStatusResourceInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallStatusResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallStatusResourceInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FirewallStatusResourceInner. + */ + public static FirewallStatusResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallStatusResourceInner deserializedFirewallStatusResourceInner = new FirewallStatusResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFirewallStatusResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFirewallStatusResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFirewallStatusResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFirewallStatusResourceInner.innerProperties = FirewallStatusProperty.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedFirewallStatusResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallStatusResourceInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FqdnListGlobalRulestackResourceInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FqdnListGlobalRulestackResourceInner.java index 0c8a0c813e796..ec7b7751013ef 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FqdnListGlobalRulestackResourceInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FqdnListGlobalRulestackResourceInner.java @@ -8,8 +8,11 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -20,15 +23,28 @@ public final class FqdnListGlobalRulestackResourceInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties", required = true) private FqdnObject innerProperties = new FqdnObject(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of FqdnListGlobalRulestackResourceInner class. */ @@ -53,6 +69,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the description property: fqdn object description. * @@ -161,12 +207,59 @@ public ProvisioningState provisioningState() { */ public void validate() { if (innerProperties() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property innerProperties in model FqdnListGlobalRulestackResourceInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model FqdnListGlobalRulestackResourceInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(FqdnListGlobalRulestackResourceInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FqdnListGlobalRulestackResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FqdnListGlobalRulestackResourceInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FqdnListGlobalRulestackResourceInner. + */ + public static FqdnListGlobalRulestackResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FqdnListGlobalRulestackResourceInner deserializedFqdnListGlobalRulestackResourceInner + = new FqdnListGlobalRulestackResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFqdnListGlobalRulestackResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFqdnListGlobalRulestackResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFqdnListGlobalRulestackResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFqdnListGlobalRulestackResourceInner.innerProperties = FqdnObject.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedFqdnListGlobalRulestackResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFqdnListGlobalRulestackResourceInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FqdnListLocalRulestackResourceInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FqdnListLocalRulestackResourceInner.java index b7a0dbabbc918..6165608fe2dd1 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FqdnListLocalRulestackResourceInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FqdnListLocalRulestackResourceInner.java @@ -8,8 +8,11 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -20,15 +23,28 @@ public final class FqdnListLocalRulestackResourceInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties", required = true) private FqdnObject innerProperties = new FqdnObject(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of FqdnListLocalRulestackResourceInner class. */ @@ -53,6 +69,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the description property: fqdn object description. * @@ -161,12 +207,59 @@ public ProvisioningState provisioningState() { */ public void validate() { if (innerProperties() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property innerProperties in model FqdnListLocalRulestackResourceInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model FqdnListLocalRulestackResourceInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(FqdnListLocalRulestackResourceInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FqdnListLocalRulestackResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FqdnListLocalRulestackResourceInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FqdnListLocalRulestackResourceInner. + */ + public static FqdnListLocalRulestackResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FqdnListLocalRulestackResourceInner deserializedFqdnListLocalRulestackResourceInner + = new FqdnListLocalRulestackResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFqdnListLocalRulestackResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFqdnListLocalRulestackResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFqdnListLocalRulestackResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFqdnListLocalRulestackResourceInner.innerProperties = FqdnObject.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedFqdnListLocalRulestackResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFqdnListLocalRulestackResourceInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FqdnObject.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FqdnObject.java index b83072d040242..381b5bbe35c10 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FqdnObject.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/FqdnObject.java @@ -6,43 +6,42 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * fqdn object. */ @Fluent -public final class FqdnObject { +public final class FqdnObject implements JsonSerializable { /* * fqdn object description */ - @JsonProperty(value = "description") private String description; /* * fqdn list */ - @JsonProperty(value = "fqdnList", required = true) private List fqdnList; /* * etag info */ - @JsonProperty(value = "etag") private String etag; /* * comment for this object */ - @JsonProperty(value = "auditComment") private String auditComment; /* * Provisioning state of the resource. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /** @@ -147,10 +146,59 @@ public ProvisioningState provisioningState() { */ public void validate() { if (fqdnList() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property fqdnList in model FqdnObject")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property fqdnList in model FqdnObject")); } } private static final ClientLogger LOGGER = new ClientLogger(FqdnObject.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("fqdnList", this.fqdnList, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("etag", this.etag); + jsonWriter.writeStringField("auditComment", this.auditComment); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FqdnObject from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FqdnObject if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FqdnObject. + */ + public static FqdnObject fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FqdnObject deserializedFqdnObject = new FqdnObject(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fqdnList".equals(fieldName)) { + List fqdnList = reader.readArray(reader1 -> reader1.getString()); + deserializedFqdnObject.fqdnList = fqdnList; + } else if ("description".equals(fieldName)) { + deserializedFqdnObject.description = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedFqdnObject.etag = reader.getString(); + } else if ("auditComment".equals(fieldName)) { + deserializedFqdnObject.auditComment = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedFqdnObject.provisioningState = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFqdnObject; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/GlobalRulestackInfoInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/GlobalRulestackInfoInner.java index 343fb260d63c3..2f54dafffe7d6 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/GlobalRulestackInfoInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/GlobalRulestackInfoInner.java @@ -6,17 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * PAN Rulestack Describe Object. */ @Fluent -public final class GlobalRulestackInfoInner { +public final class GlobalRulestackInfoInner implements JsonSerializable { /* * rulestack description */ - @JsonProperty(value = "azureId", required = true) private String azureId; /** @@ -52,10 +55,48 @@ public GlobalRulestackInfoInner withAzureId(String azureId) { */ public void validate() { if (azureId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property azureId in model GlobalRulestackInfoInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property azureId in model GlobalRulestackInfoInner")); } } private static final ClientLogger LOGGER = new ClientLogger(GlobalRulestackInfoInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("azureId", this.azureId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GlobalRulestackInfoInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GlobalRulestackInfoInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GlobalRulestackInfoInner. + */ + public static GlobalRulestackInfoInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GlobalRulestackInfoInner deserializedGlobalRulestackInfoInner = new GlobalRulestackInfoInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureId".equals(fieldName)) { + deserializedGlobalRulestackInfoInner.azureId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGlobalRulestackInfoInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/GlobalRulestackResourceInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/GlobalRulestackResourceInner.java index e3ad35ae98a20..daac76bb0a22f 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/GlobalRulestackResourceInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/GlobalRulestackResourceInner.java @@ -8,12 +8,15 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.AzureResourceManagerManagedIdentityProperties; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.DefaultMode; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ProvisioningState; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ScopeType; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SecurityServices; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -24,27 +27,38 @@ public final class GlobalRulestackResourceInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties", required = true) private RulestackProperties innerProperties = new RulestackProperties(); /* * Global Location */ - @JsonProperty(value = "location", required = true) private String location; /* * The managed service identities assigned to this resource. */ - @JsonProperty(value = "identity") private AzureResourceManagerManagedIdentityProperties identity; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of GlobalRulestackResourceInner class. */ @@ -109,6 +123,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the panEtag property: PanEtag info. * @@ -309,14 +353,16 @@ public GlobalRulestackResourceInner withSecurityServices(SecurityServices securi */ public void validate() { if (innerProperties() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property innerProperties in model GlobalRulestackResourceInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model GlobalRulestackResourceInner")); } else { innerProperties().validate(); } if (location() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property location in model GlobalRulestackResourceInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property location in model GlobalRulestackResourceInner")); } if (identity() != null) { identity().validate(); @@ -324,4 +370,56 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(GlobalRulestackResourceInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GlobalRulestackResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GlobalRulestackResourceInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GlobalRulestackResourceInner. + */ + public static GlobalRulestackResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GlobalRulestackResourceInner deserializedGlobalRulestackResourceInner = new GlobalRulestackResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGlobalRulestackResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedGlobalRulestackResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedGlobalRulestackResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedGlobalRulestackResourceInner.innerProperties = RulestackProperties.fromJson(reader); + } else if ("location".equals(fieldName)) { + deserializedGlobalRulestackResourceInner.location = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedGlobalRulestackResourceInner.identity + = AzureResourceManagerManagedIdentityProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedGlobalRulestackResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGlobalRulestackResourceInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/ListAppIdResponseInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/ListAppIdResponseInner.java index 62fc1a9666284..d554117cf7920 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/ListAppIdResponseInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/ListAppIdResponseInner.java @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * The ListAppIdResponse model. */ @Fluent -public final class ListAppIdResponseInner { +public final class ListAppIdResponseInner implements JsonSerializable { /* * List of AppIds */ - @JsonProperty(value = "value", required = true) private List value; /* * next Link */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -79,10 +81,51 @@ public ListAppIdResponseInner withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ListAppIdResponseInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ListAppIdResponseInner")); } } private static final ClientLogger LOGGER = new ClientLogger(ListAppIdResponseInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListAppIdResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListAppIdResponseInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ListAppIdResponseInner. + */ + public static ListAppIdResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListAppIdResponseInner deserializedListAppIdResponseInner = new ListAppIdResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> reader1.getString()); + deserializedListAppIdResponseInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListAppIdResponseInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListAppIdResponseInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/ListFirewallsResponseInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/ListFirewallsResponseInner.java index 44deb4c7a9753..8ecf102c7b7f3 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/ListFirewallsResponseInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/ListFirewallsResponseInner.java @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * List firewalls response. */ @Fluent -public final class ListFirewallsResponseInner { +public final class ListFirewallsResponseInner implements JsonSerializable { /* * firewalls list */ - @JsonProperty(value = "value", required = true) private List value; /* * next link */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -79,10 +81,52 @@ public ListFirewallsResponseInner withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ListFirewallsResponseInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ListFirewallsResponseInner")); } } private static final ClientLogger LOGGER = new ClientLogger(ListFirewallsResponseInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListFirewallsResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListFirewallsResponseInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ListFirewallsResponseInner. + */ + public static ListFirewallsResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListFirewallsResponseInner deserializedListFirewallsResponseInner = new ListFirewallsResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> reader1.getString()); + deserializedListFirewallsResponseInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListFirewallsResponseInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListFirewallsResponseInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/LocalRulesResourceInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/LocalRulesResourceInner.java index 84043918b77fd..8b4a827cd0699 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/LocalRulesResourceInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/LocalRulesResourceInner.java @@ -8,6 +8,9 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ActionEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.Category; @@ -17,7 +20,7 @@ import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SourceAddr; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.StateEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.TagInfo; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -28,15 +31,28 @@ public final class LocalRulesResourceInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties", required = true) private RuleEntry innerProperties = new RuleEntry(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of LocalRulesResourceInner class. */ @@ -61,6 +77,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the etag property: etag info. * @@ -500,12 +546,58 @@ public ProvisioningState provisioningState() { */ public void validate() { if (innerProperties() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property innerProperties in model LocalRulesResourceInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model LocalRulesResourceInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(LocalRulesResourceInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LocalRulesResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocalRulesResourceInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LocalRulesResourceInner. + */ + public static LocalRulesResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocalRulesResourceInner deserializedLocalRulesResourceInner = new LocalRulesResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLocalRulesResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLocalRulesResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLocalRulesResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedLocalRulesResourceInner.innerProperties = RuleEntry.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLocalRulesResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLocalRulesResourceInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/LocalRulestackResourceInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/LocalRulestackResourceInner.java index c61b34c19d3fe..2c3951ef655df 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/LocalRulestackResourceInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/LocalRulestackResourceInner.java @@ -8,12 +8,15 @@ import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.AzureResourceManagerManagedIdentityProperties; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.DefaultMode; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ProvisioningState; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ScopeType; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SecurityServices; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -25,21 +28,33 @@ public final class LocalRulestackResourceInner extends Resource { /* * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties", required = true) private RulestackProperties innerProperties = new RulestackProperties(); /* * The managed service identities assigned to this resource. */ - @JsonProperty(value = "identity") private AzureResourceManagerManagedIdentityProperties identity; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of LocalRulestackResourceInner class. */ @@ -84,6 +99,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * {@inheritDoc} */ @@ -302,8 +347,9 @@ public LocalRulestackResourceInner withSecurityServices(SecurityServices securit */ public void validate() { if (innerProperties() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property innerProperties in model LocalRulestackResourceInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model LocalRulestackResourceInner")); } else { innerProperties().validate(); } @@ -313,4 +359,60 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(LocalRulestackResourceInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LocalRulestackResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocalRulestackResourceInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LocalRulestackResourceInner. + */ + public static LocalRulestackResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocalRulestackResourceInner deserializedLocalRulestackResourceInner = new LocalRulestackResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLocalRulestackResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLocalRulestackResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLocalRulestackResourceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedLocalRulestackResourceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLocalRulestackResourceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedLocalRulestackResourceInner.innerProperties = RulestackProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedLocalRulestackResourceInner.identity + = AzureResourceManagerManagedIdentityProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLocalRulestackResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLocalRulestackResourceInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/LogSettingsInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/LogSettingsInner.java index 6b54218e84d42..0502c8ce3cca0 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/LogSettingsInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/LogSettingsInner.java @@ -5,57 +5,54 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ApplicationInsights; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.LogDestination; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.LogOption; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.LogType; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Log Settings for Firewall. */ @Fluent -public final class LogSettingsInner { +public final class LogSettingsInner implements JsonSerializable { /* * One of possible log type */ - @JsonProperty(value = "logType") private LogType logType; /* * Log option SAME/INDIVIDUAL */ - @JsonProperty(value = "logOption") private LogOption logOption; /* * Application Insight details */ - @JsonProperty(value = "applicationInsights") private ApplicationInsights applicationInsights; /* * Common destination configurations */ - @JsonProperty(value = "commonDestination") private LogDestination commonDestination; /* * Traffic destination configurations */ - @JsonProperty(value = "trafficLogDestination") private LogDestination trafficLogDestination; /* * Threat destination configurations */ - @JsonProperty(value = "threatLogDestination") private LogDestination threatLogDestination; /* * Decrypt destination configurations */ - @JsonProperty(value = "decryptLogDestination") private LogDestination decryptLogDestination; /** @@ -226,4 +223,58 @@ public void validate() { decryptLogDestination().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("logType", this.logType == null ? null : this.logType.toString()); + jsonWriter.writeStringField("logOption", this.logOption == null ? null : this.logOption.toString()); + jsonWriter.writeJsonField("applicationInsights", this.applicationInsights); + jsonWriter.writeJsonField("commonDestination", this.commonDestination); + jsonWriter.writeJsonField("trafficLogDestination", this.trafficLogDestination); + jsonWriter.writeJsonField("threatLogDestination", this.threatLogDestination); + jsonWriter.writeJsonField("decryptLogDestination", this.decryptLogDestination); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogSettingsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogSettingsInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LogSettingsInner. + */ + public static LogSettingsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogSettingsInner deserializedLogSettingsInner = new LogSettingsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logType".equals(fieldName)) { + deserializedLogSettingsInner.logType = LogType.fromString(reader.getString()); + } else if ("logOption".equals(fieldName)) { + deserializedLogSettingsInner.logOption = LogOption.fromString(reader.getString()); + } else if ("applicationInsights".equals(fieldName)) { + deserializedLogSettingsInner.applicationInsights = ApplicationInsights.fromJson(reader); + } else if ("commonDestination".equals(fieldName)) { + deserializedLogSettingsInner.commonDestination = LogDestination.fromJson(reader); + } else if ("trafficLogDestination".equals(fieldName)) { + deserializedLogSettingsInner.trafficLogDestination = LogDestination.fromJson(reader); + } else if ("threatLogDestination".equals(fieldName)) { + deserializedLogSettingsInner.threatLogDestination = LogDestination.fromJson(reader); + } else if ("decryptLogDestination".equals(fieldName)) { + deserializedLogSettingsInner.decryptLogDestination = LogDestination.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLogSettingsInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/OperationInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/OperationInner.java index d9fb05ac8dffc..ba6008d73f624 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/OperationInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/OperationInner.java @@ -5,10 +5,14 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ActionType; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.OperationDisplay; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.Origin; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * REST API Operation @@ -16,38 +20,33 @@ * Details of a REST API operation, returned from the Resource Provider Operations API. */ @Fluent -public final class OperationInner { +public final class OperationInner implements JsonSerializable { /* * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for * ARM/control-plane operations. */ - @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) private Boolean isDataAction; /* * Localized display information for this particular operation. */ - @JsonProperty(value = "display") private OperationDisplay display; /* * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default * value is "user,system" */ - @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) private Origin origin; /* * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ - @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) private ActionType actionType; /** @@ -126,4 +125,48 @@ public void validate() { display().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PostRulesResourceInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PostRulesResourceInner.java index 2f17df72a6565..d5d1f2a3445da 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PostRulesResourceInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PostRulesResourceInner.java @@ -8,6 +8,9 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ActionEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.Category; @@ -17,7 +20,7 @@ import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SourceAddr; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.StateEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.TagInfo; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -28,15 +31,28 @@ public final class PostRulesResourceInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties", required = true) private RuleEntry innerProperties = new RuleEntry(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of PostRulesResourceInner class. */ @@ -61,6 +77,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the etag property: etag info. * @@ -500,12 +546,58 @@ public ProvisioningState provisioningState() { */ public void validate() { if (innerProperties() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property innerProperties in model PostRulesResourceInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model PostRulesResourceInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(PostRulesResourceInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PostRulesResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PostRulesResourceInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PostRulesResourceInner. + */ + public static PostRulesResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PostRulesResourceInner deserializedPostRulesResourceInner = new PostRulesResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPostRulesResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPostRulesResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPostRulesResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPostRulesResourceInner.innerProperties = RuleEntry.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPostRulesResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPostRulesResourceInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PreRulesResourceInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PreRulesResourceInner.java index f7b7975b2fe17..ab4763c65cfab 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PreRulesResourceInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PreRulesResourceInner.java @@ -8,6 +8,9 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ActionEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.Category; @@ -17,7 +20,7 @@ import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SourceAddr; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.StateEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.TagInfo; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -28,15 +31,28 @@ public final class PreRulesResourceInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties", required = true) private RuleEntry innerProperties = new RuleEntry(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of PreRulesResourceInner class. */ @@ -61,6 +77,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the etag property: etag info. * @@ -500,12 +546,58 @@ public ProvisioningState provisioningState() { */ public void validate() { if (innerProperties() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property innerProperties in model PreRulesResourceInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model PreRulesResourceInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(PreRulesResourceInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PreRulesResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PreRulesResourceInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PreRulesResourceInner. + */ + public static PreRulesResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PreRulesResourceInner deserializedPreRulesResourceInner = new PreRulesResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPreRulesResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPreRulesResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPreRulesResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPreRulesResourceInner.innerProperties = RuleEntry.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPreRulesResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPreRulesResourceInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PredefinedUrlCategoriesResponseInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PredefinedUrlCategoriesResponseInner.java index 766ac627ecfea..d27507f5e761a 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PredefinedUrlCategoriesResponseInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PredefinedUrlCategoriesResponseInner.java @@ -6,25 +6,28 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.PredefinedUrlCategory; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * predefined url categories response. */ @Fluent -public final class PredefinedUrlCategoriesResponseInner { +public final class PredefinedUrlCategoriesResponseInner + implements JsonSerializable { /* * predefined url categories */ - @JsonProperty(value = "value", required = true) private List value; /* * next link */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +83,56 @@ public PredefinedUrlCategoriesResponseInner withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property value in model PredefinedUrlCategoriesResponseInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model PredefinedUrlCategoriesResponseInner")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(PredefinedUrlCategoriesResponseInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PredefinedUrlCategoriesResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PredefinedUrlCategoriesResponseInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PredefinedUrlCategoriesResponseInner. + */ + public static PredefinedUrlCategoriesResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PredefinedUrlCategoriesResponseInner deserializedPredefinedUrlCategoriesResponseInner + = new PredefinedUrlCategoriesResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PredefinedUrlCategory.fromJson(reader1)); + deserializedPredefinedUrlCategoriesResponseInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPredefinedUrlCategoriesResponseInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPredefinedUrlCategoriesResponseInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PrefixListGlobalRulestackResourceInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PrefixListGlobalRulestackResourceInner.java index 50cebc19dbc9b..6956ee9f2bdbb 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PrefixListGlobalRulestackResourceInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PrefixListGlobalRulestackResourceInner.java @@ -8,8 +8,11 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -20,15 +23,28 @@ public final class PrefixListGlobalRulestackResourceInner extends ProxyResource /* * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties", required = true) private PrefixObject innerProperties = new PrefixObject(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of PrefixListGlobalRulestackResourceInner class. */ @@ -53,6 +69,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the description property: prefix description. * @@ -161,12 +207,59 @@ public ProvisioningState provisioningState() { */ public void validate() { if (innerProperties() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property innerProperties in model PrefixListGlobalRulestackResourceInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model PrefixListGlobalRulestackResourceInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(PrefixListGlobalRulestackResourceInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrefixListGlobalRulestackResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrefixListGlobalRulestackResourceInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrefixListGlobalRulestackResourceInner. + */ + public static PrefixListGlobalRulestackResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrefixListGlobalRulestackResourceInner deserializedPrefixListGlobalRulestackResourceInner + = new PrefixListGlobalRulestackResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrefixListGlobalRulestackResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrefixListGlobalRulestackResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrefixListGlobalRulestackResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrefixListGlobalRulestackResourceInner.innerProperties = PrefixObject.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrefixListGlobalRulestackResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrefixListGlobalRulestackResourceInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PrefixListResourceInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PrefixListResourceInner.java index e1fa81133f878..f597b84b15c81 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PrefixListResourceInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PrefixListResourceInner.java @@ -8,8 +8,11 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -20,15 +23,28 @@ public final class PrefixListResourceInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties", required = true) private PrefixObject innerProperties = new PrefixObject(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of PrefixListResourceInner class. */ @@ -53,6 +69,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the description property: prefix description. * @@ -161,12 +207,58 @@ public ProvisioningState provisioningState() { */ public void validate() { if (innerProperties() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property innerProperties in model PrefixListResourceInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model PrefixListResourceInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(PrefixListResourceInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrefixListResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrefixListResourceInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrefixListResourceInner. + */ + public static PrefixListResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrefixListResourceInner deserializedPrefixListResourceInner = new PrefixListResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrefixListResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrefixListResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrefixListResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrefixListResourceInner.innerProperties = PrefixObject.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrefixListResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrefixListResourceInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PrefixObject.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PrefixObject.java index f5d3017d5937f..d7d78b18b901f 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PrefixObject.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/PrefixObject.java @@ -6,43 +6,42 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * prefix entry. */ @Fluent -public final class PrefixObject { +public final class PrefixObject implements JsonSerializable { /* * prefix description */ - @JsonProperty(value = "description") private String description; /* * prefix list */ - @JsonProperty(value = "prefixList", required = true) private List prefixList; /* * etag info */ - @JsonProperty(value = "etag") private String etag; /* * comment for this object */ - @JsonProperty(value = "auditComment") private String auditComment; /* * Provisioning state of the resource. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /** @@ -147,10 +146,59 @@ public ProvisioningState provisioningState() { */ public void validate() { if (prefixList() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property prefixList in model PrefixObject")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property prefixList in model PrefixObject")); } } private static final ClientLogger LOGGER = new ClientLogger(PrefixObject.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("prefixList", this.prefixList, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("etag", this.etag); + jsonWriter.writeStringField("auditComment", this.auditComment); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrefixObject from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrefixObject if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrefixObject. + */ + public static PrefixObject fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrefixObject deserializedPrefixObject = new PrefixObject(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("prefixList".equals(fieldName)) { + List prefixList = reader.readArray(reader1 -> reader1.getString()); + deserializedPrefixObject.prefixList = prefixList; + } else if ("description".equals(fieldName)) { + deserializedPrefixObject.description = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedPrefixObject.etag = reader.getString(); + } else if ("auditComment".equals(fieldName)) { + deserializedPrefixObject.auditComment = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedPrefixObject.provisioningState = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPrefixObject; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/RuleCounterInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/RuleCounterInner.java index b7497ffbe425f..f89e626e7a68c 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/RuleCounterInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/RuleCounterInner.java @@ -5,74 +5,70 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.AppSeenData; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * Rule counter. */ @Fluent -public final class RuleCounterInner { +public final class RuleCounterInner implements JsonSerializable { /* * priority number */ - @JsonProperty(value = "priority", required = true) private String priority; /* * rule Stack Name */ - @JsonProperty(value = "ruleStackName") private String ruleStackName; /* * rule list name */ - @JsonProperty(value = "ruleListName") private String ruleListName; /* * firewall name */ - @JsonProperty(value = "firewallName") private String firewallName; /* * rule name */ - @JsonProperty(value = "ruleName", required = true) private String ruleName; /* * hit count */ - @JsonProperty(value = "hitCount") private Integer hitCount; /* * apps seen */ - @JsonProperty(value = "appSeen") private AppSeenData appSeen; /* * timestamp of response */ - @JsonProperty(value = "timestamp") private OffsetDateTime timestamp; /* * timestamp of request */ - @JsonProperty(value = "requestTimestamp") private OffsetDateTime requestTimestamp; /* * last updated timestamp */ - @JsonProperty(value = "lastUpdatedTimestamp") private OffsetDateTime lastUpdatedTimestamp; /** @@ -288,12 +284,12 @@ public RuleCounterInner withLastUpdatedTimestamp(OffsetDateTime lastUpdatedTimes */ public void validate() { if (priority() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property priority in model RuleCounterInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property priority in model RuleCounterInner")); } if (ruleName() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property ruleName in model RuleCounterInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property ruleName in model RuleCounterInner")); } if (appSeen() != null) { appSeen().validate(); @@ -301,4 +297,78 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(RuleCounterInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("priority", this.priority); + jsonWriter.writeStringField("ruleName", this.ruleName); + jsonWriter.writeStringField("ruleStackName", this.ruleStackName); + jsonWriter.writeStringField("ruleListName", this.ruleListName); + jsonWriter.writeStringField("firewallName", this.firewallName); + jsonWriter.writeNumberField("hitCount", this.hitCount); + jsonWriter.writeJsonField("appSeen", this.appSeen); + jsonWriter.writeStringField("timestamp", + this.timestamp == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.timestamp)); + jsonWriter.writeStringField("requestTimestamp", + this.requestTimestamp == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.requestTimestamp)); + jsonWriter.writeStringField("lastUpdatedTimestamp", + this.lastUpdatedTimestamp == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedTimestamp)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuleCounterInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuleCounterInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RuleCounterInner. + */ + public static RuleCounterInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuleCounterInner deserializedRuleCounterInner = new RuleCounterInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("priority".equals(fieldName)) { + deserializedRuleCounterInner.priority = reader.getString(); + } else if ("ruleName".equals(fieldName)) { + deserializedRuleCounterInner.ruleName = reader.getString(); + } else if ("ruleStackName".equals(fieldName)) { + deserializedRuleCounterInner.ruleStackName = reader.getString(); + } else if ("ruleListName".equals(fieldName)) { + deserializedRuleCounterInner.ruleListName = reader.getString(); + } else if ("firewallName".equals(fieldName)) { + deserializedRuleCounterInner.firewallName = reader.getString(); + } else if ("hitCount".equals(fieldName)) { + deserializedRuleCounterInner.hitCount = reader.getNullable(JsonReader::getInt); + } else if ("appSeen".equals(fieldName)) { + deserializedRuleCounterInner.appSeen = AppSeenData.fromJson(reader); + } else if ("timestamp".equals(fieldName)) { + deserializedRuleCounterInner.timestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("requestTimestamp".equals(fieldName)) { + deserializedRuleCounterInner.requestTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastUpdatedTimestamp".equals(fieldName)) { + deserializedRuleCounterInner.lastUpdatedTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedRuleCounterInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/RuleCounterResetInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/RuleCounterResetInner.java index 6d6cccba9561d..be1692d05d521 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/RuleCounterResetInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/RuleCounterResetInner.java @@ -5,41 +5,40 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Rule counter reset. */ @Fluent -public final class RuleCounterResetInner { +public final class RuleCounterResetInner implements JsonSerializable { /* * priority number */ - @JsonProperty(value = "priority", access = JsonProperty.Access.WRITE_ONLY) private String priority; /* * rule Stack Name */ - @JsonProperty(value = "ruleStackName") private String ruleStackName; /* * rule list name */ - @JsonProperty(value = "ruleListName") private String ruleListName; /* * firewall name */ - @JsonProperty(value = "firewallName") private String firewallName; /* * rule name */ - @JsonProperty(value = "ruleName") private String ruleName; /** @@ -144,4 +143,51 @@ public RuleCounterResetInner withRuleName(String ruleName) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleStackName", this.ruleStackName); + jsonWriter.writeStringField("ruleListName", this.ruleListName); + jsonWriter.writeStringField("firewallName", this.firewallName); + jsonWriter.writeStringField("ruleName", this.ruleName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuleCounterResetInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuleCounterResetInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RuleCounterResetInner. + */ + public static RuleCounterResetInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuleCounterResetInner deserializedRuleCounterResetInner = new RuleCounterResetInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("priority".equals(fieldName)) { + deserializedRuleCounterResetInner.priority = reader.getString(); + } else if ("ruleStackName".equals(fieldName)) { + deserializedRuleCounterResetInner.ruleStackName = reader.getString(); + } else if ("ruleListName".equals(fieldName)) { + deserializedRuleCounterResetInner.ruleListName = reader.getString(); + } else if ("firewallName".equals(fieldName)) { + deserializedRuleCounterResetInner.firewallName = reader.getString(); + } else if ("ruleName".equals(fieldName)) { + deserializedRuleCounterResetInner.ruleName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRuleCounterResetInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/RuleEntry.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/RuleEntry.java index 8542ded264954..c4698e4fa7ef4 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/RuleEntry.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/RuleEntry.java @@ -6,6 +6,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ActionEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.Category; @@ -15,132 +19,112 @@ import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SourceAddr; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.StateEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.TagInfo; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * definition of rule. */ @Fluent -public final class RuleEntry { +public final class RuleEntry implements JsonSerializable { /* * etag info */ - @JsonProperty(value = "etag") private String etag; /* * rule name */ - @JsonProperty(value = "ruleName", required = true) private String ruleName; /* * The priority property. */ - @JsonProperty(value = "priority", access = JsonProperty.Access.WRITE_ONLY) private Integer priority; /* * rule description */ - @JsonProperty(value = "description") private String description; /* * state of this rule */ - @JsonProperty(value = "ruleState") private StateEnum ruleState; /* * source address */ - @JsonProperty(value = "source") private SourceAddr source; /* * cidr should not be 'any' */ - @JsonProperty(value = "negateSource") private BooleanEnum negateSource; /* * destination address */ - @JsonProperty(value = "destination") private DestinationAddr destination; /* * cidr should not be 'any' */ - @JsonProperty(value = "negateDestination") private BooleanEnum negateDestination; /* * array of rule applications */ - @JsonProperty(value = "applications") private List applications; /* * rule category */ - @JsonProperty(value = "category") private Category category; /* * any, application-default, TCP:number, UDP:number */ - @JsonProperty(value = "protocol") private String protocol; /* * prot port list */ - @JsonProperty(value = "protocolPortList") private List protocolPortList; /* * inbound Inspection Certificate */ - @JsonProperty(value = "inboundInspectionCertificate") private String inboundInspectionCertificate; /* * rule comment */ - @JsonProperty(value = "auditComment") private String auditComment; /* * rule action */ - @JsonProperty(value = "actionType") private ActionEnum actionType; /* * enable or disable logging */ - @JsonProperty(value = "enableLogging") private StateEnum enableLogging; /* * enable or disable decryption */ - @JsonProperty(value = "decryptionRuleType") private DecryptionRuleTypeEnum decryptionRuleType; /* * tag for rule */ - @JsonProperty(value = "tags") private List tags; /* * Provisioning state of the resource. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /** @@ -534,8 +518,8 @@ public ProvisioningState provisioningState() { */ public void validate() { if (ruleName() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property ruleName in model RuleEntry")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property ruleName in model RuleEntry")); } if (source() != null) { source().validate(); @@ -552,4 +536,102 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(RuleEntry.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleName", this.ruleName); + jsonWriter.writeStringField("etag", this.etag); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("ruleState", this.ruleState == null ? null : this.ruleState.toString()); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeStringField("negateSource", this.negateSource == null ? null : this.negateSource.toString()); + jsonWriter.writeJsonField("destination", this.destination); + jsonWriter.writeStringField("negateDestination", + this.negateDestination == null ? null : this.negateDestination.toString()); + jsonWriter.writeArrayField("applications", this.applications, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("category", this.category); + jsonWriter.writeStringField("protocol", this.protocol); + jsonWriter.writeArrayField("protocolPortList", this.protocolPortList, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("inboundInspectionCertificate", this.inboundInspectionCertificate); + jsonWriter.writeStringField("auditComment", this.auditComment); + jsonWriter.writeStringField("actionType", this.actionType == null ? null : this.actionType.toString()); + jsonWriter.writeStringField("enableLogging", this.enableLogging == null ? null : this.enableLogging.toString()); + jsonWriter.writeStringField("decryptionRuleType", + this.decryptionRuleType == null ? null : this.decryptionRuleType.toString()); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuleEntry from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuleEntry if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RuleEntry. + */ + public static RuleEntry fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuleEntry deserializedRuleEntry = new RuleEntry(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleName".equals(fieldName)) { + deserializedRuleEntry.ruleName = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedRuleEntry.etag = reader.getString(); + } else if ("priority".equals(fieldName)) { + deserializedRuleEntry.priority = reader.getNullable(JsonReader::getInt); + } else if ("description".equals(fieldName)) { + deserializedRuleEntry.description = reader.getString(); + } else if ("ruleState".equals(fieldName)) { + deserializedRuleEntry.ruleState = StateEnum.fromString(reader.getString()); + } else if ("source".equals(fieldName)) { + deserializedRuleEntry.source = SourceAddr.fromJson(reader); + } else if ("negateSource".equals(fieldName)) { + deserializedRuleEntry.negateSource = BooleanEnum.fromString(reader.getString()); + } else if ("destination".equals(fieldName)) { + deserializedRuleEntry.destination = DestinationAddr.fromJson(reader); + } else if ("negateDestination".equals(fieldName)) { + deserializedRuleEntry.negateDestination = BooleanEnum.fromString(reader.getString()); + } else if ("applications".equals(fieldName)) { + List applications = reader.readArray(reader1 -> reader1.getString()); + deserializedRuleEntry.applications = applications; + } else if ("category".equals(fieldName)) { + deserializedRuleEntry.category = Category.fromJson(reader); + } else if ("protocol".equals(fieldName)) { + deserializedRuleEntry.protocol = reader.getString(); + } else if ("protocolPortList".equals(fieldName)) { + List protocolPortList = reader.readArray(reader1 -> reader1.getString()); + deserializedRuleEntry.protocolPortList = protocolPortList; + } else if ("inboundInspectionCertificate".equals(fieldName)) { + deserializedRuleEntry.inboundInspectionCertificate = reader.getString(); + } else if ("auditComment".equals(fieldName)) { + deserializedRuleEntry.auditComment = reader.getString(); + } else if ("actionType".equals(fieldName)) { + deserializedRuleEntry.actionType = ActionEnum.fromString(reader.getString()); + } else if ("enableLogging".equals(fieldName)) { + deserializedRuleEntry.enableLogging = StateEnum.fromString(reader.getString()); + } else if ("decryptionRuleType".equals(fieldName)) { + deserializedRuleEntry.decryptionRuleType = DecryptionRuleTypeEnum.fromString(reader.getString()); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagInfo.fromJson(reader1)); + deserializedRuleEntry.tags = tags; + } else if ("provisioningState".equals(fieldName)) { + deserializedRuleEntry.provisioningState = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRuleEntry; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/RulestackProperties.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/RulestackProperties.java index 2b077903a8399..1708343c18f4b 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/RulestackProperties.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/RulestackProperties.java @@ -5,70 +5,65 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.DefaultMode; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ProvisioningState; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ScopeType; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SecurityServices; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * PAN Rulestack Describe Object. */ @Fluent -public final class RulestackProperties { +public final class RulestackProperties implements JsonSerializable { /* * PanEtag info */ - @JsonProperty(value = "panEtag") private String panEtag; /* * Rulestack Location, Required for GlobalRulestacks, Not for LocalRulestacks */ - @JsonProperty(value = "panLocation") private String panLocation; /* * Rulestack Type */ - @JsonProperty(value = "scope") private ScopeType scope; /* * subscription scope of global rulestack */ - @JsonProperty(value = "associatedSubscriptions") private List associatedSubscriptions; /* * rulestack description */ - @JsonProperty(value = "description") private String description; /* * Mode for default rules creation */ - @JsonProperty(value = "defaultMode") private DefaultMode defaultMode; /* * minimum version */ - @JsonProperty(value = "minAppIdVersion") private String minAppIdVersion; /* * Provisioning state of the resource. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /* * Security Profile */ - @JsonProperty(value = "securityServices") private SecurityServices securityServices; /** @@ -256,4 +251,66 @@ public void validate() { securityServices().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("panEtag", this.panEtag); + jsonWriter.writeStringField("panLocation", this.panLocation); + jsonWriter.writeStringField("scope", this.scope == null ? null : this.scope.toString()); + jsonWriter.writeArrayField("associatedSubscriptions", this.associatedSubscriptions, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("defaultMode", this.defaultMode == null ? null : this.defaultMode.toString()); + jsonWriter.writeStringField("minAppIdVersion", this.minAppIdVersion); + jsonWriter.writeJsonField("securityServices", this.securityServices); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RulestackProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RulestackProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RulestackProperties. + */ + public static RulestackProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RulestackProperties deserializedRulestackProperties = new RulestackProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("panEtag".equals(fieldName)) { + deserializedRulestackProperties.panEtag = reader.getString(); + } else if ("panLocation".equals(fieldName)) { + deserializedRulestackProperties.panLocation = reader.getString(); + } else if ("scope".equals(fieldName)) { + deserializedRulestackProperties.scope = ScopeType.fromString(reader.getString()); + } else if ("associatedSubscriptions".equals(fieldName)) { + List associatedSubscriptions = reader.readArray(reader1 -> reader1.getString()); + deserializedRulestackProperties.associatedSubscriptions = associatedSubscriptions; + } else if ("description".equals(fieldName)) { + deserializedRulestackProperties.description = reader.getString(); + } else if ("defaultMode".equals(fieldName)) { + deserializedRulestackProperties.defaultMode = DefaultMode.fromString(reader.getString()); + } else if ("minAppIdVersion".equals(fieldName)) { + deserializedRulestackProperties.minAppIdVersion = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedRulestackProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("securityServices".equals(fieldName)) { + deserializedRulestackProperties.securityServices = SecurityServices.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRulestackProperties; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/SecurityServicesResponseInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/SecurityServicesResponseInner.java index 5d9085a311f7b..7896109c8c5a6 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/SecurityServicesResponseInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/SecurityServicesResponseInner.java @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SecurityServicesTypeList; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Security services list response. */ @Fluent -public final class SecurityServicesResponseInner { +public final class SecurityServicesResponseInner implements JsonSerializable { /* * response value */ - @JsonProperty(value = "value", required = true) private SecurityServicesTypeList value; /* * next link */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -79,12 +81,54 @@ public SecurityServicesResponseInner withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model SecurityServicesResponseInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model SecurityServicesResponseInner")); } else { value().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(SecurityServicesResponseInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("value", this.value); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityServicesResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityServicesResponseInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SecurityServicesResponseInner. + */ + public static SecurityServicesResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityServicesResponseInner deserializedSecurityServicesResponseInner + = new SecurityServicesResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedSecurityServicesResponseInner.value = SecurityServicesTypeList.fromJson(reader); + } else if ("nextLink".equals(fieldName)) { + deserializedSecurityServicesResponseInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityServicesResponseInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/SupportInfoInner.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/SupportInfoInner.java index b930dcbe22499..e5b5ada4e6648 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/SupportInfoInner.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/fluent/models/SupportInfoInner.java @@ -5,84 +5,76 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Support information for the resource. */ @Fluent -public final class SupportInfoInner { +public final class SupportInfoInner implements JsonSerializable { /* * product SKU associated with given resource */ - @JsonProperty(value = "productSku") private String productSku; /* * product Serial associated with given resource */ - @JsonProperty(value = "productSerial") private String productSerial; /* * account registered in Customer Support Portal */ - @JsonProperty(value = "accountRegistered") private BooleanEnum accountRegistered; /* * Support account associated with given resource */ - @JsonProperty(value = "accountId") private String accountId; /* * user domain is supported in Customer Support Portal */ - @JsonProperty(value = "userDomainSupported") private BooleanEnum userDomainSupported; /* * user registered in Customer Support Portal */ - @JsonProperty(value = "userRegistered") private BooleanEnum userRegistered; /* * Product usage is in free trial period */ - @JsonProperty(value = "freeTrial") private BooleanEnum freeTrial; /* * Free trial days remaining */ - @JsonProperty(value = "freeTrialDaysLeft") private Integer freeTrialDaysLeft; /* * Free trial credit remaining */ - @JsonProperty(value = "freeTrialCreditLeft") private Integer freeTrialCreditLeft; /* * URL for paloaltonetworks live community */ - @JsonProperty(value = "helpURL") private String helpUrl; /* * URL for paloaltonetworks Customer Service Portal */ - @JsonProperty(value = "supportURL") private String supportUrl; /* * URL for registering product in paloaltonetworks Customer Service Portal */ - @JsonProperty(value = "registerURL") private String registerUrl; /** @@ -338,4 +330,76 @@ public SupportInfoInner withRegisterUrl(String registerUrl) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("productSku", this.productSku); + jsonWriter.writeStringField("productSerial", this.productSerial); + jsonWriter.writeStringField("accountRegistered", + this.accountRegistered == null ? null : this.accountRegistered.toString()); + jsonWriter.writeStringField("accountId", this.accountId); + jsonWriter.writeStringField("userDomainSupported", + this.userDomainSupported == null ? null : this.userDomainSupported.toString()); + jsonWriter.writeStringField("userRegistered", + this.userRegistered == null ? null : this.userRegistered.toString()); + jsonWriter.writeStringField("freeTrial", this.freeTrial == null ? null : this.freeTrial.toString()); + jsonWriter.writeNumberField("freeTrialDaysLeft", this.freeTrialDaysLeft); + jsonWriter.writeNumberField("freeTrialCreditLeft", this.freeTrialCreditLeft); + jsonWriter.writeStringField("helpURL", this.helpUrl); + jsonWriter.writeStringField("supportURL", this.supportUrl); + jsonWriter.writeStringField("registerURL", this.registerUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SupportInfoInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SupportInfoInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SupportInfoInner. + */ + public static SupportInfoInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SupportInfoInner deserializedSupportInfoInner = new SupportInfoInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("productSku".equals(fieldName)) { + deserializedSupportInfoInner.productSku = reader.getString(); + } else if ("productSerial".equals(fieldName)) { + deserializedSupportInfoInner.productSerial = reader.getString(); + } else if ("accountRegistered".equals(fieldName)) { + deserializedSupportInfoInner.accountRegistered = BooleanEnum.fromString(reader.getString()); + } else if ("accountId".equals(fieldName)) { + deserializedSupportInfoInner.accountId = reader.getString(); + } else if ("userDomainSupported".equals(fieldName)) { + deserializedSupportInfoInner.userDomainSupported = BooleanEnum.fromString(reader.getString()); + } else if ("userRegistered".equals(fieldName)) { + deserializedSupportInfoInner.userRegistered = BooleanEnum.fromString(reader.getString()); + } else if ("freeTrial".equals(fieldName)) { + deserializedSupportInfoInner.freeTrial = BooleanEnum.fromString(reader.getString()); + } else if ("freeTrialDaysLeft".equals(fieldName)) { + deserializedSupportInfoInner.freeTrialDaysLeft = reader.getNullable(JsonReader::getInt); + } else if ("freeTrialCreditLeft".equals(fieldName)) { + deserializedSupportInfoInner.freeTrialCreditLeft = reader.getNullable(JsonReader::getInt); + } else if ("helpURL".equals(fieldName)) { + deserializedSupportInfoInner.helpUrl = reader.getString(); + } else if ("supportURL".equals(fieldName)) { + deserializedSupportInfoInner.supportUrl = reader.getString(); + } else if ("registerURL".equals(fieldName)) { + deserializedSupportInfoInner.registerUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSupportInfoInner; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/CertificateObjectGlobalRulestacksClientImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/CertificateObjectGlobalRulestacksClientImpl.java index ab6f893c023ea..bcf7433055522 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/CertificateObjectGlobalRulestacksClientImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/CertificateObjectGlobalRulestacksClientImpl.java @@ -64,8 +64,8 @@ public final class CertificateObjectGlobalRulestacksClientImpl implements Certif } /** - * The interface defining all the services for PaloAltoNetworksCloudngfwCertificateObjectGlobalRulestacks to be - * used by the proxy service to perform REST calls. + * The interface defining all the services for PaloAltoNetworksCloudngfwCertificateObjectGlobalRulestacks to be used + * by the proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "PaloAltoNetworksClou") @@ -778,9 +778,7 @@ public void delete(String globalRulestackName, String name, Context context) { /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -808,9 +806,7 @@ public void delete(String globalRulestackName, String name, Context context) { /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/CertificateObjectGlobalRulestacksImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/CertificateObjectGlobalRulestacksImpl.java index 2cb684677887a..d4cedb10e5311 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/CertificateObjectGlobalRulestacksImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/CertificateObjectGlobalRulestacksImpl.java @@ -30,13 +30,15 @@ public CertificateObjectGlobalRulestacksImpl(CertificateObjectGlobalRulestacksCl public PagedIterable list(String globalRulestackName) { PagedIterable inner = this.serviceClient().list(globalRulestackName); - return Utils.mapPage(inner, inner1 -> new CertificateObjectGlobalRulestackResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new CertificateObjectGlobalRulestackResourceImpl(inner1, this.manager())); } public PagedIterable list(String globalRulestackName, Context context) { PagedIterable inner = this.serviceClient().list(globalRulestackName, context); - return Utils.mapPage(inner, inner1 -> new CertificateObjectGlobalRulestackResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new CertificateObjectGlobalRulestackResourceImpl(inner1, this.manager())); } public Response getWithResponse(String globalRulestackName, String name, diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/CertificateObjectLocalRulestackResourceImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/CertificateObjectLocalRulestackResourceImpl.java index b0b3d1c61dfbd..2ea2b6cd0ca0e 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/CertificateObjectLocalRulestackResourceImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/CertificateObjectLocalRulestackResourceImpl.java @@ -125,9 +125,9 @@ public CertificateObjectLocalRulestackResource apply(Context context) { com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.localRulestackName = Utils.getValueFromIdByName(innerObject.id(), "localRulestacks"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "certificates"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.localRulestackName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "localRulestacks"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "certificates"); } public CertificateObjectLocalRulestackResource refresh() { diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/CertificateObjectLocalRulestacksClientImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/CertificateObjectLocalRulestacksClientImpl.java index f23f18b288194..8ff54d3cac11b 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/CertificateObjectLocalRulestacksClientImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/CertificateObjectLocalRulestacksClientImpl.java @@ -901,9 +901,7 @@ public void delete(String resourceGroupName, String localRulestackName, String n /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -933,9 +931,7 @@ public void delete(String resourceGroupName, String localRulestackName, String n /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/CertificateObjectLocalRulestacksImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/CertificateObjectLocalRulestacksImpl.java index bfc6a75accc6f..f7b74f2979576 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/CertificateObjectLocalRulestacksImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/CertificateObjectLocalRulestacksImpl.java @@ -31,14 +31,16 @@ public PagedIterable listByLocalRulesta String localRulestackName) { PagedIterable inner = this.serviceClient().listByLocalRulestacks(resourceGroupName, localRulestackName); - return Utils.mapPage(inner, inner1 -> new CertificateObjectLocalRulestackResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new CertificateObjectLocalRulestackResourceImpl(inner1, this.manager())); } public PagedIterable listByLocalRulestacks(String resourceGroupName, String localRulestackName, Context context) { PagedIterable inner = this.serviceClient().listByLocalRulestacks(resourceGroupName, localRulestackName, context); - return Utils.mapPage(inner, inner1 -> new CertificateObjectLocalRulestackResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new CertificateObjectLocalRulestackResourceImpl(inner1, this.manager())); } public Response getWithResponse(String resourceGroupName, @@ -73,17 +75,17 @@ public void delete(String resourceGroupName, String localRulestackName, String n } public CertificateObjectLocalRulestackResource getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String localRulestackName = Utils.getValueFromIdByName(id, "localRulestacks"); + String localRulestackName = ResourceManagerUtils.getValueFromIdByName(id, "localRulestacks"); if (localRulestackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRulestacks'.", id))); } - String name = Utils.getValueFromIdByName(id, "certificates"); + String name = ResourceManagerUtils.getValueFromIdByName(id, "certificates"); if (name == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); @@ -92,17 +94,17 @@ public CertificateObjectLocalRulestackResource getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String localRulestackName = Utils.getValueFromIdByName(id, "localRulestacks"); + String localRulestackName = ResourceManagerUtils.getValueFromIdByName(id, "localRulestacks"); if (localRulestackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRulestacks'.", id))); } - String name = Utils.getValueFromIdByName(id, "certificates"); + String name = ResourceManagerUtils.getValueFromIdByName(id, "certificates"); if (name == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); @@ -111,17 +113,17 @@ public Response getByIdWithResponse(Str } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String localRulestackName = Utils.getValueFromIdByName(id, "localRulestacks"); + String localRulestackName = ResourceManagerUtils.getValueFromIdByName(id, "localRulestacks"); if (localRulestackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRulestacks'.", id))); } - String name = Utils.getValueFromIdByName(id, "certificates"); + String name = ResourceManagerUtils.getValueFromIdByName(id, "certificates"); if (name == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); @@ -130,17 +132,17 @@ public void deleteById(String id) { } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String localRulestackName = Utils.getValueFromIdByName(id, "localRulestacks"); + String localRulestackName = ResourceManagerUtils.getValueFromIdByName(id, "localRulestacks"); if (localRulestackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRulestacks'.", id))); } - String name = Utils.getValueFromIdByName(id, "certificates"); + String name = ResourceManagerUtils.getValueFromIdByName(id, "certificates"); if (name == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FirewallResourceImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FirewallResourceImpl.java index 5319a6802155b..f3aaf801cd00c 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FirewallResourceImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FirewallResourceImpl.java @@ -191,8 +191,8 @@ public FirewallResource apply(Context context) { com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.firewallName = Utils.getValueFromIdByName(innerObject.id(), "firewalls"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.firewallName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "firewalls"); } public FirewallResource refresh() { diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FirewallStatusClientImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FirewallStatusClientImpl.java index 9318cc3bd49ea..888e7a267fb46 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FirewallStatusClientImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FirewallStatusClientImpl.java @@ -352,9 +352,7 @@ public FirewallStatusResourceInner get(String resourceGroupName, String firewall /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -381,9 +379,7 @@ private Mono> listByFirewallsNextSing /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FirewallStatusImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FirewallStatusImpl.java index 917712b251bd5..7fe683d900d10 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FirewallStatusImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FirewallStatusImpl.java @@ -30,14 +30,14 @@ public FirewallStatusImpl(FirewallStatusClient innerClient, public PagedIterable listByFirewalls(String resourceGroupName, String firewallName) { PagedIterable inner = this.serviceClient().listByFirewalls(resourceGroupName, firewallName); - return Utils.mapPage(inner, inner1 -> new FirewallStatusResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FirewallStatusResourceImpl(inner1, this.manager())); } public PagedIterable listByFirewalls(String resourceGroupName, String firewallName, Context context) { PagedIterable inner = this.serviceClient().listByFirewalls(resourceGroupName, firewallName, context); - return Utils.mapPage(inner, inner1 -> new FirewallStatusResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FirewallStatusResourceImpl(inner1, this.manager())); } public Response getWithResponse(String resourceGroupName, String firewallName, diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FirewallsClientImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FirewallsClientImpl.java index e1895f35bd70b..36acf61016e14 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FirewallsClientImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FirewallsClientImpl.java @@ -70,8 +70,8 @@ public final class FirewallsClientImpl implements FirewallsClient { } /** - * The interface defining all the services for PaloAltoNetworksCloudngfwFirewalls to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for PaloAltoNetworksCloudngfwFirewalls to be used by the proxy service to + * perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "PaloAltoNetworksClou") @@ -1475,7 +1475,7 @@ public SupportInfoInner getSupportInfo(String resourceGroupName, String firewall * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param firewallName Firewall resource name. - * @param logSettings Log Settings for Firewall. + * @param logSettings The logSettings 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. @@ -1514,7 +1514,7 @@ private Mono> saveLogProfileWithResponseAsync(String resourceGrou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param firewallName Firewall resource name. - * @param logSettings Log Settings for Firewall. + * @param logSettings The logSettings 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. @@ -1570,7 +1570,7 @@ private Mono saveLogProfileAsync(String resourceGroupName, String firewall * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param firewallName Firewall resource name. - * @param logSettings Log Settings for Firewall. + * @param logSettings The logSettings 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. @@ -1601,9 +1601,7 @@ public void saveLogProfile(String resourceGroupName, String firewallName) { /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1631,9 +1629,7 @@ private Mono> listBySubscriptionNextSingleP /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1661,9 +1657,7 @@ private Mono> listBySubscriptionNextSingleP /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1691,9 +1685,7 @@ private Mono> listByResourceGroupNextSingle /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FirewallsImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FirewallsImpl.java index 79adf3e26dd52..58736898a23fe 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FirewallsImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FirewallsImpl.java @@ -35,23 +35,23 @@ public FirewallsImpl(FirewallsClient innerClient, public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new FirewallResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FirewallResourceImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new FirewallResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FirewallResourceImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new FirewallResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FirewallResourceImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new FirewallResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FirewallResourceImpl(inner1, this.manager())); } public Response getByResourceGroupWithResponse(String resourceGroupName, String firewallName, @@ -156,12 +156,12 @@ public void saveLogProfile(String resourceGroupName, String firewallName) { } public FirewallResource getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String firewallName = Utils.getValueFromIdByName(id, "firewalls"); + String firewallName = ResourceManagerUtils.getValueFromIdByName(id, "firewalls"); if (firewallName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'firewalls'.", id))); @@ -170,12 +170,12 @@ public FirewallResource getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String firewallName = Utils.getValueFromIdByName(id, "firewalls"); + String firewallName = ResourceManagerUtils.getValueFromIdByName(id, "firewalls"); if (firewallName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'firewalls'.", id))); @@ -184,12 +184,12 @@ public Response getByIdWithResponse(String id, Context context } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String firewallName = Utils.getValueFromIdByName(id, "firewalls"); + String firewallName = ResourceManagerUtils.getValueFromIdByName(id, "firewalls"); if (firewallName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'firewalls'.", id))); @@ -198,12 +198,12 @@ public void deleteById(String id) { } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String firewallName = Utils.getValueFromIdByName(id, "firewalls"); + String firewallName = ResourceManagerUtils.getValueFromIdByName(id, "firewalls"); if (firewallName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'firewalls'.", id))); diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FqdnListGlobalRulestacksClientImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FqdnListGlobalRulestacksClientImpl.java index d84eedc8dc48a..f82b55eae2f40 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FqdnListGlobalRulestacksClientImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FqdnListGlobalRulestacksClientImpl.java @@ -765,9 +765,7 @@ public void delete(String globalRulestackName, String name, Context context) { /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -793,9 +791,7 @@ private Mono> listNextSingle /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FqdnListGlobalRulestacksImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FqdnListGlobalRulestacksImpl.java index 2be87f4fe0014..889f35b952e8e 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FqdnListGlobalRulestacksImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FqdnListGlobalRulestacksImpl.java @@ -29,13 +29,15 @@ public FqdnListGlobalRulestacksImpl(FqdnListGlobalRulestacksClient innerClient, public PagedIterable list(String globalRulestackName) { PagedIterable inner = this.serviceClient().list(globalRulestackName); - return Utils.mapPage(inner, inner1 -> new FqdnListGlobalRulestackResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new FqdnListGlobalRulestackResourceImpl(inner1, this.manager())); } public PagedIterable list(String globalRulestackName, Context context) { PagedIterable inner = this.serviceClient().list(globalRulestackName, context); - return Utils.mapPage(inner, inner1 -> new FqdnListGlobalRulestackResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new FqdnListGlobalRulestackResourceImpl(inner1, this.manager())); } public Response getWithResponse(String globalRulestackName, String name, diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FqdnListLocalRulestackResourceImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FqdnListLocalRulestackResourceImpl.java index a05e2e5141007..646c1b2db8aec 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FqdnListLocalRulestackResourceImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FqdnListLocalRulestackResourceImpl.java @@ -127,9 +127,9 @@ public FqdnListLocalRulestackResource apply(Context context) { com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.localRulestackName = Utils.getValueFromIdByName(innerObject.id(), "localRulestacks"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "fqdnlists"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.localRulestackName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "localRulestacks"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "fqdnlists"); } public FqdnListLocalRulestackResource refresh() { diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FqdnListLocalRulestacksClientImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FqdnListLocalRulestacksClientImpl.java index 1371ec3b0b854..ab20ddcaa0369 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FqdnListLocalRulestacksClientImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FqdnListLocalRulestacksClientImpl.java @@ -888,9 +888,7 @@ public void delete(String resourceGroupName, String localRulestackName, String n /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -919,9 +917,7 @@ public void delete(String resourceGroupName, String localRulestackName, String n /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FqdnListLocalRulestacksImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FqdnListLocalRulestacksImpl.java index 1942d07c505b1..76151bf42bd0a 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FqdnListLocalRulestacksImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/FqdnListLocalRulestacksImpl.java @@ -31,14 +31,16 @@ public PagedIterable listByLocalRulestacks(Strin String localRulestackName) { PagedIterable inner = this.serviceClient().listByLocalRulestacks(resourceGroupName, localRulestackName); - return Utils.mapPage(inner, inner1 -> new FqdnListLocalRulestackResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new FqdnListLocalRulestackResourceImpl(inner1, this.manager())); } public PagedIterable listByLocalRulestacks(String resourceGroupName, String localRulestackName, Context context) { PagedIterable inner = this.serviceClient().listByLocalRulestacks(resourceGroupName, localRulestackName, context); - return Utils.mapPage(inner, inner1 -> new FqdnListLocalRulestackResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new FqdnListLocalRulestackResourceImpl(inner1, this.manager())); } public Response getWithResponse(String resourceGroupName, String localRulestackName, @@ -72,17 +74,17 @@ public void delete(String resourceGroupName, String localRulestackName, String n } public FqdnListLocalRulestackResource getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String localRulestackName = Utils.getValueFromIdByName(id, "localRulestacks"); + String localRulestackName = ResourceManagerUtils.getValueFromIdByName(id, "localRulestacks"); if (localRulestackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRulestacks'.", id))); } - String name = Utils.getValueFromIdByName(id, "fqdnlists"); + String name = ResourceManagerUtils.getValueFromIdByName(id, "fqdnlists"); if (name == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'fqdnlists'.", id))); @@ -91,17 +93,17 @@ public FqdnListLocalRulestackResource getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String localRulestackName = Utils.getValueFromIdByName(id, "localRulestacks"); + String localRulestackName = ResourceManagerUtils.getValueFromIdByName(id, "localRulestacks"); if (localRulestackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRulestacks'.", id))); } - String name = Utils.getValueFromIdByName(id, "fqdnlists"); + String name = ResourceManagerUtils.getValueFromIdByName(id, "fqdnlists"); if (name == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'fqdnlists'.", id))); @@ -110,17 +112,17 @@ public Response getByIdWithResponse(String id, C } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String localRulestackName = Utils.getValueFromIdByName(id, "localRulestacks"); + String localRulestackName = ResourceManagerUtils.getValueFromIdByName(id, "localRulestacks"); if (localRulestackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRulestacks'.", id))); } - String name = Utils.getValueFromIdByName(id, "fqdnlists"); + String name = ResourceManagerUtils.getValueFromIdByName(id, "fqdnlists"); if (name == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'fqdnlists'.", id))); @@ -129,17 +131,17 @@ public void deleteById(String id) { } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String localRulestackName = Utils.getValueFromIdByName(id, "localRulestacks"); + String localRulestackName = ResourceManagerUtils.getValueFromIdByName(id, "localRulestacks"); if (localRulestackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRulestacks'.", id))); } - String name = Utils.getValueFromIdByName(id, "fqdnlists"); + String name = ResourceManagerUtils.getValueFromIdByName(id, "fqdnlists"); if (name == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'fqdnlists'.", id))); diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/GlobalRulestacksClientImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/GlobalRulestacksClientImpl.java index ac3be7d823f21..276cb51d418c6 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/GlobalRulestacksClientImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/GlobalRulestacksClientImpl.java @@ -1943,9 +1943,7 @@ public void revert(String globalRulestackName) { /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1971,9 +1969,7 @@ private Mono> listNextSinglePageAsyn /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/GlobalRulestacksImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/GlobalRulestacksImpl.java index e1158ccf136bf..f95860ef25bbd 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/GlobalRulestacksImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/GlobalRulestacksImpl.java @@ -46,12 +46,12 @@ public GlobalRulestacksImpl(GlobalRulestacksClient innerClient, public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new GlobalRulestackResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GlobalRulestackResourceImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new GlobalRulestackResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GlobalRulestackResourceImpl(inner1, this.manager())); } public Response getWithResponse(String globalRulestackName, Context context) { diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulesClientImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulesClientImpl.java index 1af7ca863610d..3f85dbbecbe85 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulesClientImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulesClientImpl.java @@ -1336,9 +1336,7 @@ public RuleCounterResetInner resetCounters(String resourceGroupName, String loca /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1366,9 +1364,7 @@ private Mono> listByLocalRulestacksNextSi /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulesImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulesImpl.java index 3faecb2d19097..4be28e7fe8099 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulesImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulesImpl.java @@ -35,14 +35,14 @@ public PagedIterable listByLocalRulestacks(String resourceGr String localRulestackName) { PagedIterable inner = this.serviceClient().listByLocalRulestacks(resourceGroupName, localRulestackName); - return Utils.mapPage(inner, inner1 -> new LocalRulesResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LocalRulesResourceImpl(inner1, this.manager())); } public PagedIterable listByLocalRulestacks(String resourceGroupName, String localRulestackName, Context context) { PagedIterable inner = this.serviceClient().listByLocalRulestacks(resourceGroupName, localRulestackName, context); - return Utils.mapPage(inner, inner1 -> new LocalRulesResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LocalRulesResourceImpl(inner1, this.manager())); } public Response getWithResponse(String resourceGroupName, String localRulestackName, @@ -128,17 +128,17 @@ public RuleCounterReset resetCounters(String resourceGroupName, String localRule } public LocalRulesResource getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String localRulestackName = Utils.getValueFromIdByName(id, "localRulestacks"); + String localRulestackName = ResourceManagerUtils.getValueFromIdByName(id, "localRulestacks"); if (localRulestackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRulestacks'.", id))); } - String priority = Utils.getValueFromIdByName(id, "localRules"); + String priority = ResourceManagerUtils.getValueFromIdByName(id, "localRules"); if (priority == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRules'.", id))); @@ -147,17 +147,17 @@ public LocalRulesResource getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String localRulestackName = Utils.getValueFromIdByName(id, "localRulestacks"); + String localRulestackName = ResourceManagerUtils.getValueFromIdByName(id, "localRulestacks"); if (localRulestackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRulestacks'.", id))); } - String priority = Utils.getValueFromIdByName(id, "localRules"); + String priority = ResourceManagerUtils.getValueFromIdByName(id, "localRules"); if (priority == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRules'.", id))); @@ -166,17 +166,17 @@ public Response getByIdWithResponse(String id, Context conte } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String localRulestackName = Utils.getValueFromIdByName(id, "localRulestacks"); + String localRulestackName = ResourceManagerUtils.getValueFromIdByName(id, "localRulestacks"); if (localRulestackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRulestacks'.", id))); } - String priority = Utils.getValueFromIdByName(id, "localRules"); + String priority = ResourceManagerUtils.getValueFromIdByName(id, "localRules"); if (priority == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRules'.", id))); @@ -185,17 +185,17 @@ public void deleteById(String id) { } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String localRulestackName = Utils.getValueFromIdByName(id, "localRulestacks"); + String localRulestackName = ResourceManagerUtils.getValueFromIdByName(id, "localRulestacks"); if (localRulestackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRulestacks'.", id))); } - String priority = Utils.getValueFromIdByName(id, "localRules"); + String priority = ResourceManagerUtils.getValueFromIdByName(id, "localRules"); if (priority == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRules'.", id))); diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulesResourceImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulesResourceImpl.java index 93390edefd4be..5195f80c519d3 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulesResourceImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulesResourceImpl.java @@ -207,9 +207,9 @@ public LocalRulesResource apply(Context context) { com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.localRulestackName = Utils.getValueFromIdByName(innerObject.id(), "localRulestacks"); - this.priority = Utils.getValueFromIdByName(innerObject.id(), "localRules"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.localRulestackName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "localRulestacks"); + this.priority = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "localRules"); } public LocalRulesResource refresh() { diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulestackResourceImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulestackResourceImpl.java index 83eb737295e66..1d2b1e696db25 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulestackResourceImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulestackResourceImpl.java @@ -184,8 +184,8 @@ public LocalRulestackResource apply(Context context) { com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.localRulestackName = Utils.getValueFromIdByName(innerObject.id(), "localRulestacks"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.localRulestackName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "localRulestacks"); } public LocalRulestackResource refresh() { diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulestacksClientImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulestacksClientImpl.java index 6f5d289de66cb..3a650f2e055d0 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulestacksClientImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulestacksClientImpl.java @@ -2594,9 +2594,7 @@ public void revert(String resourceGroupName, String localRulestackName) { /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2624,9 +2622,7 @@ private Mono> listBySubscriptionNextS /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2654,9 +2650,7 @@ private Mono> listBySubscriptionNextS /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2684,9 +2678,7 @@ private Mono> listByResourceGroupNext /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulestacksImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulestacksImpl.java index df0504fd56982..ddc596186b44b 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulestacksImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/LocalRulestacksImpl.java @@ -47,23 +47,23 @@ public LocalRulestacksImpl(LocalRulestacksClient innerClient, public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new LocalRulestackResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LocalRulestackResourceImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new LocalRulestackResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LocalRulestackResourceImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new LocalRulestackResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LocalRulestackResourceImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new LocalRulestackResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LocalRulestackResourceImpl(inner1, this.manager())); } public Response getByResourceGroupWithResponse(String resourceGroupName, @@ -287,12 +287,12 @@ public void revert(String resourceGroupName, String localRulestackName) { } public LocalRulestackResource getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String localRulestackName = Utils.getValueFromIdByName(id, "localRulestacks"); + String localRulestackName = ResourceManagerUtils.getValueFromIdByName(id, "localRulestacks"); if (localRulestackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRulestacks'.", id))); @@ -301,12 +301,12 @@ public LocalRulestackResource getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String localRulestackName = Utils.getValueFromIdByName(id, "localRulestacks"); + String localRulestackName = ResourceManagerUtils.getValueFromIdByName(id, "localRulestacks"); if (localRulestackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRulestacks'.", id))); @@ -315,12 +315,12 @@ public Response getByIdWithResponse(String id, Context c } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String localRulestackName = Utils.getValueFromIdByName(id, "localRulestacks"); + String localRulestackName = ResourceManagerUtils.getValueFromIdByName(id, "localRulestacks"); if (localRulestackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRulestacks'.", id))); @@ -329,12 +329,12 @@ public void deleteById(String id) { } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String localRulestackName = Utils.getValueFromIdByName(id, "localRulestacks"); + String localRulestackName = ResourceManagerUtils.getValueFromIdByName(id, "localRulestacks"); if (localRulestackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRulestacks'.", id))); diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/OperationsClientImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/OperationsClientImpl.java index 5dfaf1f13b0d5..3d7d170cf44a2 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/OperationsClientImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/OperationsClientImpl.java @@ -183,9 +183,7 @@ public PagedIterable list(Context context) { /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -211,9 +209,7 @@ private Mono> listNextSinglePageAsync(String nextL /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/OperationsImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/OperationsImpl.java index 29e2609ab4199..0e889e8802859 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/OperationsImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/OperationsImpl.java @@ -27,12 +27,12 @@ public OperationsImpl(OperationsClient innerClient, public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } private OperationsClient serviceClient() { diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PaloAltoNetworksCloudngfwImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PaloAltoNetworksCloudngfwImpl.java index fa303a2fb5d36..1f71baf4017bf 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PaloAltoNetworksCloudngfwImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PaloAltoNetworksCloudngfwImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.implementation; import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpResponse; @@ -467,7 +468,7 @@ public int getStatusCode() { } public String getHeaderValue(String s) { - return httpHeaders.getValue(s); + return httpHeaders.getValue(HttpHeaderName.fromString(s)); } public HttpHeaders getHeaders() { diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PostRulesClientImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PostRulesClientImpl.java index f63df327abe2b..76bdf286af000 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PostRulesClientImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PostRulesClientImpl.java @@ -67,8 +67,8 @@ public final class PostRulesClientImpl implements PostRulesClient { } /** - * The interface defining all the services for PaloAltoNetworksCloudngfwPostRules to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for PaloAltoNetworksCloudngfwPostRules to be used by the proxy service to + * perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "PaloAltoNetworksClou") @@ -1131,9 +1131,7 @@ public RuleCounterResetInner resetCounters(String globalRulestackName, String pr /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1159,9 +1157,7 @@ private Mono> listNextSinglePageAsync(Stri /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PostRulesImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PostRulesImpl.java index ce4b426f40183..8034ad3029f8d 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PostRulesImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PostRulesImpl.java @@ -33,12 +33,12 @@ public PostRulesImpl(PostRulesClient innerClient, public PagedIterable list(String globalRulestackName) { PagedIterable inner = this.serviceClient().list(globalRulestackName); - return Utils.mapPage(inner, inner1 -> new PostRulesResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PostRulesResourceImpl(inner1, this.manager())); } public PagedIterable list(String globalRulestackName, Context context) { PagedIterable inner = this.serviceClient().list(globalRulestackName, context); - return Utils.mapPage(inner, inner1 -> new PostRulesResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PostRulesResourceImpl(inner1, this.manager())); } public Response getWithResponse(String globalRulestackName, String priority, Context context) { diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PreRulesClientImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PreRulesClientImpl.java index 307fb12de4e18..f00568b03e49f 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PreRulesClientImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PreRulesClientImpl.java @@ -1130,9 +1130,7 @@ public RuleCounterResetInner resetCounters(String globalRulestackName, String pr /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1158,9 +1156,7 @@ private Mono> listNextSinglePageAsync(Strin /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PreRulesImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PreRulesImpl.java index be74ed93941df..1752c1c7dcfc3 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PreRulesImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PreRulesImpl.java @@ -33,12 +33,12 @@ public PreRulesImpl(PreRulesClient innerClient, public PagedIterable list(String globalRulestackName) { PagedIterable inner = this.serviceClient().list(globalRulestackName); - return Utils.mapPage(inner, inner1 -> new PreRulesResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PreRulesResourceImpl(inner1, this.manager())); } public PagedIterable list(String globalRulestackName, Context context) { PagedIterable inner = this.serviceClient().list(globalRulestackName, context); - return Utils.mapPage(inner, inner1 -> new PreRulesResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PreRulesResourceImpl(inner1, this.manager())); } public Response getWithResponse(String globalRulestackName, String priority, Context context) { diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PrefixListGlobalRulestacksClientImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PrefixListGlobalRulestacksClientImpl.java index dd7559803c053..da469961e791d 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PrefixListGlobalRulestacksClientImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PrefixListGlobalRulestacksClientImpl.java @@ -64,8 +64,8 @@ public final class PrefixListGlobalRulestacksClientImpl implements PrefixListGlo } /** - * The interface defining all the services for PaloAltoNetworksCloudngfwPrefixListGlobalRulestacks to be used by - * the proxy service to perform REST calls. + * The interface defining all the services for PaloAltoNetworksCloudngfwPrefixListGlobalRulestacks to be used by the + * proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "PaloAltoNetworksClou") @@ -766,9 +766,7 @@ public void delete(String globalRulestackName, String name, Context context) { /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -794,9 +792,7 @@ private Mono> listNextSing /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PrefixListGlobalRulestacksImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PrefixListGlobalRulestacksImpl.java index f27c32049dcf3..4714d2222c115 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PrefixListGlobalRulestacksImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PrefixListGlobalRulestacksImpl.java @@ -29,13 +29,15 @@ public PrefixListGlobalRulestacksImpl(PrefixListGlobalRulestacksClient innerClie public PagedIterable list(String globalRulestackName) { PagedIterable inner = this.serviceClient().list(globalRulestackName); - return Utils.mapPage(inner, inner1 -> new PrefixListGlobalRulestackResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new PrefixListGlobalRulestackResourceImpl(inner1, this.manager())); } public PagedIterable list(String globalRulestackName, Context context) { PagedIterable inner = this.serviceClient().list(globalRulestackName, context); - return Utils.mapPage(inner, inner1 -> new PrefixListGlobalRulestackResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new PrefixListGlobalRulestackResourceImpl(inner1, this.manager())); } public Response getWithResponse(String globalRulestackName, String name, diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PrefixListLocalRulestacksClientImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PrefixListLocalRulestacksClientImpl.java index 0571ed3bc73ae..94b34e07eaa73 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PrefixListLocalRulestacksClientImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PrefixListLocalRulestacksClientImpl.java @@ -879,9 +879,7 @@ public void delete(String resourceGroupName, String localRulestackName, String n /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -909,9 +907,7 @@ private Mono> listByLocalRulestacksNextSi /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PrefixListLocalRulestacksImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PrefixListLocalRulestacksImpl.java index fe62d0102dba2..b1bf9775a036a 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PrefixListLocalRulestacksImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PrefixListLocalRulestacksImpl.java @@ -31,14 +31,14 @@ public PagedIterable listByLocalRulestacks(String resourceGr String localRulestackName) { PagedIterable inner = this.serviceClient().listByLocalRulestacks(resourceGroupName, localRulestackName); - return Utils.mapPage(inner, inner1 -> new PrefixListResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrefixListResourceImpl(inner1, this.manager())); } public PagedIterable listByLocalRulestacks(String resourceGroupName, String localRulestackName, Context context) { PagedIterable inner = this.serviceClient().listByLocalRulestacks(resourceGroupName, localRulestackName, context); - return Utils.mapPage(inner, inner1 -> new PrefixListResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrefixListResourceImpl(inner1, this.manager())); } public Response getWithResponse(String resourceGroupName, String localRulestackName, @@ -71,17 +71,17 @@ public void delete(String resourceGroupName, String localRulestackName, String n } public PrefixListResource getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String localRulestackName = Utils.getValueFromIdByName(id, "localRulestacks"); + String localRulestackName = ResourceManagerUtils.getValueFromIdByName(id, "localRulestacks"); if (localRulestackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRulestacks'.", id))); } - String name = Utils.getValueFromIdByName(id, "prefixlists"); + String name = ResourceManagerUtils.getValueFromIdByName(id, "prefixlists"); if (name == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'prefixlists'.", id))); @@ -90,17 +90,17 @@ public PrefixListResource getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String localRulestackName = Utils.getValueFromIdByName(id, "localRulestacks"); + String localRulestackName = ResourceManagerUtils.getValueFromIdByName(id, "localRulestacks"); if (localRulestackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRulestacks'.", id))); } - String name = Utils.getValueFromIdByName(id, "prefixlists"); + String name = ResourceManagerUtils.getValueFromIdByName(id, "prefixlists"); if (name == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'prefixlists'.", id))); @@ -109,17 +109,17 @@ public Response getByIdWithResponse(String id, Context conte } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String localRulestackName = Utils.getValueFromIdByName(id, "localRulestacks"); + String localRulestackName = ResourceManagerUtils.getValueFromIdByName(id, "localRulestacks"); if (localRulestackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRulestacks'.", id))); } - String name = Utils.getValueFromIdByName(id, "prefixlists"); + String name = ResourceManagerUtils.getValueFromIdByName(id, "prefixlists"); if (name == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'prefixlists'.", id))); @@ -128,17 +128,17 @@ public void deleteById(String id) { } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String localRulestackName = Utils.getValueFromIdByName(id, "localRulestacks"); + String localRulestackName = ResourceManagerUtils.getValueFromIdByName(id, "localRulestacks"); if (localRulestackName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'localRulestacks'.", id))); } - String name = Utils.getValueFromIdByName(id, "prefixlists"); + String name = ResourceManagerUtils.getValueFromIdByName(id, "prefixlists"); if (name == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'prefixlists'.", id))); diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PrefixListResourceImpl.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PrefixListResourceImpl.java index 1ff0ea27a6df8..f18457ccfe2f5 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PrefixListResourceImpl.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/PrefixListResourceImpl.java @@ -126,9 +126,9 @@ public PrefixListResource apply(Context context) { com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.localRulestackName = Utils.getValueFromIdByName(innerObject.id(), "localRulestacks"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "prefixlists"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.localRulestackName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "localRulestacks"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "prefixlists"); } public PrefixListResource refresh() { diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/Utils.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/ResourceManagerUtils.java similarity index 99% rename from sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/Utils.java rename to sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/ResourceManagerUtils.java index 6b51a3989032f..380077246a66a 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/Utils.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/implementation/ResourceManagerUtils.java @@ -19,8 +19,8 @@ import java.util.stream.Stream; import reactor.core.publisher.Flux; -final class Utils { - private Utils() { +final class ResourceManagerUtils { + private ResourceManagerUtils() { } static String getValueFromIdByName(String id, String name) { @@ -41,7 +41,6 @@ static String getValueFromIdByName(String id, String name) { } } return null; - } static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { @@ -75,7 +74,6 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } } return null; - } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ActionEnum.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ActionEnum.java index 6a6c38e4cc8b9..4f08fec784ff1 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ActionEnum.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ActionEnum.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public ActionEnum() { * @param name a name to look for. * @return the corresponding ActionEnum. */ - @JsonCreator public static ActionEnum fromString(String name) { return fromString(name, ActionEnum.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ActionType.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ActionType.java index da5794b5505bc..4b4790e294d47 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ActionType.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ActionType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -32,7 +31,6 @@ public ActionType() { * @param name a name to look for. * @return the corresponding ActionType. */ - @JsonCreator public static ActionType fromString(String name) { return fromString(name, ActionType.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AdvSecurityObjectModel.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AdvSecurityObjectModel.java index 4323b19d9b4ac..d191e2a474047 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AdvSecurityObjectModel.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AdvSecurityObjectModel.java @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * List of custom and predefined url category. */ @Fluent -public final class AdvSecurityObjectModel { +public final class AdvSecurityObjectModel implements JsonSerializable { /* * type of object */ - @JsonProperty(value = "type") private String type; /* * URL entry */ - @JsonProperty(value = "entry", required = true) private List entry; /** @@ -79,12 +81,54 @@ public AdvSecurityObjectModel withEntry(List entry) { */ public void validate() { if (entry() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property entry in model AdvSecurityObjectModel")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property entry in model AdvSecurityObjectModel")); } else { entry().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(AdvSecurityObjectModel.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("entry", this.entry, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdvSecurityObjectModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdvSecurityObjectModel if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AdvSecurityObjectModel. + */ + public static AdvSecurityObjectModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdvSecurityObjectModel deserializedAdvSecurityObjectModel = new AdvSecurityObjectModel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("entry".equals(fieldName)) { + List entry + = reader.readArray(reader1 -> NameDescriptionObject.fromJson(reader1)); + deserializedAdvSecurityObjectModel.entry = entry; + } else if ("type".equals(fieldName)) { + deserializedAdvSecurityObjectModel.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAdvSecurityObjectModel; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AdvSecurityObjectTypeEnum.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AdvSecurityObjectTypeEnum.java index 5e7f84ca6d68d..da67f585029d1 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AdvSecurityObjectTypeEnum.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AdvSecurityObjectTypeEnum.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public AdvSecurityObjectTypeEnum() { * @param name a name to look for. * @return the corresponding AdvSecurityObjectTypeEnum. */ - @JsonCreator public static AdvSecurityObjectTypeEnum fromString(String name) { return fromString(name, AdvSecurityObjectTypeEnum.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AppSeenData.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AppSeenData.java index d043a97e0dd32..98ee81aed6c1e 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AppSeenData.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AppSeenData.java @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Data Type for App Seen. */ @Fluent -public final class AppSeenData { +public final class AppSeenData implements JsonSerializable { /* * number of rows */ - @JsonProperty(value = "count", required = true) private int count; /* * array of appSeen */ - @JsonProperty(value = "appSeenList", required = true) private List appSeenList; /** @@ -79,12 +81,53 @@ public AppSeenData withAppSeenList(List appSeenList) { */ public void validate() { if (appSeenList() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property appSeenList in model AppSeenData")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property appSeenList in model AppSeenData")); } else { appSeenList().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(AppSeenData.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("count", this.count); + jsonWriter.writeArrayField("appSeenList", this.appSeenList, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppSeenData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppSeenData if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AppSeenData. + */ + public static AppSeenData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppSeenData deserializedAppSeenData = new AppSeenData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("count".equals(fieldName)) { + deserializedAppSeenData.count = reader.getInt(); + } else if ("appSeenList".equals(fieldName)) { + List appSeenList = reader.readArray(reader1 -> AppSeenInfo.fromJson(reader1)); + deserializedAppSeenData.appSeenList = appSeenList; + } else { + reader.skipChildren(); + } + } + + return deserializedAppSeenData; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AppSeenInfo.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AppSeenInfo.java index 5d9223c5db54e..4e8adec85ea8b 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AppSeenInfo.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AppSeenInfo.java @@ -6,53 +6,50 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Definition for App Seen. */ @Fluent -public final class AppSeenInfo { +public final class AppSeenInfo implements JsonSerializable { /* * title */ - @JsonProperty(value = "title", required = true) private String title; /* * category */ - @JsonProperty(value = "category", required = true) private String category; /* * subCategory */ - @JsonProperty(value = "subCategory", required = true) private String subCategory; /* * risk */ - @JsonProperty(value = "risk", required = true) private String risk; /* * tag */ - @JsonProperty(value = "tag", required = true) private String tag; /* * technology */ - @JsonProperty(value = "technology", required = true) private String technology; /* * standardPorts */ - @JsonProperty(value = "standardPorts", required = true) private String standardPorts; /** @@ -208,34 +205,89 @@ public AppSeenInfo withStandardPorts(String standardPorts) { */ public void validate() { if (title() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property title in model AppSeenInfo")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property title in model AppSeenInfo")); } if (category() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property category in model AppSeenInfo")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property category in model AppSeenInfo")); } if (subCategory() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property subCategory in model AppSeenInfo")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property subCategory in model AppSeenInfo")); } if (risk() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property risk in model AppSeenInfo")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property risk in model AppSeenInfo")); } if (tag() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property tag in model AppSeenInfo")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property tag in model AppSeenInfo")); } if (technology() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property technology in model AppSeenInfo")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property technology in model AppSeenInfo")); } if (standardPorts() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property standardPorts in model AppSeenInfo")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property standardPorts in model AppSeenInfo")); } } private static final ClientLogger LOGGER = new ClientLogger(AppSeenInfo.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("title", this.title); + jsonWriter.writeStringField("category", this.category); + jsonWriter.writeStringField("subCategory", this.subCategory); + jsonWriter.writeStringField("risk", this.risk); + jsonWriter.writeStringField("tag", this.tag); + jsonWriter.writeStringField("technology", this.technology); + jsonWriter.writeStringField("standardPorts", this.standardPorts); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppSeenInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppSeenInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AppSeenInfo. + */ + public static AppSeenInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppSeenInfo deserializedAppSeenInfo = new AppSeenInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("title".equals(fieldName)) { + deserializedAppSeenInfo.title = reader.getString(); + } else if ("category".equals(fieldName)) { + deserializedAppSeenInfo.category = reader.getString(); + } else if ("subCategory".equals(fieldName)) { + deserializedAppSeenInfo.subCategory = reader.getString(); + } else if ("risk".equals(fieldName)) { + deserializedAppSeenInfo.risk = reader.getString(); + } else if ("tag".equals(fieldName)) { + deserializedAppSeenInfo.tag = reader.getString(); + } else if ("technology".equals(fieldName)) { + deserializedAppSeenInfo.technology = reader.getString(); + } else if ("standardPorts".equals(fieldName)) { + deserializedAppSeenInfo.standardPorts = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAppSeenInfo; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ApplicationInsights.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ApplicationInsights.java index 81e5fcbfc76b3..47b4291171881 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ApplicationInsights.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ApplicationInsights.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Application Insights key. */ @Fluent -public final class ApplicationInsights { +public final class ApplicationInsights implements JsonSerializable { /* * Resource id for Application Insights */ - @JsonProperty(value = "id") private String id; /* * Application Insights key */ - @JsonProperty(value = "key") private String key; /** @@ -77,4 +79,43 @@ public ApplicationInsights withKey(String key) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("key", this.key); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationInsights from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationInsights if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationInsights. + */ + public static ApplicationInsights fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationInsights deserializedApplicationInsights = new ApplicationInsights(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationInsights.id = reader.getString(); + } else if ("key".equals(fieldName)) { + deserializedApplicationInsights.key = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationInsights; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AzureResourceManagerManagedIdentityProperties.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AzureResourceManagerManagedIdentityProperties.java index 03bcda98a7ab3..1ff9a33980be3 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AzureResourceManagerManagedIdentityProperties.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AzureResourceManagerManagedIdentityProperties.java @@ -6,38 +6,37 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** * The properties of the managed service identities assigned to this resource. */ @Fluent -public final class AzureResourceManagerManagedIdentityProperties { +public final class AzureResourceManagerManagedIdentityProperties + implements JsonSerializable { /* * The Active Directory tenant id of the principal. */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) private String tenantId; /* * The active directory identifier of this principal. */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) private String principalId; /* * The type of managed identity assigned to this resource. */ - @JsonProperty(value = "type", required = true) private ManagedIdentityType type; /* * The identities assigned to this resource by the user. */ - @JsonProperty(value = "userAssignedIdentities") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map userAssignedIdentities; /** @@ -112,8 +111,9 @@ public Map userAssignedIdentit */ public void validate() { if (type() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property type in model AzureResourceManagerManagedIdentityProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property type in model AzureResourceManagerManagedIdentityProperties")); } if (userAssignedIdentities() != null) { userAssignedIdentities().values().forEach(e -> { @@ -125,4 +125,54 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(AzureResourceManagerManagedIdentityProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureResourceManagerManagedIdentityProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureResourceManagerManagedIdentityProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureResourceManagerManagedIdentityProperties. + */ + public static AzureResourceManagerManagedIdentityProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureResourceManagerManagedIdentityProperties deserializedAzureResourceManagerManagedIdentityProperties + = new AzureResourceManagerManagedIdentityProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedAzureResourceManagerManagedIdentityProperties.type + = ManagedIdentityType.fromString(reader.getString()); + } else if ("tenantId".equals(fieldName)) { + deserializedAzureResourceManagerManagedIdentityProperties.tenantId = reader.getString(); + } else if ("principalId".equals(fieldName)) { + deserializedAzureResourceManagerManagedIdentityProperties.principalId = reader.getString(); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> AzureResourceManagerUserAssignedIdentity.fromJson(reader1)); + deserializedAzureResourceManagerManagedIdentityProperties.userAssignedIdentities + = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedAzureResourceManagerManagedIdentityProperties; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AzureResourceManagerUserAssignedIdentity.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AzureResourceManagerUserAssignedIdentity.java index 51747eab0df1c..5dcd2c341fed5 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AzureResourceManagerUserAssignedIdentity.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/AzureResourceManagerUserAssignedIdentity.java @@ -5,23 +5,26 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * A managed identity assigned by the user. */ @Fluent -public final class AzureResourceManagerUserAssignedIdentity { +public final class AzureResourceManagerUserAssignedIdentity + implements JsonSerializable { /* * The active directory client identifier for this principal. */ - @JsonProperty(value = "clientId") private String clientId; /* * The active directory identifier for this principal. */ - @JsonProperty(value = "principalId") private String principalId; /** @@ -77,4 +80,44 @@ public AzureResourceManagerUserAssignedIdentity withPrincipalId(String principal */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeStringField("principalId", this.principalId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureResourceManagerUserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureResourceManagerUserAssignedIdentity if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureResourceManagerUserAssignedIdentity. + */ + public static AzureResourceManagerUserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureResourceManagerUserAssignedIdentity deserializedAzureResourceManagerUserAssignedIdentity + = new AzureResourceManagerUserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientId".equals(fieldName)) { + deserializedAzureResourceManagerUserAssignedIdentity.clientId = reader.getString(); + } else if ("principalId".equals(fieldName)) { + deserializedAzureResourceManagerUserAssignedIdentity.principalId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureResourceManagerUserAssignedIdentity; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/BillingCycle.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/BillingCycle.java index 9f0d1d7805bd6..866efe5649d79 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/BillingCycle.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/BillingCycle.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public BillingCycle() { * @param name a name to look for. * @return the corresponding BillingCycle. */ - @JsonCreator public static BillingCycle fromString(String name) { return fromString(name, BillingCycle.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/BooleanEnum.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/BooleanEnum.java index 435d827b17916..d0082932073fd 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/BooleanEnum.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/BooleanEnum.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public BooleanEnum() { * @param name a name to look for. * @return the corresponding BooleanEnum. */ - @JsonCreator public static BooleanEnum fromString(String name) { return fromString(name, BooleanEnum.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/Category.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/Category.java index 10c83e7d2e390..99fd4a9df2fa4 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/Category.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/Category.java @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * URL/EDL to match. */ @Fluent -public final class Category { +public final class Category implements JsonSerializable { /* * custom URL */ - @JsonProperty(value = "urlCustom", required = true) private List urlCustom; /* * feed list */ - @JsonProperty(value = "feeds", required = true) private List feeds; /** @@ -79,14 +81,56 @@ public Category withFeeds(List feeds) { */ public void validate() { if (urlCustom() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property urlCustom in model Category")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property urlCustom in model Category")); } if (feeds() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property feeds in model Category")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property feeds in model Category")); } } private static final ClientLogger LOGGER = new ClientLogger(Category.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("urlCustom", this.urlCustom, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("feeds", this.feeds, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Category from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Category if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Category. + */ + public static Category fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Category deserializedCategory = new Category(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("urlCustom".equals(fieldName)) { + List urlCustom = reader.readArray(reader1 -> reader1.getString()); + deserializedCategory.urlCustom = urlCustom; + } else if ("feeds".equals(fieldName)) { + List feeds = reader.readArray(reader1 -> reader1.getString()); + deserializedCategory.feeds = feeds; + } else { + reader.skipChildren(); + } + } + + return deserializedCategory; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/CertificateObjectGlobalRulestackResourceListResult.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/CertificateObjectGlobalRulestackResourceListResult.java index df8aa63adfbe9..26784ed6b364a 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/CertificateObjectGlobalRulestackResourceListResult.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/CertificateObjectGlobalRulestackResourceListResult.java @@ -6,25 +6,28 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.CertificateObjectGlobalRulestackResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response of a CertificateObjectGlobalRulestackResource list operation. */ @Fluent -public final class CertificateObjectGlobalRulestackResourceListResult { +public final class CertificateObjectGlobalRulestackResourceListResult + implements JsonSerializable { /* * The items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -81,8 +84,9 @@ public CertificateObjectGlobalRulestackResourceListResult withNextLink(String ne */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property value in model CertificateObjectGlobalRulestackResourceListResult")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model CertificateObjectGlobalRulestackResourceListResult")); } else { value().forEach(e -> e.validate()); } @@ -90,4 +94,48 @@ public void validate() { private static final ClientLogger LOGGER = new ClientLogger(CertificateObjectGlobalRulestackResourceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CertificateObjectGlobalRulestackResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CertificateObjectGlobalRulestackResourceListResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CertificateObjectGlobalRulestackResourceListResult. + */ + public static CertificateObjectGlobalRulestackResourceListResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + CertificateObjectGlobalRulestackResourceListResult deserializedCertificateObjectGlobalRulestackResourceListResult + = new CertificateObjectGlobalRulestackResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CertificateObjectGlobalRulestackResourceInner.fromJson(reader1)); + deserializedCertificateObjectGlobalRulestackResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCertificateObjectGlobalRulestackResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCertificateObjectGlobalRulestackResourceListResult; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/CertificateObjectLocalRulestackResourceListResult.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/CertificateObjectLocalRulestackResourceListResult.java index 8bea44909f3d4..abfb6ecec2381 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/CertificateObjectLocalRulestackResourceListResult.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/CertificateObjectLocalRulestackResourceListResult.java @@ -6,25 +6,28 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.CertificateObjectLocalRulestackResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response of a CertificateObjectLocalRulestackResource list operation. */ @Fluent -public final class CertificateObjectLocalRulestackResourceListResult { +public final class CertificateObjectLocalRulestackResourceListResult + implements JsonSerializable { /* * The items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -81,8 +84,9 @@ public CertificateObjectLocalRulestackResourceListResult withNextLink(String nex */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property value in model CertificateObjectLocalRulestackResourceListResult")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model CertificateObjectLocalRulestackResourceListResult")); } else { value().forEach(e -> e.validate()); } @@ -90,4 +94,47 @@ public void validate() { private static final ClientLogger LOGGER = new ClientLogger(CertificateObjectLocalRulestackResourceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CertificateObjectLocalRulestackResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CertificateObjectLocalRulestackResourceListResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CertificateObjectLocalRulestackResourceListResult. + */ + public static CertificateObjectLocalRulestackResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CertificateObjectLocalRulestackResourceListResult deserializedCertificateObjectLocalRulestackResourceListResult + = new CertificateObjectLocalRulestackResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CertificateObjectLocalRulestackResourceInner.fromJson(reader1)); + deserializedCertificateObjectLocalRulestackResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCertificateObjectLocalRulestackResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCertificateObjectLocalRulestackResourceListResult; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/Country.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/Country.java index fe5d26a16350d..97858d7291df5 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/Country.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/Country.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Country Description. */ @Fluent -public final class Country { +public final class Country implements JsonSerializable { /* * country code */ - @JsonProperty(value = "code", required = true) private String code; /* * code description */ - @JsonProperty(value = "description") private String description; /** @@ -78,10 +80,49 @@ public Country withDescription(String description) { */ public void validate() { if (code() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property code in model Country")); + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property code in model Country")); } } private static final ClientLogger LOGGER = new ClientLogger(Country.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Country from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Country if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Country. + */ + public static Country fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Country deserializedCountry = new Country(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedCountry.code = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedCountry.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCountry; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/DecryptionRuleTypeEnum.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/DecryptionRuleTypeEnum.java index 1a3a7cc5874ac..f2f3c175aa0dd 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/DecryptionRuleTypeEnum.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/DecryptionRuleTypeEnum.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public DecryptionRuleTypeEnum() { * @param name a name to look for. * @return the corresponding DecryptionRuleTypeEnum. */ - @JsonCreator public static DecryptionRuleTypeEnum fromString(String name) { return fromString(name, DecryptionRuleTypeEnum.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/DefaultMode.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/DefaultMode.java index ed17c1b5f212e..7ee4c18ef3670 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/DefaultMode.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/DefaultMode.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public DefaultMode() { * @param name a name to look for. * @return the corresponding DefaultMode. */ - @JsonCreator public static DefaultMode fromString(String name) { return fromString(name, DefaultMode.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/DestinationAddr.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/DestinationAddr.java index fcb47f286c6b0..a13e78a1b654f 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/DestinationAddr.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/DestinationAddr.java @@ -5,42 +5,41 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * destination address. */ @Fluent -public final class DestinationAddr { +public final class DestinationAddr implements JsonSerializable { /* * special value 'any' */ - @JsonProperty(value = "cidrs") private List cidrs; /* * list of countries */ - @JsonProperty(value = "countries") private List countries; /* * list of feeds */ - @JsonProperty(value = "feeds") private List feeds; /* * prefix list */ - @JsonProperty(value = "prefixLists") private List prefixLists; /* * fqdn list */ - @JsonProperty(value = "fqdnLists") private List fqdnLists; /** @@ -156,4 +155,57 @@ public DestinationAddr withFqdnLists(List fqdnLists) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("cidrs", this.cidrs, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("countries", this.countries, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("feeds", this.feeds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("prefixLists", this.prefixLists, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("fqdnLists", this.fqdnLists, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DestinationAddr from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DestinationAddr if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DestinationAddr. + */ + public static DestinationAddr fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DestinationAddr deserializedDestinationAddr = new DestinationAddr(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cidrs".equals(fieldName)) { + List cidrs = reader.readArray(reader1 -> reader1.getString()); + deserializedDestinationAddr.cidrs = cidrs; + } else if ("countries".equals(fieldName)) { + List countries = reader.readArray(reader1 -> reader1.getString()); + deserializedDestinationAddr.countries = countries; + } else if ("feeds".equals(fieldName)) { + List feeds = reader.readArray(reader1 -> reader1.getString()); + deserializedDestinationAddr.feeds = feeds; + } else if ("prefixLists".equals(fieldName)) { + List prefixLists = reader.readArray(reader1 -> reader1.getString()); + deserializedDestinationAddr.prefixLists = prefixLists; + } else if ("fqdnLists".equals(fieldName)) { + List fqdnLists = reader.readArray(reader1 -> reader1.getString()); + deserializedDestinationAddr.fqdnLists = fqdnLists; + } else { + reader.skipChildren(); + } + } + + return deserializedDestinationAddr; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/DnsProxy.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/DnsProxy.java index 7c8b4b73efd6d..b0bd09b455be9 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/DnsProxy.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/DnsProxy.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public DnsProxy() { * @param name a name to look for. * @return the corresponding DnsProxy. */ - @JsonCreator public static DnsProxy fromString(String name) { return fromString(name, DnsProxy.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/DnsSettings.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/DnsSettings.java index 76e7348befddd..57996c8035195 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/DnsSettings.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/DnsSettings.java @@ -5,30 +5,31 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * DNS Proxy settings for Firewall. */ @Fluent -public final class DnsSettings { +public final class DnsSettings implements JsonSerializable { /* * Enable DNS proxy, disabled by default */ - @JsonProperty(value = "enableDnsProxy") private DnsProxy enableDnsProxy; /* * Enabled DNS proxy type, disabled by default */ - @JsonProperty(value = "enabledDnsType") private EnabledDnsType enabledDnsType; /* * List of IPs associated with the Firewall */ - @JsonProperty(value = "dnsServers") private List dnsServers; /** @@ -107,4 +108,49 @@ public void validate() { dnsServers().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("enableDnsProxy", + this.enableDnsProxy == null ? null : this.enableDnsProxy.toString()); + jsonWriter.writeStringField("enabledDnsType", + this.enabledDnsType == null ? null : this.enabledDnsType.toString()); + jsonWriter.writeArrayField("dnsServers", this.dnsServers, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DnsSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DnsSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DnsSettings. + */ + public static DnsSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DnsSettings deserializedDnsSettings = new DnsSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enableDnsProxy".equals(fieldName)) { + deserializedDnsSettings.enableDnsProxy = DnsProxy.fromString(reader.getString()); + } else if ("enabledDnsType".equals(fieldName)) { + deserializedDnsSettings.enabledDnsType = EnabledDnsType.fromString(reader.getString()); + } else if ("dnsServers".equals(fieldName)) { + List dnsServers = reader.readArray(reader1 -> IpAddress.fromJson(reader1)); + deserializedDnsSettings.dnsServers = dnsServers; + } else { + reader.skipChildren(); + } + } + + return deserializedDnsSettings; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/EgressNat.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/EgressNat.java index 837103cb456fa..1dfb0cf4f8bda 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/EgressNat.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/EgressNat.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public EgressNat() { * @param name a name to look for. * @return the corresponding EgressNat. */ - @JsonCreator public static EgressNat fromString(String name) { return fromString(name, EgressNat.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/EnabledDnsType.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/EnabledDnsType.java index 4f606060654a3..b751f1dfc903a 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/EnabledDnsType.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/EnabledDnsType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public EnabledDnsType() { * @param name a name to look for. * @return the corresponding EnabledDnsType. */ - @JsonCreator public static EnabledDnsType fromString(String name) { return fromString(name, EnabledDnsType.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/EndpointConfiguration.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/EndpointConfiguration.java index cc10438b71ea9..8f9947a7dcaec 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/EndpointConfiguration.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/EndpointConfiguration.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Endpoint Configuration for frontend and backend. */ @Fluent -public final class EndpointConfiguration { +public final class EndpointConfiguration implements JsonSerializable { /* * port ID */ - @JsonProperty(value = "port", required = true) private String port; /* * Address Space */ - @JsonProperty(value = "address", required = true) private IpAddress address; /** @@ -78,16 +80,56 @@ public EndpointConfiguration withAddress(IpAddress address) { */ public void validate() { if (port() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property port in model EndpointConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property port in model EndpointConfiguration")); } if (address() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property address in model EndpointConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property address in model EndpointConfiguration")); } else { address().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(EndpointConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("port", this.port); + jsonWriter.writeJsonField("address", this.address); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EndpointConfiguration. + */ + public static EndpointConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EndpointConfiguration deserializedEndpointConfiguration = new EndpointConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("port".equals(fieldName)) { + deserializedEndpointConfiguration.port = reader.getString(); + } else if ("address".equals(fieldName)) { + deserializedEndpointConfiguration.address = IpAddress.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpointConfiguration; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/EventHub.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/EventHub.java index c23e580f225d2..d2c365ffb4ade 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/EventHub.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/EventHub.java @@ -5,41 +5,40 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * EventHub configurations. */ @Fluent -public final class EventHub { +public final class EventHub implements JsonSerializable { /* * Resource ID of EventHub */ - @JsonProperty(value = "id") private String id; /* * Subscription Id */ - @JsonProperty(value = "subscriptionId") private String subscriptionId; /* * EventHub name */ - @JsonProperty(value = "name") private String name; /* * EventHub namespace */ - @JsonProperty(value = "nameSpace") private String nameSpace; /* * EventHub policy name */ - @JsonProperty(value = "policyName") private String policyName; /** @@ -155,4 +154,52 @@ public EventHub withPolicyName(String policyName) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("nameSpace", this.nameSpace); + jsonWriter.writeStringField("policyName", this.policyName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EventHub from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EventHub if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the EventHub. + */ + public static EventHub fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EventHub deserializedEventHub = new EventHub(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEventHub.id = reader.getString(); + } else if ("subscriptionId".equals(fieldName)) { + deserializedEventHub.subscriptionId = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEventHub.name = reader.getString(); + } else if ("nameSpace".equals(fieldName)) { + deserializedEventHub.nameSpace = reader.getString(); + } else if ("policyName".equals(fieldName)) { + deserializedEventHub.policyName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEventHub; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FirewallResource.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FirewallResource.java index d61092e801a89..82a77a3e24519 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FirewallResource.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FirewallResource.java @@ -534,7 +534,7 @@ interface WithProperties { /** * Log Profile for Firewall. * - * @param logSettings Log Settings for Firewall. + * @param logSettings The logSettings parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FirewallResourceListResult.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FirewallResourceListResult.java index 2f5a665373672..caff13437ea1c 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FirewallResourceListResult.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FirewallResourceListResult.java @@ -6,25 +6,27 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.FirewallResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response of a FirewallResource list operation. */ @Fluent -public final class FirewallResourceListResult { +public final class FirewallResourceListResult implements JsonSerializable { /* * The items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,55 @@ public FirewallResourceListResult withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model FirewallResourceListResult")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model FirewallResourceListResult")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(FirewallResourceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallResourceListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FirewallResourceListResult. + */ + public static FirewallResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallResourceListResult deserializedFirewallResourceListResult = new FirewallResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> FirewallResourceInner.fromJson(reader1)); + deserializedFirewallResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedFirewallResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallResourceListResult; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FirewallResourceUpdate.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FirewallResourceUpdate.java index b9046ae995862..3c31f72fefe6b 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FirewallResourceUpdate.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FirewallResourceUpdate.java @@ -5,32 +5,31 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** * The type used for update operations of the FirewallResource. */ @Fluent -public final class FirewallResourceUpdate { +public final class FirewallResourceUpdate implements JsonSerializable { /* * The managed service identities assigned to this resource. */ - @JsonProperty(value = "identity") private AzureResourceManagerManagedIdentityProperties identity; /* * Resource tags. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * The updatable properties of the FirewallResource. */ - @JsonProperty(value = "properties") private FirewallResourceUpdateProperties properties; /** @@ -112,4 +111,48 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallResourceUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallResourceUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallResourceUpdate. + */ + public static FirewallResourceUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallResourceUpdate deserializedFirewallResourceUpdate = new FirewallResourceUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedFirewallResourceUpdate.identity + = AzureResourceManagerManagedIdentityProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedFirewallResourceUpdate.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedFirewallResourceUpdate.properties = FirewallResourceUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallResourceUpdate; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FirewallResourceUpdateProperties.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FirewallResourceUpdateProperties.java index 6444aeb02b879..8153b9ce9508c 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FirewallResourceUpdateProperties.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FirewallResourceUpdateProperties.java @@ -5,66 +5,61 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * The updatable properties of the FirewallResource. */ @Fluent -public final class FirewallResourceUpdateProperties { +public final class FirewallResourceUpdateProperties implements JsonSerializable { /* * panEtag info */ - @JsonProperty(value = "panEtag") private String panEtag; /* * Network settings */ - @JsonProperty(value = "networkProfile") private NetworkProfile networkProfile; /* * Panorama Managed: Default is False. Default will be CloudSec managed */ - @JsonProperty(value = "isPanoramaManaged") private BooleanEnum isPanoramaManaged; /* * Panorama Configuration */ - @JsonProperty(value = "panoramaConfig") private PanoramaConfig panoramaConfig; /* * Associated Rulestack */ - @JsonProperty(value = "associatedRulestack") private RulestackDetails associatedRulestack; /* * DNS settings for Firewall */ - @JsonProperty(value = "dnsSettings") private DnsSettings dnsSettings; /* * Frontend settings for Firewall */ - @JsonProperty(value = "frontEndSettings") private List frontEndSettings; /* * Billing plan information. */ - @JsonProperty(value = "planData") private PlanData planData; /* * Marketplace details */ - @JsonProperty(value = "marketplaceDetails") private MarketplaceDetails marketplaceDetails; /** @@ -281,4 +276,72 @@ public void validate() { marketplaceDetails().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("panEtag", this.panEtag); + jsonWriter.writeJsonField("networkProfile", this.networkProfile); + jsonWriter.writeStringField("isPanoramaManaged", + this.isPanoramaManaged == null ? null : this.isPanoramaManaged.toString()); + jsonWriter.writeJsonField("panoramaConfig", this.panoramaConfig); + jsonWriter.writeJsonField("associatedRulestack", this.associatedRulestack); + jsonWriter.writeJsonField("dnsSettings", this.dnsSettings); + jsonWriter.writeArrayField("frontEndSettings", this.frontEndSettings, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("planData", this.planData); + jsonWriter.writeJsonField("marketplaceDetails", this.marketplaceDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallResourceUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallResourceUpdateProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallResourceUpdateProperties. + */ + public static FirewallResourceUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallResourceUpdateProperties deserializedFirewallResourceUpdateProperties + = new FirewallResourceUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("panEtag".equals(fieldName)) { + deserializedFirewallResourceUpdateProperties.panEtag = reader.getString(); + } else if ("networkProfile".equals(fieldName)) { + deserializedFirewallResourceUpdateProperties.networkProfile = NetworkProfile.fromJson(reader); + } else if ("isPanoramaManaged".equals(fieldName)) { + deserializedFirewallResourceUpdateProperties.isPanoramaManaged + = BooleanEnum.fromString(reader.getString()); + } else if ("panoramaConfig".equals(fieldName)) { + deserializedFirewallResourceUpdateProperties.panoramaConfig = PanoramaConfig.fromJson(reader); + } else if ("associatedRulestack".equals(fieldName)) { + deserializedFirewallResourceUpdateProperties.associatedRulestack + = RulestackDetails.fromJson(reader); + } else if ("dnsSettings".equals(fieldName)) { + deserializedFirewallResourceUpdateProperties.dnsSettings = DnsSettings.fromJson(reader); + } else if ("frontEndSettings".equals(fieldName)) { + List frontEndSettings + = reader.readArray(reader1 -> FrontendSetting.fromJson(reader1)); + deserializedFirewallResourceUpdateProperties.frontEndSettings = frontEndSettings; + } else if ("planData".equals(fieldName)) { + deserializedFirewallResourceUpdateProperties.planData = PlanData.fromJson(reader); + } else if ("marketplaceDetails".equals(fieldName)) { + deserializedFirewallResourceUpdateProperties.marketplaceDetails + = MarketplaceDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallResourceUpdateProperties; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FirewallStatusResourceListResult.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FirewallStatusResourceListResult.java index 0a29d389d96b6..3855af9f7417b 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FirewallStatusResourceListResult.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FirewallStatusResourceListResult.java @@ -6,25 +6,27 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.FirewallStatusResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response of a FirewallStatusResource list operation. */ @Fluent -public final class FirewallStatusResourceListResult { +public final class FirewallStatusResourceListResult implements JsonSerializable { /* * The items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,56 @@ public FirewallStatusResourceListResult withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property value in model FirewallStatusResourceListResult")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model FirewallStatusResourceListResult")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(FirewallStatusResourceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallStatusResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallStatusResourceListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FirewallStatusResourceListResult. + */ + public static FirewallStatusResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallStatusResourceListResult deserializedFirewallStatusResourceListResult + = new FirewallStatusResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> FirewallStatusResourceInner.fromJson(reader1)); + deserializedFirewallStatusResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedFirewallStatusResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallStatusResourceListResult; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/Firewalls.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/Firewalls.java index 20af26f016945..10bbb495779ce 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/Firewalls.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/Firewalls.java @@ -188,7 +188,7 @@ Response getSupportInfoWithResponse(String resourceGroupName, Strin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param firewallName Firewall resource name. - * @param logSettings Log Settings for Firewall. + * @param logSettings The logSettings parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FqdnListGlobalRulestackResourceListResult.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FqdnListGlobalRulestackResourceListResult.java index c75ae3735541d..b2010a0dca76f 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FqdnListGlobalRulestackResourceListResult.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FqdnListGlobalRulestackResourceListResult.java @@ -6,25 +6,28 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.FqdnListGlobalRulestackResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response of a FqdnListGlobalRulestackResource list operation. */ @Fluent -public final class FqdnListGlobalRulestackResourceListResult { +public final class FqdnListGlobalRulestackResourceListResult + implements JsonSerializable { /* * The items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +83,56 @@ public FqdnListGlobalRulestackResourceListResult withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property value in model FqdnListGlobalRulestackResourceListResult")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model FqdnListGlobalRulestackResourceListResult")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(FqdnListGlobalRulestackResourceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FqdnListGlobalRulestackResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FqdnListGlobalRulestackResourceListResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FqdnListGlobalRulestackResourceListResult. + */ + public static FqdnListGlobalRulestackResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FqdnListGlobalRulestackResourceListResult deserializedFqdnListGlobalRulestackResourceListResult + = new FqdnListGlobalRulestackResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> FqdnListGlobalRulestackResourceInner.fromJson(reader1)); + deserializedFqdnListGlobalRulestackResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedFqdnListGlobalRulestackResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFqdnListGlobalRulestackResourceListResult; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FqdnListLocalRulestackResourceListResult.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FqdnListLocalRulestackResourceListResult.java index 94a85843e8875..698361c86d3da 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FqdnListLocalRulestackResourceListResult.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FqdnListLocalRulestackResourceListResult.java @@ -6,25 +6,28 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.FqdnListLocalRulestackResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response of a FqdnListLocalRulestackResource list operation. */ @Fluent -public final class FqdnListLocalRulestackResourceListResult { +public final class FqdnListLocalRulestackResourceListResult + implements JsonSerializable { /* * The items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +83,56 @@ public FqdnListLocalRulestackResourceListResult withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property value in model FqdnListLocalRulestackResourceListResult")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model FqdnListLocalRulestackResourceListResult")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(FqdnListLocalRulestackResourceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FqdnListLocalRulestackResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FqdnListLocalRulestackResourceListResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FqdnListLocalRulestackResourceListResult. + */ + public static FqdnListLocalRulestackResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FqdnListLocalRulestackResourceListResult deserializedFqdnListLocalRulestackResourceListResult + = new FqdnListLocalRulestackResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> FqdnListLocalRulestackResourceInner.fromJson(reader1)); + deserializedFqdnListLocalRulestackResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedFqdnListLocalRulestackResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFqdnListLocalRulestackResourceListResult; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FrontendSetting.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FrontendSetting.java index d01c1c22158c4..380c91476abdb 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FrontendSetting.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/FrontendSetting.java @@ -6,35 +6,35 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Frontend setting for Firewall. */ @Fluent -public final class FrontendSetting { +public final class FrontendSetting implements JsonSerializable { /* * Settings name */ - @JsonProperty(value = "name", required = true) private String name; /* * Protocol Type */ - @JsonProperty(value = "protocol", required = true) private ProtocolType protocol; /* * Frontend configurations */ - @JsonProperty(value = "frontendConfiguration", required = true) private EndpointConfiguration frontendConfiguration; /* * Backend configurations */ - @JsonProperty(value = "backendConfiguration", required = true) private EndpointConfiguration backendConfiguration; /** @@ -130,26 +130,74 @@ public FrontendSetting withBackendConfiguration(EndpointConfiguration backendCon */ public void validate() { if (name() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property name in model FrontendSetting")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model FrontendSetting")); } if (protocol() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property protocol in model FrontendSetting")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property protocol in model FrontendSetting")); } if (frontendConfiguration() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property frontendConfiguration in model FrontendSetting")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property frontendConfiguration in model FrontendSetting")); } else { frontendConfiguration().validate(); } if (backendConfiguration() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property backendConfiguration in model FrontendSetting")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property backendConfiguration in model FrontendSetting")); } else { backendConfiguration().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(FrontendSetting.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeJsonField("frontendConfiguration", this.frontendConfiguration); + jsonWriter.writeJsonField("backendConfiguration", this.backendConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FrontendSetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FrontendSetting if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FrontendSetting. + */ + public static FrontendSetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FrontendSetting deserializedFrontendSetting = new FrontendSetting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedFrontendSetting.name = reader.getString(); + } else if ("protocol".equals(fieldName)) { + deserializedFrontendSetting.protocol = ProtocolType.fromString(reader.getString()); + } else if ("frontendConfiguration".equals(fieldName)) { + deserializedFrontendSetting.frontendConfiguration = EndpointConfiguration.fromJson(reader); + } else if ("backendConfiguration".equals(fieldName)) { + deserializedFrontendSetting.backendConfiguration = EndpointConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFrontendSetting; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/GlobalRulestackResourceListResult.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/GlobalRulestackResourceListResult.java index 55491995b3d13..b23731b73488f 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/GlobalRulestackResourceListResult.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/GlobalRulestackResourceListResult.java @@ -6,25 +6,27 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.GlobalRulestackResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response of a GlobalRulestackResource list operation. */ @Fluent -public final class GlobalRulestackResourceListResult { +public final class GlobalRulestackResourceListResult implements JsonSerializable { /* * The items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,56 @@ public GlobalRulestackResourceListResult withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property value in model GlobalRulestackResourceListResult")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model GlobalRulestackResourceListResult")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(GlobalRulestackResourceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GlobalRulestackResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GlobalRulestackResourceListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GlobalRulestackResourceListResult. + */ + public static GlobalRulestackResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GlobalRulestackResourceListResult deserializedGlobalRulestackResourceListResult + = new GlobalRulestackResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> GlobalRulestackResourceInner.fromJson(reader1)); + deserializedGlobalRulestackResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedGlobalRulestackResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGlobalRulestackResourceListResult; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/GlobalRulestackResourceUpdate.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/GlobalRulestackResourceUpdate.java index 0c1876bfaa38e..af9b60be79776 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/GlobalRulestackResourceUpdate.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/GlobalRulestackResourceUpdate.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The type used for update operations of the GlobalRulestackResource. */ @Fluent -public final class GlobalRulestackResourceUpdate { +public final class GlobalRulestackResourceUpdate implements JsonSerializable { /* * Global Location */ - @JsonProperty(value = "location") private String location; /* * The managed service identities assigned to this resource. */ - @JsonProperty(value = "identity") private AzureResourceManagerManagedIdentityProperties identity; /* * The updatable properties of the GlobalRulestackResource. */ - @JsonProperty(value = "properties") private GlobalRulestackResourceUpdateProperties properties; /** @@ -109,4 +110,49 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GlobalRulestackResourceUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GlobalRulestackResourceUpdate if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GlobalRulestackResourceUpdate. + */ + public static GlobalRulestackResourceUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GlobalRulestackResourceUpdate deserializedGlobalRulestackResourceUpdate + = new GlobalRulestackResourceUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("location".equals(fieldName)) { + deserializedGlobalRulestackResourceUpdate.location = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedGlobalRulestackResourceUpdate.identity + = AzureResourceManagerManagedIdentityProperties.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedGlobalRulestackResourceUpdate.properties + = GlobalRulestackResourceUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGlobalRulestackResourceUpdate; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/GlobalRulestackResourceUpdateProperties.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/GlobalRulestackResourceUpdateProperties.java index 496f0c770a36b..0b86aa686cd6c 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/GlobalRulestackResourceUpdateProperties.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/GlobalRulestackResourceUpdateProperties.java @@ -5,60 +5,57 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * The updatable properties of the GlobalRulestackResource. */ @Fluent -public final class GlobalRulestackResourceUpdateProperties { +public final class GlobalRulestackResourceUpdateProperties + implements JsonSerializable { /* * PanEtag info */ - @JsonProperty(value = "panEtag") private String panEtag; /* * Rulestack Location, Required for GlobalRulestacks, Not for LocalRulestacks */ - @JsonProperty(value = "panLocation") private String panLocation; /* * Rulestack Type */ - @JsonProperty(value = "scope") private ScopeType scope; /* * subscription scope of global rulestack */ - @JsonProperty(value = "associatedSubscriptions") private List associatedSubscriptions; /* * rulestack description */ - @JsonProperty(value = "description") private String description; /* * Mode for default rules creation */ - @JsonProperty(value = "defaultMode") private DefaultMode defaultMode; /* * minimum version */ - @JsonProperty(value = "minAppIdVersion") private String minAppIdVersion; /* * Security Profile */ - @JsonProperty(value = "securityServices") private SecurityServices securityServices; /** @@ -237,4 +234,68 @@ public void validate() { securityServices().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("panEtag", this.panEtag); + jsonWriter.writeStringField("panLocation", this.panLocation); + jsonWriter.writeStringField("scope", this.scope == null ? null : this.scope.toString()); + jsonWriter.writeArrayField("associatedSubscriptions", this.associatedSubscriptions, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("defaultMode", this.defaultMode == null ? null : this.defaultMode.toString()); + jsonWriter.writeStringField("minAppIdVersion", this.minAppIdVersion); + jsonWriter.writeJsonField("securityServices", this.securityServices); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GlobalRulestackResourceUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GlobalRulestackResourceUpdateProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GlobalRulestackResourceUpdateProperties. + */ + public static GlobalRulestackResourceUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GlobalRulestackResourceUpdateProperties deserializedGlobalRulestackResourceUpdateProperties + = new GlobalRulestackResourceUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("panEtag".equals(fieldName)) { + deserializedGlobalRulestackResourceUpdateProperties.panEtag = reader.getString(); + } else if ("panLocation".equals(fieldName)) { + deserializedGlobalRulestackResourceUpdateProperties.panLocation = reader.getString(); + } else if ("scope".equals(fieldName)) { + deserializedGlobalRulestackResourceUpdateProperties.scope + = ScopeType.fromString(reader.getString()); + } else if ("associatedSubscriptions".equals(fieldName)) { + List associatedSubscriptions = reader.readArray(reader1 -> reader1.getString()); + deserializedGlobalRulestackResourceUpdateProperties.associatedSubscriptions + = associatedSubscriptions; + } else if ("description".equals(fieldName)) { + deserializedGlobalRulestackResourceUpdateProperties.description = reader.getString(); + } else if ("defaultMode".equals(fieldName)) { + deserializedGlobalRulestackResourceUpdateProperties.defaultMode + = DefaultMode.fromString(reader.getString()); + } else if ("minAppIdVersion".equals(fieldName)) { + deserializedGlobalRulestackResourceUpdateProperties.minAppIdVersion = reader.getString(); + } else if ("securityServices".equals(fieldName)) { + deserializedGlobalRulestackResourceUpdateProperties.securityServices + = SecurityServices.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGlobalRulestackResourceUpdateProperties; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/HealthStatus.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/HealthStatus.java index cb788b7d7a16c..0853ea6a70f15 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/HealthStatus.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/HealthStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public HealthStatus() { * @param name a name to look for. * @return the corresponding HealthStatus. */ - @JsonCreator public static HealthStatus fromString(String name) { return fromString(name, HealthStatus.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/IpAddress.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/IpAddress.java index 7602694b28ed4..03db6212db4a8 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/IpAddress.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/IpAddress.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * IP Address. */ @Fluent -public final class IpAddress { +public final class IpAddress implements JsonSerializable { /* * Resource Id */ - @JsonProperty(value = "resourceId") private String resourceId; /* * Address value */ - @JsonProperty(value = "address") private String address; /** @@ -77,4 +79,43 @@ public IpAddress withAddress(String address) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("address", this.address); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpAddress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpAddress if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the IpAddress. + */ + public static IpAddress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpAddress deserializedIpAddress = new IpAddress(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedIpAddress.resourceId = reader.getString(); + } else if ("address".equals(fieldName)) { + deserializedIpAddress.address = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpAddress; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/IpAddressSpace.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/IpAddressSpace.java index 9a24975342c1f..dc3728b9c3006 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/IpAddressSpace.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/IpAddressSpace.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * IP Address Space. */ @Fluent -public final class IpAddressSpace { +public final class IpAddressSpace implements JsonSerializable { /* * Resource Id */ - @JsonProperty(value = "resourceId") private String resourceId; /* * Address Space */ - @JsonProperty(value = "addressSpace") private String addressSpace; /** @@ -77,4 +79,43 @@ public IpAddressSpace withAddressSpace(String addressSpace) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("addressSpace", this.addressSpace); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpAddressSpace from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpAddressSpace if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IpAddressSpace. + */ + public static IpAddressSpace fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpAddressSpace deserializedIpAddressSpace = new IpAddressSpace(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedIpAddressSpace.resourceId = reader.getString(); + } else if ("addressSpace".equals(fieldName)) { + deserializedIpAddressSpace.addressSpace = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpAddressSpace; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LocalRulesResourceListResult.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LocalRulesResourceListResult.java index 41563b16217a3..9f55b35f95e80 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LocalRulesResourceListResult.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LocalRulesResourceListResult.java @@ -6,25 +6,27 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.LocalRulesResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response of a LocalRulesResource list operation. */ @Fluent -public final class LocalRulesResourceListResult { +public final class LocalRulesResourceListResult implements JsonSerializable { /* * The items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,55 @@ public LocalRulesResourceListResult withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model LocalRulesResourceListResult")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model LocalRulesResourceListResult")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(LocalRulesResourceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LocalRulesResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocalRulesResourceListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LocalRulesResourceListResult. + */ + public static LocalRulesResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocalRulesResourceListResult deserializedLocalRulesResourceListResult = new LocalRulesResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> LocalRulesResourceInner.fromJson(reader1)); + deserializedLocalRulesResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLocalRulesResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLocalRulesResourceListResult; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LocalRulestackResourceListResult.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LocalRulestackResourceListResult.java index b11863ca7d684..908558fe4e19d 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LocalRulestackResourceListResult.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LocalRulestackResourceListResult.java @@ -6,25 +6,27 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.LocalRulestackResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response of a LocalRulestackResource list operation. */ @Fluent -public final class LocalRulestackResourceListResult { +public final class LocalRulestackResourceListResult implements JsonSerializable { /* * The items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,56 @@ public LocalRulestackResourceListResult withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property value in model LocalRulestackResourceListResult")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model LocalRulestackResourceListResult")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(LocalRulestackResourceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LocalRulestackResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocalRulestackResourceListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LocalRulestackResourceListResult. + */ + public static LocalRulestackResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocalRulestackResourceListResult deserializedLocalRulestackResourceListResult + = new LocalRulestackResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> LocalRulestackResourceInner.fromJson(reader1)); + deserializedLocalRulestackResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLocalRulestackResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLocalRulestackResourceListResult; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LocalRulestackResourceUpdate.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LocalRulestackResourceUpdate.java index 11d3c3ab01e3c..6f2443fc74bef 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LocalRulestackResourceUpdate.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LocalRulestackResourceUpdate.java @@ -5,32 +5,31 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** * The type used for update operations of the LocalRulestackResource. */ @Fluent -public final class LocalRulestackResourceUpdate { +public final class LocalRulestackResourceUpdate implements JsonSerializable { /* * The managed service identities assigned to this resource. */ - @JsonProperty(value = "identity") private AzureResourceManagerManagedIdentityProperties identity; /* * Resource tags. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * The updatable properties of the LocalRulestackResource. */ - @JsonProperty(value = "properties") private LocalRulestackResourceUpdateProperties properties; /** @@ -112,4 +111,49 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LocalRulestackResourceUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocalRulestackResourceUpdate if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LocalRulestackResourceUpdate. + */ + public static LocalRulestackResourceUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocalRulestackResourceUpdate deserializedLocalRulestackResourceUpdate = new LocalRulestackResourceUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedLocalRulestackResourceUpdate.identity + = AzureResourceManagerManagedIdentityProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLocalRulestackResourceUpdate.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedLocalRulestackResourceUpdate.properties + = LocalRulestackResourceUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLocalRulestackResourceUpdate; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LocalRulestackResourceUpdateProperties.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LocalRulestackResourceUpdateProperties.java index 635127ce459a5..def8d3f9abbe3 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LocalRulestackResourceUpdateProperties.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LocalRulestackResourceUpdateProperties.java @@ -5,60 +5,57 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * The updatable properties of the LocalRulestackResource. */ @Fluent -public final class LocalRulestackResourceUpdateProperties { +public final class LocalRulestackResourceUpdateProperties + implements JsonSerializable { /* * PanEtag info */ - @JsonProperty(value = "panEtag") private String panEtag; /* * Rulestack Location, Required for GlobalRulestacks, Not for LocalRulestacks */ - @JsonProperty(value = "panLocation") private String panLocation; /* * Rulestack Type */ - @JsonProperty(value = "scope") private ScopeType scope; /* * subscription scope of global rulestack */ - @JsonProperty(value = "associatedSubscriptions") private List associatedSubscriptions; /* * rulestack description */ - @JsonProperty(value = "description") private String description; /* * Mode for default rules creation */ - @JsonProperty(value = "defaultMode") private DefaultMode defaultMode; /* * minimum version */ - @JsonProperty(value = "minAppIdVersion") private String minAppIdVersion; /* * Security Profile */ - @JsonProperty(value = "securityServices") private SecurityServices securityServices; /** @@ -237,4 +234,67 @@ public void validate() { securityServices().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("panEtag", this.panEtag); + jsonWriter.writeStringField("panLocation", this.panLocation); + jsonWriter.writeStringField("scope", this.scope == null ? null : this.scope.toString()); + jsonWriter.writeArrayField("associatedSubscriptions", this.associatedSubscriptions, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("defaultMode", this.defaultMode == null ? null : this.defaultMode.toString()); + jsonWriter.writeStringField("minAppIdVersion", this.minAppIdVersion); + jsonWriter.writeJsonField("securityServices", this.securityServices); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LocalRulestackResourceUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocalRulestackResourceUpdateProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LocalRulestackResourceUpdateProperties. + */ + public static LocalRulestackResourceUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocalRulestackResourceUpdateProperties deserializedLocalRulestackResourceUpdateProperties + = new LocalRulestackResourceUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("panEtag".equals(fieldName)) { + deserializedLocalRulestackResourceUpdateProperties.panEtag = reader.getString(); + } else if ("panLocation".equals(fieldName)) { + deserializedLocalRulestackResourceUpdateProperties.panLocation = reader.getString(); + } else if ("scope".equals(fieldName)) { + deserializedLocalRulestackResourceUpdateProperties.scope = ScopeType.fromString(reader.getString()); + } else if ("associatedSubscriptions".equals(fieldName)) { + List associatedSubscriptions = reader.readArray(reader1 -> reader1.getString()); + deserializedLocalRulestackResourceUpdateProperties.associatedSubscriptions + = associatedSubscriptions; + } else if ("description".equals(fieldName)) { + deserializedLocalRulestackResourceUpdateProperties.description = reader.getString(); + } else if ("defaultMode".equals(fieldName)) { + deserializedLocalRulestackResourceUpdateProperties.defaultMode + = DefaultMode.fromString(reader.getString()); + } else if ("minAppIdVersion".equals(fieldName)) { + deserializedLocalRulestackResourceUpdateProperties.minAppIdVersion = reader.getString(); + } else if ("securityServices".equals(fieldName)) { + deserializedLocalRulestackResourceUpdateProperties.securityServices + = SecurityServices.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLocalRulestackResourceUpdateProperties; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LogDestination.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LogDestination.java index 094d57bbccffd..a6a78aa3d2e82 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LogDestination.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LogDestination.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Log Destination. */ @Fluent -public final class LogDestination { +public final class LogDestination implements JsonSerializable { /* * Storage account configurations */ - @JsonProperty(value = "storageConfigurations") private StorageAccount storageConfigurations; /* * Event Hub configurations */ - @JsonProperty(value = "eventHubConfigurations") private EventHub eventHubConfigurations; /* * Monitor Log configurations */ - @JsonProperty(value = "monitorConfigurations") private MonitorLog monitorConfigurations; /** @@ -112,4 +113,46 @@ public void validate() { monitorConfigurations().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("storageConfigurations", this.storageConfigurations); + jsonWriter.writeJsonField("eventHubConfigurations", this.eventHubConfigurations); + jsonWriter.writeJsonField("monitorConfigurations", this.monitorConfigurations); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogDestination from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogDestination if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LogDestination. + */ + public static LogDestination fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogDestination deserializedLogDestination = new LogDestination(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageConfigurations".equals(fieldName)) { + deserializedLogDestination.storageConfigurations = StorageAccount.fromJson(reader); + } else if ("eventHubConfigurations".equals(fieldName)) { + deserializedLogDestination.eventHubConfigurations = EventHub.fromJson(reader); + } else if ("monitorConfigurations".equals(fieldName)) { + deserializedLogDestination.monitorConfigurations = MonitorLog.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLogDestination; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LogOption.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LogOption.java index a01529cea8c93..79c96bb0c59ad 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LogOption.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LogOption.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public LogOption() { * @param name a name to look for. * @return the corresponding LogOption. */ - @JsonCreator public static LogOption fromString(String name) { return fromString(name, LogOption.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LogType.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LogType.java index 3a3f71cd6b1d0..b444bea1a1e56 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LogType.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/LogType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -57,7 +56,6 @@ public LogType() { * @param name a name to look for. * @return the corresponding LogType. */ - @JsonCreator public static LogType fromString(String name) { return fromString(name, LogType.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ManagedIdentityType.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ManagedIdentityType.java index d0a9e161ade03..b99b0d337b2ed 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ManagedIdentityType.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ManagedIdentityType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public ManagedIdentityType() { * @param name a name to look for. * @return the corresponding ManagedIdentityType. */ - @JsonCreator public static ManagedIdentityType fromString(String name) { return fromString(name, ManagedIdentityType.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/MarketplaceDetails.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/MarketplaceDetails.java index 5d1c356732e6a..2f40f201c3ecf 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/MarketplaceDetails.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/MarketplaceDetails.java @@ -6,35 +6,35 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * MarketplaceDetails of PAN Firewall resource. */ @Fluent -public final class MarketplaceDetails { +public final class MarketplaceDetails implements JsonSerializable { /* * Marketplace Subscription Id */ - @JsonProperty(value = "marketplaceSubscriptionId", access = JsonProperty.Access.WRITE_ONLY) private String marketplaceSubscriptionId; /* * Offer Id */ - @JsonProperty(value = "offerId", required = true) private String offerId; /* * Publisher Id */ - @JsonProperty(value = "publisherId", required = true) private String publisherId; /* * Marketplace Subscription Status */ - @JsonProperty(value = "marketplaceSubscriptionStatus") private MarketplaceSubscriptionStatus marketplaceSubscriptionStatus; /** @@ -120,14 +120,61 @@ public MarketplaceSubscriptionStatus marketplaceSubscriptionStatus() { */ public void validate() { if (offerId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property offerId in model MarketplaceDetails")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property offerId in model MarketplaceDetails")); } if (publisherId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property publisherId in model MarketplaceDetails")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property publisherId in model MarketplaceDetails")); } } private static final ClientLogger LOGGER = new ClientLogger(MarketplaceDetails.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("offerId", this.offerId); + jsonWriter.writeStringField("publisherId", this.publisherId); + jsonWriter.writeStringField("marketplaceSubscriptionStatus", + this.marketplaceSubscriptionStatus == null ? null : this.marketplaceSubscriptionStatus.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MarketplaceDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MarketplaceDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MarketplaceDetails. + */ + public static MarketplaceDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MarketplaceDetails deserializedMarketplaceDetails = new MarketplaceDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("offerId".equals(fieldName)) { + deserializedMarketplaceDetails.offerId = reader.getString(); + } else if ("publisherId".equals(fieldName)) { + deserializedMarketplaceDetails.publisherId = reader.getString(); + } else if ("marketplaceSubscriptionId".equals(fieldName)) { + deserializedMarketplaceDetails.marketplaceSubscriptionId = reader.getString(); + } else if ("marketplaceSubscriptionStatus".equals(fieldName)) { + deserializedMarketplaceDetails.marketplaceSubscriptionStatus + = MarketplaceSubscriptionStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMarketplaceDetails; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/MarketplaceSubscriptionStatus.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/MarketplaceSubscriptionStatus.java index 840b5c958b12e..0a00ff264fba2 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/MarketplaceSubscriptionStatus.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/MarketplaceSubscriptionStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -57,7 +56,6 @@ public MarketplaceSubscriptionStatus() { * @param name a name to look for. * @return the corresponding MarketplaceSubscriptionStatus. */ - @JsonCreator public static MarketplaceSubscriptionStatus fromString(String name) { return fromString(name, MarketplaceSubscriptionStatus.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/MonitorLog.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/MonitorLog.java index 8d9eb194a8cc7..a507e159717c7 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/MonitorLog.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/MonitorLog.java @@ -5,41 +5,40 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * MonitorLog configurations. */ @Fluent -public final class MonitorLog { +public final class MonitorLog implements JsonSerializable { /* * Resource ID of MonitorLog */ - @JsonProperty(value = "id") private String id; /* * Subscription Id */ - @JsonProperty(value = "subscriptionId") private String subscriptionId; /* * MonitorLog workspace */ - @JsonProperty(value = "workspace") private String workspace; /* * Primary Key value for Monitor */ - @JsonProperty(value = "primaryKey") private String primaryKey; /* * Secondary Key value for Monitor */ - @JsonProperty(value = "secondaryKey") private String secondaryKey; /** @@ -155,4 +154,52 @@ public MonitorLog withSecondaryKey(String secondaryKey) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + jsonWriter.writeStringField("workspace", this.workspace); + jsonWriter.writeStringField("primaryKey", this.primaryKey); + jsonWriter.writeStringField("secondaryKey", this.secondaryKey); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitorLog from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitorLog if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the MonitorLog. + */ + public static MonitorLog fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitorLog deserializedMonitorLog = new MonitorLog(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMonitorLog.id = reader.getString(); + } else if ("subscriptionId".equals(fieldName)) { + deserializedMonitorLog.subscriptionId = reader.getString(); + } else if ("workspace".equals(fieldName)) { + deserializedMonitorLog.workspace = reader.getString(); + } else if ("primaryKey".equals(fieldName)) { + deserializedMonitorLog.primaryKey = reader.getString(); + } else if ("secondaryKey".equals(fieldName)) { + deserializedMonitorLog.secondaryKey = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitorLog; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/NameDescriptionObject.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/NameDescriptionObject.java index 6c7ea1fe874a5..ed9124b1b1151 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/NameDescriptionObject.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/NameDescriptionObject.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * object type info. */ @Fluent -public final class NameDescriptionObject { +public final class NameDescriptionObject implements JsonSerializable { /* * name value */ - @JsonProperty(value = "name", required = true) private String name; /* * description value */ - @JsonProperty(value = "description") private String description; /** @@ -78,10 +80,50 @@ public NameDescriptionObject withDescription(String description) { */ public void validate() { if (name() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property name in model NameDescriptionObject")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model NameDescriptionObject")); } } private static final ClientLogger LOGGER = new ClientLogger(NameDescriptionObject.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NameDescriptionObject from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NameDescriptionObject if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NameDescriptionObject. + */ + public static NameDescriptionObject fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NameDescriptionObject deserializedNameDescriptionObject = new NameDescriptionObject(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNameDescriptionObject.name = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedNameDescriptionObject.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNameDescriptionObject; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/NetworkProfile.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/NetworkProfile.java index 99e23f773a177..ec435f4870a17 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/NetworkProfile.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/NetworkProfile.java @@ -6,54 +6,51 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Network settings for Firewall. */ @Fluent -public final class NetworkProfile { +public final class NetworkProfile implements JsonSerializable { /* * Vnet configurations */ - @JsonProperty(value = "vnetConfiguration") private VnetConfiguration vnetConfiguration; /* * Vwan configurations */ - @JsonProperty(value = "vwanConfiguration") private VwanConfiguration vwanConfiguration; /* * vnet or vwan, cannot be updated */ - @JsonProperty(value = "networkType", required = true) private NetworkType networkType; /* * List of IPs associated with the Firewall */ - @JsonProperty(value = "publicIps", required = true) private List publicIps; /* * Enable egress NAT, enabled by default */ - @JsonProperty(value = "enableEgressNat", required = true) private EgressNat enableEgressNat; /* * Egress nat IP to use */ - @JsonProperty(value = "egressNatIp") private List egressNatIp; /* * Non-RFC 1918 address */ - @JsonProperty(value = "trustedRanges") private List trustedRanges; /** @@ -215,18 +212,18 @@ public void validate() { vwanConfiguration().validate(); } if (networkType() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property networkType in model NetworkProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property networkType in model NetworkProfile")); } if (publicIps() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property publicIps in model NetworkProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property publicIps in model NetworkProfile")); } else { publicIps().forEach(e -> e.validate()); } if (enableEgressNat() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property enableEgressNat in model NetworkProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property enableEgressNat in model NetworkProfile")); } if (egressNatIp() != null) { egressNatIp().forEach(e -> e.validate()); @@ -234,4 +231,64 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(NetworkProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("networkType", this.networkType == null ? null : this.networkType.toString()); + jsonWriter.writeArrayField("publicIps", this.publicIps, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("enableEgressNat", + this.enableEgressNat == null ? null : this.enableEgressNat.toString()); + jsonWriter.writeJsonField("vnetConfiguration", this.vnetConfiguration); + jsonWriter.writeJsonField("vwanConfiguration", this.vwanConfiguration); + jsonWriter.writeArrayField("egressNatIp", this.egressNatIp, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("trustedRanges", this.trustedRanges, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkProfile. + */ + public static NetworkProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkProfile deserializedNetworkProfile = new NetworkProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkType".equals(fieldName)) { + deserializedNetworkProfile.networkType = NetworkType.fromString(reader.getString()); + } else if ("publicIps".equals(fieldName)) { + List publicIps = reader.readArray(reader1 -> IpAddress.fromJson(reader1)); + deserializedNetworkProfile.publicIps = publicIps; + } else if ("enableEgressNat".equals(fieldName)) { + deserializedNetworkProfile.enableEgressNat = EgressNat.fromString(reader.getString()); + } else if ("vnetConfiguration".equals(fieldName)) { + deserializedNetworkProfile.vnetConfiguration = VnetConfiguration.fromJson(reader); + } else if ("vwanConfiguration".equals(fieldName)) { + deserializedNetworkProfile.vwanConfiguration = VwanConfiguration.fromJson(reader); + } else if ("egressNatIp".equals(fieldName)) { + List egressNatIp = reader.readArray(reader1 -> IpAddress.fromJson(reader1)); + deserializedNetworkProfile.egressNatIp = egressNatIp; + } else if ("trustedRanges".equals(fieldName)) { + List trustedRanges = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkProfile.trustedRanges = trustedRanges; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkProfile; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/NetworkType.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/NetworkType.java index 51a08bbbddc15..5cb2b1f0412c2 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/NetworkType.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/NetworkType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public NetworkType() { * @param name a name to look for. * @return the corresponding NetworkType. */ - @JsonCreator public static NetworkType fromString(String name) { return fromString(name, NetworkType.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/OperationDisplay.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/OperationDisplay.java index 6a3ce318728de..70002a64f0b01 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/OperationDisplay.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/OperationDisplay.java @@ -5,38 +5,38 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Localized display information for this particular operation. */ @Immutable -public final class OperationDisplay { +public final class OperationDisplay implements JsonSerializable { /* - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft - * Compute". + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". */ - @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; /* - * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job - * Schedule Collections". + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". */ - @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) private String resource; /* - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual - * Machine", "Restart Virtual Machine". + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". */ - @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) private String operation; /* * The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; /** @@ -92,4 +92,45 @@ public String description() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/OperationListResult.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/OperationListResult.java index e854c2b5b3516..5749749c49600 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/OperationListResult.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/OperationListResult.java @@ -5,26 +5,28 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** - * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set - * of results. + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. */ @Immutable -public final class OperationListResult { +public final class OperationListResult implements JsonSerializable { /* * List of operations supported by the resource provider */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* * URL to get the next set of operation list results (if there are any). */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -61,4 +63,42 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/Origin.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/Origin.java index 52cf8544eaa03..7c85a1a2b53dd 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/Origin.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/Origin.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -43,7 +42,6 @@ public Origin() { * @param name a name to look for. * @return the corresponding Origin. */ - @JsonCreator public static Origin fromString(String name) { return fromString(name, Origin.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PanoramaConfig.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PanoramaConfig.java index 1586132ac1b38..e8ccf761d34ef 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PanoramaConfig.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PanoramaConfig.java @@ -6,60 +6,56 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Panorama Config. */ @Fluent -public final class PanoramaConfig { +public final class PanoramaConfig implements JsonSerializable { /* - * Base64 encoded string representing Panorama parameters to be used by Firewall to connect to Panorama. This - * string is generated via azure plugin in Panorama + * Base64 encoded string representing Panorama parameters to be used by Firewall to connect to Panorama. This string + * is generated via azure plugin in Panorama */ - @JsonProperty(value = "configString", required = true) private String configString; /* * VM auth key for panorama connectivity */ - @JsonProperty(value = "vmAuthKey", access = JsonProperty.Access.WRITE_ONLY) private String vmAuthKey; /* * Primary Panorama Server IP address value in dotted format for IPv4 */ - @JsonProperty(value = "panoramaServer", access = JsonProperty.Access.WRITE_ONLY) private String panoramaServer; /* * Secondary Panorama Server IP address value in dotted format for IPv4 */ - @JsonProperty(value = "panoramaServer2", access = JsonProperty.Access.WRITE_ONLY) private String panoramaServer2; /* * Panorama Device Group to join */ - @JsonProperty(value = "dgName", access = JsonProperty.Access.WRITE_ONLY) private String dgName; /* * Panorama Template Stack to join - (Once configured we can not edit the value) */ - @JsonProperty(value = "tplName", access = JsonProperty.Access.WRITE_ONLY) private String tplName; /* * Panorama Collector Group to join - (Once configured we can not edit the value) */ - @JsonProperty(value = "cgName", access = JsonProperty.Access.WRITE_ONLY) private String cgName; /* * Resource name(may be unique) for PN admin */ - @JsonProperty(value = "hostName", access = JsonProperty.Access.WRITE_ONLY) private String hostname; /** @@ -160,10 +156,61 @@ public String hostname() { */ public void validate() { if (configString() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property configString in model PanoramaConfig")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property configString in model PanoramaConfig")); } } private static final ClientLogger LOGGER = new ClientLogger(PanoramaConfig.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("configString", this.configString); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PanoramaConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PanoramaConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PanoramaConfig. + */ + public static PanoramaConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PanoramaConfig deserializedPanoramaConfig = new PanoramaConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("configString".equals(fieldName)) { + deserializedPanoramaConfig.configString = reader.getString(); + } else if ("vmAuthKey".equals(fieldName)) { + deserializedPanoramaConfig.vmAuthKey = reader.getString(); + } else if ("panoramaServer".equals(fieldName)) { + deserializedPanoramaConfig.panoramaServer = reader.getString(); + } else if ("panoramaServer2".equals(fieldName)) { + deserializedPanoramaConfig.panoramaServer2 = reader.getString(); + } else if ("dgName".equals(fieldName)) { + deserializedPanoramaConfig.dgName = reader.getString(); + } else if ("tplName".equals(fieldName)) { + deserializedPanoramaConfig.tplName = reader.getString(); + } else if ("cgName".equals(fieldName)) { + deserializedPanoramaConfig.cgName = reader.getString(); + } else if ("hostName".equals(fieldName)) { + deserializedPanoramaConfig.hostname = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPanoramaConfig; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PanoramaStatus.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PanoramaStatus.java index eeb2e4f1680bd..f243c9192f71a 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PanoramaStatus.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PanoramaStatus.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Panorama connectivity information. */ @Immutable -public final class PanoramaStatus { +public final class PanoramaStatus implements JsonSerializable { /* * Primary Panorama connection status */ - @JsonProperty(value = "panoramaServerStatus", access = JsonProperty.Access.WRITE_ONLY) private ServerStatus panoramaServerStatus; /* * Secondary Panorama connection status */ - @JsonProperty(value = "panoramaServer2Status", access = JsonProperty.Access.WRITE_ONLY) private ServerStatus panoramaServer2Status; /** @@ -55,4 +57,41 @@ public ServerStatus panoramaServer2Status() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PanoramaStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PanoramaStatus if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PanoramaStatus. + */ + public static PanoramaStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PanoramaStatus deserializedPanoramaStatus = new PanoramaStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("panoramaServerStatus".equals(fieldName)) { + deserializedPanoramaStatus.panoramaServerStatus = ServerStatus.fromString(reader.getString()); + } else if ("panoramaServer2Status".equals(fieldName)) { + deserializedPanoramaStatus.panoramaServer2Status = ServerStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPanoramaStatus; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PlanData.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PlanData.java index f5e8b4c25d2a7..c2849ce39a986 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PlanData.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PlanData.java @@ -5,37 +5,38 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; /** * Billing plan information. */ @Fluent -public final class PlanData { +public final class PlanData implements JsonSerializable { /* * different usage type like PAYG/COMMITTED */ - @JsonProperty(value = "usageType") private UsageType usageType; /* * different billing cycles like MONTHLY/WEEKLY */ - @JsonProperty(value = "billingCycle", required = true) private BillingCycle billingCycle; /* * plan id as published by Liftr.PAN */ - @JsonProperty(value = "planId", required = true) private String planId; /* * date when plan was applied */ - @JsonProperty(value = "effectiveDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime effectiveDate; /** @@ -120,14 +121,60 @@ public OffsetDateTime effectiveDate() { */ public void validate() { if (billingCycle() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property billingCycle in model PlanData")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property billingCycle in model PlanData")); } if (planId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property planId in model PlanData")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property planId in model PlanData")); } } private static final ClientLogger LOGGER = new ClientLogger(PlanData.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("billingCycle", this.billingCycle == null ? null : this.billingCycle.toString()); + jsonWriter.writeStringField("planId", this.planId); + jsonWriter.writeStringField("usageType", this.usageType == null ? null : this.usageType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PlanData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PlanData if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PlanData. + */ + public static PlanData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PlanData deserializedPlanData = new PlanData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("billingCycle".equals(fieldName)) { + deserializedPlanData.billingCycle = BillingCycle.fromString(reader.getString()); + } else if ("planId".equals(fieldName)) { + deserializedPlanData.planId = reader.getString(); + } else if ("usageType".equals(fieldName)) { + deserializedPlanData.usageType = UsageType.fromString(reader.getString()); + } else if ("effectiveDate".equals(fieldName)) { + deserializedPlanData.effectiveDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedPlanData; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PostRulesResourceListResult.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PostRulesResourceListResult.java index 07b54791006db..46acc2edf4f93 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PostRulesResourceListResult.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PostRulesResourceListResult.java @@ -6,25 +6,27 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.PostRulesResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response of a PostRulesResource list operation. */ @Fluent -public final class PostRulesResourceListResult { +public final class PostRulesResourceListResult implements JsonSerializable { /* * The items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,55 @@ public PostRulesResourceListResult withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model PostRulesResourceListResult")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model PostRulesResourceListResult")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(PostRulesResourceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PostRulesResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PostRulesResourceListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PostRulesResourceListResult. + */ + public static PostRulesResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PostRulesResourceListResult deserializedPostRulesResourceListResult = new PostRulesResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PostRulesResourceInner.fromJson(reader1)); + deserializedPostRulesResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPostRulesResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPostRulesResourceListResult; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PreRulesResourceListResult.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PreRulesResourceListResult.java index 9b1bb8d2d5278..3551208a1ac9f 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PreRulesResourceListResult.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PreRulesResourceListResult.java @@ -6,25 +6,27 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.PreRulesResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response of a PreRulesResource list operation. */ @Fluent -public final class PreRulesResourceListResult { +public final class PreRulesResourceListResult implements JsonSerializable { /* * The items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,55 @@ public PreRulesResourceListResult withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model PreRulesResourceListResult")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model PreRulesResourceListResult")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(PreRulesResourceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PreRulesResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PreRulesResourceListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PreRulesResourceListResult. + */ + public static PreRulesResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PreRulesResourceListResult deserializedPreRulesResourceListResult = new PreRulesResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PreRulesResourceInner.fromJson(reader1)); + deserializedPreRulesResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPreRulesResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPreRulesResourceListResult; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PredefinedUrlCategory.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PredefinedUrlCategory.java index 02955895d864c..c4e8102c46223 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PredefinedUrlCategory.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PredefinedUrlCategory.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Predefined URL category object. */ @Fluent -public final class PredefinedUrlCategory { +public final class PredefinedUrlCategory implements JsonSerializable { /* * The action property. */ - @JsonProperty(value = "action", required = true) private String action; /* * The name property. */ - @JsonProperty(value = "name", required = true) private String name; /** @@ -78,14 +80,54 @@ public PredefinedUrlCategory withName(String name) { */ public void validate() { if (action() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property action in model PredefinedUrlCategory")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property action in model PredefinedUrlCategory")); } if (name() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property name in model PredefinedUrlCategory")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model PredefinedUrlCategory")); } } private static final ClientLogger LOGGER = new ClientLogger(PredefinedUrlCategory.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("action", this.action); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PredefinedUrlCategory from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PredefinedUrlCategory if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PredefinedUrlCategory. + */ + public static PredefinedUrlCategory fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PredefinedUrlCategory deserializedPredefinedUrlCategory = new PredefinedUrlCategory(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("action".equals(fieldName)) { + deserializedPredefinedUrlCategory.action = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPredefinedUrlCategory.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPredefinedUrlCategory; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PrefixListGlobalRulestackResourceListResult.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PrefixListGlobalRulestackResourceListResult.java index 252086202ee7b..d7a0b9e50b958 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PrefixListGlobalRulestackResourceListResult.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PrefixListGlobalRulestackResourceListResult.java @@ -6,25 +6,28 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.PrefixListGlobalRulestackResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response of a PrefixListGlobalRulestackResource list operation. */ @Fluent -public final class PrefixListGlobalRulestackResourceListResult { +public final class PrefixListGlobalRulestackResourceListResult + implements JsonSerializable { /* * The items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +83,56 @@ public PrefixListGlobalRulestackResourceListResult withNextLink(String nextLink) */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property value in model PrefixListGlobalRulestackResourceListResult")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model PrefixListGlobalRulestackResourceListResult")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(PrefixListGlobalRulestackResourceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrefixListGlobalRulestackResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrefixListGlobalRulestackResourceListResult if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrefixListGlobalRulestackResourceListResult. + */ + public static PrefixListGlobalRulestackResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrefixListGlobalRulestackResourceListResult deserializedPrefixListGlobalRulestackResourceListResult + = new PrefixListGlobalRulestackResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrefixListGlobalRulestackResourceInner.fromJson(reader1)); + deserializedPrefixListGlobalRulestackResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrefixListGlobalRulestackResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrefixListGlobalRulestackResourceListResult; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PrefixListResourceListResult.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PrefixListResourceListResult.java index 859a0d7e6e009..f5f819aef0b65 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PrefixListResourceListResult.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/PrefixListResourceListResult.java @@ -6,25 +6,27 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.PrefixListResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response of a PrefixListResource list operation. */ @Fluent -public final class PrefixListResourceListResult { +public final class PrefixListResourceListResult implements JsonSerializable { /* * The items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,55 @@ public PrefixListResourceListResult withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model PrefixListResourceListResult")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model PrefixListResourceListResult")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(PrefixListResourceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrefixListResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrefixListResourceListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrefixListResourceListResult. + */ + public static PrefixListResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrefixListResourceListResult deserializedPrefixListResourceListResult = new PrefixListResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrefixListResourceInner.fromJson(reader1)); + deserializedPrefixListResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrefixListResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrefixListResourceListResult; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ProtocolType.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ProtocolType.java index 4e2ca90ce7a09..ebe1c6d0071df 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ProtocolType.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ProtocolType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public ProtocolType() { * @param name a name to look for. * @return the corresponding ProtocolType. */ - @JsonCreator public static ProtocolType fromString(String name) { return fromString(name, ProtocolType.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ProvisioningState.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ProvisioningState.java index 971f9d7dc2bb4..8b0ff52be3f72 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ProvisioningState.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ProvisioningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -72,7 +71,6 @@ public ProvisioningState() { * @param name a name to look for. * @return the corresponding ProvisioningState. */ - @JsonCreator public static ProvisioningState fromString(String name) { return fromString(name, ProvisioningState.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ReadOnlyProvisioningState.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ReadOnlyProvisioningState.java index 1855b84f4e70e..4031a0d34c40f 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ReadOnlyProvisioningState.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ReadOnlyProvisioningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public ReadOnlyProvisioningState() { * @param name a name to look for. * @return the corresponding ReadOnlyProvisioningState. */ - @JsonCreator public static ReadOnlyProvisioningState fromString(String name) { return fromString(name, ReadOnlyProvisioningState.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/RulestackDetails.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/RulestackDetails.java index 5c566b558e297..5be94f5854c90 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/RulestackDetails.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/RulestackDetails.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Associated rulestack details. */ @Fluent -public final class RulestackDetails { +public final class RulestackDetails implements JsonSerializable { /* * Resource Id */ - @JsonProperty(value = "resourceId") private String resourceId; /* * Associated rulestack Id */ - @JsonProperty(value = "rulestackId") private String rulestackId; /* * Rulestack location */ - @JsonProperty(value = "location") private String location; /** @@ -103,4 +104,46 @@ public RulestackDetails withLocation(String location) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("rulestackId", this.rulestackId); + jsonWriter.writeStringField("location", this.location); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RulestackDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RulestackDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RulestackDetails. + */ + public static RulestackDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RulestackDetails deserializedRulestackDetails = new RulestackDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedRulestackDetails.resourceId = reader.getString(); + } else if ("rulestackId".equals(fieldName)) { + deserializedRulestackDetails.rulestackId = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedRulestackDetails.location = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRulestackDetails; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ScopeType.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ScopeType.java index cad7548bb7747..98df60c427764 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ScopeType.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ScopeType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public ScopeType() { * @param name a name to look for. * @return the corresponding ScopeType. */ - @JsonCreator public static ScopeType fromString(String name) { return fromString(name, ScopeType.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/SecurityServices.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/SecurityServices.java index f4e7a257c0f7b..7c89070526122 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/SecurityServices.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/SecurityServices.java @@ -5,59 +5,55 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * security services. */ @Fluent -public final class SecurityServices { +public final class SecurityServices implements JsonSerializable { /* * IPs Vulnerability Profile Data */ - @JsonProperty(value = "vulnerabilityProfile") private String vulnerabilityProfile; /* * Anti spyware Profile data */ - @JsonProperty(value = "antiSpywareProfile") private String antiSpywareProfile; /* * anti virus profile data */ - @JsonProperty(value = "antiVirusProfile") private String antiVirusProfile; /* * URL filtering profile data */ - @JsonProperty(value = "urlFilteringProfile") private String urlFilteringProfile; /* * File blocking profile data */ - @JsonProperty(value = "fileBlockingProfile") private String fileBlockingProfile; /* * DNS Subscription profile data */ - @JsonProperty(value = "dnsSubscription") private String dnsSubscription; /* * Untrusted Egress Decryption profile data */ - @JsonProperty(value = "outboundUnTrustCertificate") private String outboundUnTrustCertificate; /* * Trusted Egress Decryption profile data */ - @JsonProperty(value = "outboundTrustCertificate") private String outboundTrustCertificate; /** @@ -233,4 +229,61 @@ public SecurityServices withOutboundTrustCertificate(String outboundTrustCertifi */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vulnerabilityProfile", this.vulnerabilityProfile); + jsonWriter.writeStringField("antiSpywareProfile", this.antiSpywareProfile); + jsonWriter.writeStringField("antiVirusProfile", this.antiVirusProfile); + jsonWriter.writeStringField("urlFilteringProfile", this.urlFilteringProfile); + jsonWriter.writeStringField("fileBlockingProfile", this.fileBlockingProfile); + jsonWriter.writeStringField("dnsSubscription", this.dnsSubscription); + jsonWriter.writeStringField("outboundUnTrustCertificate", this.outboundUnTrustCertificate); + jsonWriter.writeStringField("outboundTrustCertificate", this.outboundTrustCertificate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityServices from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityServices if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityServices. + */ + public static SecurityServices fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityServices deserializedSecurityServices = new SecurityServices(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vulnerabilityProfile".equals(fieldName)) { + deserializedSecurityServices.vulnerabilityProfile = reader.getString(); + } else if ("antiSpywareProfile".equals(fieldName)) { + deserializedSecurityServices.antiSpywareProfile = reader.getString(); + } else if ("antiVirusProfile".equals(fieldName)) { + deserializedSecurityServices.antiVirusProfile = reader.getString(); + } else if ("urlFilteringProfile".equals(fieldName)) { + deserializedSecurityServices.urlFilteringProfile = reader.getString(); + } else if ("fileBlockingProfile".equals(fieldName)) { + deserializedSecurityServices.fileBlockingProfile = reader.getString(); + } else if ("dnsSubscription".equals(fieldName)) { + deserializedSecurityServices.dnsSubscription = reader.getString(); + } else if ("outboundUnTrustCertificate".equals(fieldName)) { + deserializedSecurityServices.outboundUnTrustCertificate = reader.getString(); + } else if ("outboundTrustCertificate".equals(fieldName)) { + deserializedSecurityServices.outboundTrustCertificate = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityServices; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/SecurityServicesTypeEnum.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/SecurityServicesTypeEnum.java index 24de01a6471ed..646b8f4980b00 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/SecurityServicesTypeEnum.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/SecurityServicesTypeEnum.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -57,7 +56,6 @@ public SecurityServicesTypeEnum() { * @param name a name to look for. * @return the corresponding SecurityServicesTypeEnum. */ - @JsonCreator public static SecurityServicesTypeEnum fromString(String name) { return fromString(name, SecurityServicesTypeEnum.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/SecurityServicesTypeList.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/SecurityServicesTypeList.java index c2914b29c4f96..d43086ef1e8e6 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/SecurityServicesTypeList.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/SecurityServicesTypeList.java @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Security services type list. */ @Fluent -public final class SecurityServicesTypeList { +public final class SecurityServicesTypeList implements JsonSerializable { /* * security services type */ - @JsonProperty(value = "type") private String type; /* * list */ - @JsonProperty(value = "entry", required = true) private List entry; /** @@ -79,12 +81,54 @@ public SecurityServicesTypeList withEntry(List entry) { */ public void validate() { if (entry() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property entry in model SecurityServicesTypeList")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property entry in model SecurityServicesTypeList")); } else { entry().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(SecurityServicesTypeList.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("entry", this.entry, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityServicesTypeList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityServicesTypeList if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SecurityServicesTypeList. + */ + public static SecurityServicesTypeList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityServicesTypeList deserializedSecurityServicesTypeList = new SecurityServicesTypeList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("entry".equals(fieldName)) { + List entry + = reader.readArray(reader1 -> NameDescriptionObject.fromJson(reader1)); + deserializedSecurityServicesTypeList.entry = entry; + } else if ("type".equals(fieldName)) { + deserializedSecurityServicesTypeList.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityServicesTypeList; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ServerStatus.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ServerStatus.java index 625b91295a5a8..16d7e9393277c 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ServerStatus.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/ServerStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public ServerStatus() { * @param name a name to look for. * @return the corresponding ServerStatus. */ - @JsonCreator public static ServerStatus fromString(String name) { return fromString(name, ServerStatus.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/SourceAddr.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/SourceAddr.java index afbf0d9cc1d1e..4e47fc2ff1b48 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/SourceAddr.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/SourceAddr.java @@ -5,36 +5,36 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Address properties. */ @Fluent -public final class SourceAddr { +public final class SourceAddr implements JsonSerializable { /* * special value 'any' */ - @JsonProperty(value = "cidrs") private List cidrs; /* * list of countries */ - @JsonProperty(value = "countries") private List countries; /* * list of feeds */ - @JsonProperty(value = "feeds") private List feeds; /* * prefix list */ - @JsonProperty(value = "prefixLists") private List prefixLists; /** @@ -130,4 +130,53 @@ public SourceAddr withPrefixLists(List prefixLists) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("cidrs", this.cidrs, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("countries", this.countries, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("feeds", this.feeds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("prefixLists", this.prefixLists, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SourceAddr from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SourceAddr if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the SourceAddr. + */ + public static SourceAddr fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SourceAddr deserializedSourceAddr = new SourceAddr(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cidrs".equals(fieldName)) { + List cidrs = reader.readArray(reader1 -> reader1.getString()); + deserializedSourceAddr.cidrs = cidrs; + } else if ("countries".equals(fieldName)) { + List countries = reader.readArray(reader1 -> reader1.getString()); + deserializedSourceAddr.countries = countries; + } else if ("feeds".equals(fieldName)) { + List feeds = reader.readArray(reader1 -> reader1.getString()); + deserializedSourceAddr.feeds = feeds; + } else if ("prefixLists".equals(fieldName)) { + List prefixLists = reader.readArray(reader1 -> reader1.getString()); + deserializedSourceAddr.prefixLists = prefixLists; + } else { + reader.skipChildren(); + } + } + + return deserializedSourceAddr; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/StateEnum.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/StateEnum.java index 3adc795d5c5ec..0d8398fb34953 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/StateEnum.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/StateEnum.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public StateEnum() { * @param name a name to look for. * @return the corresponding StateEnum. */ - @JsonCreator public static StateEnum fromString(String name) { return fromString(name, StateEnum.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/StorageAccount.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/StorageAccount.java index b47aeb5d056a2..9ed0631fd9d33 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/StorageAccount.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/StorageAccount.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Storage Account configurations. */ @Fluent -public final class StorageAccount { +public final class StorageAccount implements JsonSerializable { /* * Resource ID of storage account */ - @JsonProperty(value = "id") private String id; /* * Subscription Id */ - @JsonProperty(value = "subscriptionId") private String subscriptionId; /* * Storage account name */ - @JsonProperty(value = "accountName") private String accountName; /** @@ -103,4 +104,46 @@ public StorageAccount withAccountName(String accountName) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + jsonWriter.writeStringField("accountName", this.accountName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccount from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccount if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the StorageAccount. + */ + public static StorageAccount fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccount deserializedStorageAccount = new StorageAccount(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedStorageAccount.id = reader.getString(); + } else if ("subscriptionId".equals(fieldName)) { + deserializedStorageAccount.subscriptionId = reader.getString(); + } else if ("accountName".equals(fieldName)) { + deserializedStorageAccount.accountName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccount; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/TagInfo.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/TagInfo.java index fae40dd8114db..5278d280bd1c8 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/TagInfo.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/TagInfo.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Tag. */ @Fluent -public final class TagInfo { +public final class TagInfo implements JsonSerializable { /* * tag name */ - @JsonProperty(value = "key", required = true) private String key; /* * tag value */ - @JsonProperty(value = "value", required = true) private String value; /** @@ -78,14 +80,53 @@ public TagInfo withValue(String value) { */ public void validate() { if (key() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property key in model TagInfo")); + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property key in model TagInfo")); } if (value() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property value in model TagInfo")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model TagInfo")); } } private static final ClientLogger LOGGER = new ClientLogger(TagInfo.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagInfo if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TagInfo. + */ + public static TagInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagInfo deserializedTagInfo = new TagInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagInfo.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagInfo.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagInfo; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/UsageType.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/UsageType.java index 57618449bf7ff..e34ddb34b991f 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/UsageType.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/UsageType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.paloaltonetworks.ngfw.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public UsageType() { * @param name a name to look for. * @return the corresponding UsageType. */ - @JsonCreator public static UsageType fromString(String name) { return fromString(name, UsageType.class); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/VnetConfiguration.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/VnetConfiguration.java index 1cbf42172c3b5..21abe6f809fde 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/VnetConfiguration.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/VnetConfiguration.java @@ -6,35 +6,35 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * VnetInfo for Firewall Networking. */ @Fluent -public final class VnetConfiguration { +public final class VnetConfiguration implements JsonSerializable { /* * Azure Virtual Network */ - @JsonProperty(value = "vnet", required = true) private IpAddressSpace vnet; /* * Trust Subnet */ - @JsonProperty(value = "trustSubnet", required = true) private IpAddressSpace trustSubnet; /* * Untrust Subnet */ - @JsonProperty(value = "unTrustSubnet", required = true) private IpAddressSpace unTrustSubnet; /* * IP of trust subnet for UDR */ - @JsonProperty(value = "ipOfTrustSubnetForUdr") private IpAddress ipOfTrustSubnetForUdr; /** @@ -130,20 +130,21 @@ public VnetConfiguration withIpOfTrustSubnetForUdr(IpAddress ipOfTrustSubnetForU */ public void validate() { if (vnet() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property vnet in model VnetConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property vnet in model VnetConfiguration")); } else { vnet().validate(); } if (trustSubnet() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property trustSubnet in model VnetConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property trustSubnet in model VnetConfiguration")); } else { trustSubnet().validate(); } if (unTrustSubnet() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property unTrustSubnet in model VnetConfiguration")); + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property unTrustSubnet in model VnetConfiguration")); } else { unTrustSubnet().validate(); } @@ -153,4 +154,50 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(VnetConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("vnet", this.vnet); + jsonWriter.writeJsonField("trustSubnet", this.trustSubnet); + jsonWriter.writeJsonField("unTrustSubnet", this.unTrustSubnet); + jsonWriter.writeJsonField("ipOfTrustSubnetForUdr", this.ipOfTrustSubnetForUdr); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VnetConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VnetConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VnetConfiguration. + */ + public static VnetConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VnetConfiguration deserializedVnetConfiguration = new VnetConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vnet".equals(fieldName)) { + deserializedVnetConfiguration.vnet = IpAddressSpace.fromJson(reader); + } else if ("trustSubnet".equals(fieldName)) { + deserializedVnetConfiguration.trustSubnet = IpAddressSpace.fromJson(reader); + } else if ("unTrustSubnet".equals(fieldName)) { + deserializedVnetConfiguration.unTrustSubnet = IpAddressSpace.fromJson(reader); + } else if ("ipOfTrustSubnetForUdr".equals(fieldName)) { + deserializedVnetConfiguration.ipOfTrustSubnetForUdr = IpAddress.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVnetConfiguration; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/VwanConfiguration.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/VwanConfiguration.java index bd2fdb1d4e37e..56f022f5b6a67 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/VwanConfiguration.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/com/azure/resourcemanager/paloaltonetworks/ngfw/models/VwanConfiguration.java @@ -6,41 +6,40 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * VwanInfo for Firewall Networking. */ @Fluent -public final class VwanConfiguration { +public final class VwanConfiguration implements JsonSerializable { /* * Network Virtual Appliance resource ID */ - @JsonProperty(value = "networkVirtualApplianceId") private String networkVirtualApplianceId; /* * vHub Address */ - @JsonProperty(value = "vHub", required = true) private IpAddressSpace vHub; /* * Trust Subnet */ - @JsonProperty(value = "trustSubnet") private IpAddressSpace trustSubnet; /* * Untrust Subnet */ - @JsonProperty(value = "unTrustSubnet") private IpAddressSpace unTrustSubnet; /* * IP of trust subnet for UDR */ - @JsonProperty(value = "ipOfTrustSubnetForUdr") private IpAddress ipOfTrustSubnetForUdr; /** @@ -156,8 +155,8 @@ public VwanConfiguration withIpOfTrustSubnetForUdr(IpAddress ipOfTrustSubnetForU */ public void validate() { if (vHub() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property vHub in model VwanConfiguration")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property vHub in model VwanConfiguration")); } else { vHub().validate(); } @@ -173,4 +172,53 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(VwanConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("vHub", this.vHub); + jsonWriter.writeStringField("networkVirtualApplianceId", this.networkVirtualApplianceId); + jsonWriter.writeJsonField("trustSubnet", this.trustSubnet); + jsonWriter.writeJsonField("unTrustSubnet", this.unTrustSubnet); + jsonWriter.writeJsonField("ipOfTrustSubnetForUdr", this.ipOfTrustSubnetForUdr); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VwanConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VwanConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VwanConfiguration. + */ + public static VwanConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VwanConfiguration deserializedVwanConfiguration = new VwanConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vHub".equals(fieldName)) { + deserializedVwanConfiguration.vHub = IpAddressSpace.fromJson(reader); + } else if ("networkVirtualApplianceId".equals(fieldName)) { + deserializedVwanConfiguration.networkVirtualApplianceId = reader.getString(); + } else if ("trustSubnet".equals(fieldName)) { + deserializedVwanConfiguration.trustSubnet = IpAddressSpace.fromJson(reader); + } else if ("unTrustSubnet".equals(fieldName)) { + deserializedVwanConfiguration.unTrustSubnet = IpAddressSpace.fromJson(reader); + } else if ("ipOfTrustSubnetForUdr".equals(fieldName)) { + deserializedVwanConfiguration.ipOfTrustSubnetForUdr = IpAddress.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVwanConfiguration; + }); + } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/module-info.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/module-info.java index 2020691b9266d..0f67b73648fb3 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/module-info.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/java/module-info.java @@ -10,7 +10,6 @@ exports com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models; exports com.azure.resourcemanager.paloaltonetworks.ngfw.models; - opens com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models - to com.azure.core, com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.paloaltonetworks.ngfw.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models to com.azure.core; + opens com.azure.resourcemanager.paloaltonetworks.ngfw.models to com.azure.core; } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-paloaltonetworks-ngfw/proxy-config.json b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-paloaltonetworks-ngfw/proxy-config.json index 83664ba2b1282..a5f5d1a6649f5 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-paloaltonetworks-ngfw/proxy-config.json +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-paloaltonetworks-ngfw/proxy-config.json @@ -1 +1 @@ -[ [ "com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.GlobalRulestacksClientImpl$GlobalRulestacksService" ], [ "com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.CertificateObjectGlobalRulestacksClientImpl$CertificateObjectGlobalRulestacksService" ], [ "com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.FqdnListGlobalRulestacksClientImpl$FqdnListGlobalRulestacksService" ], [ "com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.PostRulesClientImpl$PostRulesService" ], [ "com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.PrefixListGlobalRulestacksClientImpl$PrefixListGlobalRulestacksService" ], [ "com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.PreRulesClientImpl$PreRulesService" ], [ "com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.FirewallsClientImpl$FirewallsService" ], [ "com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.LocalRulestacksClientImpl$LocalRulestacksService" ], [ "com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.FirewallStatusClientImpl$FirewallStatusService" ], [ "com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.CertificateObjectLocalRulestacksClientImpl$CertificateObjectLocalRulestacksService" ], [ "com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.FqdnListLocalRulestacksClientImpl$FqdnListLocalRulestacksService" ], [ "com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.LocalRulesClientImpl$LocalRulesService" ], [ "com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.PrefixListLocalRulestacksClientImpl$PrefixListLocalRulestacksService" ] ] \ No newline at end of file +[["com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.CertificateObjectGlobalRulestacksClientImpl$CertificateObjectGlobalRulestacksService"],["com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.CertificateObjectLocalRulestacksClientImpl$CertificateObjectLocalRulestacksService"],["com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.FirewallStatusClientImpl$FirewallStatusService"],["com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.FirewallsClientImpl$FirewallsService"],["com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.FqdnListGlobalRulestacksClientImpl$FqdnListGlobalRulestacksService"],["com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.FqdnListLocalRulestacksClientImpl$FqdnListLocalRulestacksService"],["com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.GlobalRulestacksClientImpl$GlobalRulestacksService"],["com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.LocalRulesClientImpl$LocalRulesService"],["com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.LocalRulestacksClientImpl$LocalRulestacksService"],["com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.PostRulesClientImpl$PostRulesService"],["com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.PreRulesClientImpl$PreRulesService"],["com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.PrefixListGlobalRulestacksClientImpl$PrefixListGlobalRulestacksService"],["com.azure.resourcemanager.paloaltonetworks.ngfw.implementation.PrefixListLocalRulestacksClientImpl$PrefixListLocalRulestacksService"]] \ No newline at end of file diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-paloaltonetworks-ngfw/reflect-config.json b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-paloaltonetworks-ngfw/reflect-config.json index 9964a6ac5c20b..0637a088a01e8 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-paloaltonetworks-ngfw/reflect-config.json +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-paloaltonetworks-ngfw/reflect-config.json @@ -1,556 +1 @@ -[ { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.GlobalRulestackResourceListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.GlobalRulestackResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.RulestackProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.SecurityServices", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.AzureResourceManagerManagedIdentityProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.AzureResourceManagerUserAssignedIdentity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.GlobalRulestackResourceUpdate", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.GlobalRulestackResourceUpdateProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.CertificateObjectGlobalRulestackResourceListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.CertificateObjectGlobalRulestackResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.CertificateObject", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.FqdnListGlobalRulestackResourceListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.FqdnListGlobalRulestackResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.FqdnObject", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.ChangelogInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.AdvSecurityObjectListResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.AdvSecurityObjectModel", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.NameDescriptionObject", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.ListAppIdResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.CountriesResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.Country", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.ListFirewallsResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.PredefinedUrlCategoriesResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.PredefinedUrlCategory", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.SecurityServicesResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.SecurityServicesTypeList", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.PostRulesResourceListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.PostRulesResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.RuleEntry", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.SourceAddr", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.DestinationAddr", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.Category", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.TagInfo", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.RuleCounterInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.AppSeenData", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.AppSeenInfo", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.RuleCounterResetInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.PrefixListGlobalRulestackResourceListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.PrefixListGlobalRulestackResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.PrefixObject", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.PreRulesResourceListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.PreRulesResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.OperationListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.OperationInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.OperationDisplay", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.FirewallResourceListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.FirewallResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.FirewallDeploymentProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.NetworkProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.VnetConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.IpAddressSpace", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.IpAddress", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.VwanConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.PanoramaConfig", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.RulestackDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.DnsSettings", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.FrontendSetting", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.EndpointConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.PlanData", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.MarketplaceDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.LocalRulestackResourceListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.LocalRulestackResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.FirewallResourceUpdate", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.FirewallResourceUpdateProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.GlobalRulestackInfoInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.LogSettingsInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.ApplicationInsights", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.LogDestination", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.StorageAccount", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.EventHub", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.MonitorLog", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.SupportInfoInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.FirewallStatusResourceListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.FirewallStatusResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.FirewallStatusProperty", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.PanoramaStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.LocalRulestackResourceUpdate", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.LocalRulestackResourceUpdateProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.CertificateObjectLocalRulestackResourceListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.CertificateObjectLocalRulestackResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.FqdnListLocalRulestackResourceListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.FqdnListLocalRulestackResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.LocalRulesResourceListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.LocalRulesResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.PrefixListResourceListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.PrefixListResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.ScopeType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.DefaultMode", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.ProvisioningState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.ManagedIdentityType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.AdvSecurityObjectTypeEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.SecurityServicesTypeEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.StateEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.ActionEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.DecryptionRuleTypeEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.Origin", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.ActionType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.NetworkType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.EgressNat", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.DnsProxy", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.EnabledDnsType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.ProtocolType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.UsageType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.BillingCycle", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.MarketplaceSubscriptionStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.LogType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.LogOption", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.HealthStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.ServerStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.paloaltonetworks.ngfw.models.ReadOnlyProvisioningState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -} ] \ No newline at end of file +[] \ No newline at end of file diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestackCreateOrUpdateSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestackCreateOrUpdateSamples.java index 3ee73e181679f..e2ca46e207627 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestackCreateOrUpdateSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestackCreateOrUpdateSamples.java @@ -23,9 +23,10 @@ public final class CertificateObjectGlobalRulestackCreateOrUpdateSamples { */ public static void certificateObjectGlobalRulestackCreateOrUpdateMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectGlobalRulestacks().createOrUpdate("praval", "armid1", - new CertificateObjectGlobalRulestackResourceInner().withCertificateSelfSigned(BooleanEnum.TRUE), - com.azure.core.util.Context.NONE); + manager.certificateObjectGlobalRulestacks() + .createOrUpdate("praval", "armid1", + new CertificateObjectGlobalRulestackResourceInner().withCertificateSelfSigned(BooleanEnum.TRUE), + com.azure.core.util.Context.NONE); } /* @@ -40,10 +41,13 @@ public static void certificateObjectGlobalRulestackCreateOrUpdateMinimumSetGen( */ public static void certificateObjectGlobalRulestackCreateOrUpdateMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectGlobalRulestacks().createOrUpdate("praval", "armid1", - new CertificateObjectGlobalRulestackResourceInner().withCertificateSignerResourceId("") - .withCertificateSelfSigned(BooleanEnum.TRUE).withAuditComment("comment").withDescription("description") - .withEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), - com.azure.core.util.Context.NONE); + manager.certificateObjectGlobalRulestacks() + .createOrUpdate("praval", "armid1", + new CertificateObjectGlobalRulestackResourceInner().withCertificateSignerResourceId("") + .withCertificateSelfSigned(BooleanEnum.TRUE) + .withAuditComment("comment") + .withDescription("description") + .withEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c27"), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestackGetSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestackGetSamples.java index 87997622323a8..ab9eecbc992fe 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestackGetSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestackGetSamples.java @@ -20,8 +20,8 @@ public final class CertificateObjectGlobalRulestackGetSamples { */ public static void certificateObjectGlobalRulestackGetMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectGlobalRulestacks().getWithResponse("praval", "armid1", - com.azure.core.util.Context.NONE); + manager.certificateObjectGlobalRulestacks() + .getWithResponse("praval", "armid1", com.azure.core.util.Context.NONE); } /* @@ -36,7 +36,7 @@ public static void certificateObjectGlobalRulestackGetMinimumSetGen( */ public static void certificateObjectGlobalRulestackGetMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectGlobalRulestacks().getWithResponse("praval", "armid1", - com.azure.core.util.Context.NONE); + manager.certificateObjectGlobalRulestacks() + .getWithResponse("praval", "armid1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestackCreateOrUpdateSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestackCreateOrUpdateSamples.java index 42cbaad1ad1ce..9b8834518f7ff 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestackCreateOrUpdateSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestackCreateOrUpdateSamples.java @@ -22,8 +22,11 @@ public final class CertificateObjectLocalRulestackCreateOrUpdateSamples { */ public static void certificateObjectLocalRulestackCreateOrUpdateMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectLocalRulestacks().define("armid1").withExistingLocalRulestack("rgopenapi", "lrs1") - .withCertificateSelfSigned(BooleanEnum.TRUE).create(); + manager.certificateObjectLocalRulestacks() + .define("armid1") + .withExistingLocalRulestack("rgopenapi", "lrs1") + .withCertificateSelfSigned(BooleanEnum.TRUE) + .create(); } /* @@ -38,8 +41,14 @@ public static void certificateObjectLocalRulestackCreateOrUpdateMinimumSetGen( */ public static void certificateObjectLocalRulestackCreateOrUpdateMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectLocalRulestacks().define("armid1").withExistingLocalRulestack("rgopenapi", "lrs1") - .withCertificateSelfSigned(BooleanEnum.TRUE).withCertificateSignerResourceId("").withAuditComment("comment") - .withDescription("description").withEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c27").create(); + manager.certificateObjectLocalRulestacks() + .define("armid1") + .withExistingLocalRulestack("rgopenapi", "lrs1") + .withCertificateSelfSigned(BooleanEnum.TRUE) + .withCertificateSignerResourceId("") + .withAuditComment("comment") + .withDescription("description") + .withEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c27") + .create(); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestackDeleteSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestackDeleteSamples.java index 82e7b343f1fb6..643e64a3ce85e 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestackDeleteSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestackDeleteSamples.java @@ -20,8 +20,8 @@ public final class CertificateObjectLocalRulestackDeleteSamples { */ public static void certificateObjectLocalRulestackDeleteMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectLocalRulestacks().delete("rgopenapi", "lrs1", "armid1", - com.azure.core.util.Context.NONE); + manager.certificateObjectLocalRulestacks() + .delete("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); } /* @@ -36,7 +36,7 @@ public static void certificateObjectLocalRulestackDeleteMaximumSetGen( */ public static void certificateObjectLocalRulestackDeleteMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectLocalRulestacks().delete("rgopenapi", "lrs1", "armid1", - com.azure.core.util.Context.NONE); + manager.certificateObjectLocalRulestacks() + .delete("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestackGetSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestackGetSamples.java index 7cfe6a73a20a8..cd759f68c6e7d 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestackGetSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestackGetSamples.java @@ -20,8 +20,8 @@ public final class CertificateObjectLocalRulestackGetSamples { */ public static void certificateObjectLocalRulestackGetMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectLocalRulestacks().getWithResponse("rgopenapi", "lrs1", "armid1", - com.azure.core.util.Context.NONE); + manager.certificateObjectLocalRulestacks() + .getWithResponse("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); } /* @@ -36,7 +36,7 @@ public static void certificateObjectLocalRulestackGetMaximumSetGen( */ public static void certificateObjectLocalRulestackGetMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectLocalRulestacks().getWithResponse("rgopenapi", "lrs1", "armid1", - com.azure.core.util.Context.NONE); + manager.certificateObjectLocalRulestacks() + .getWithResponse("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestackListByLocalRulestacksSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestackListByLocalRulestacksSamples.java index dffe35e7c0a8c..367290544ff8b 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestackListByLocalRulestacksSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestackListByLocalRulestacksSamples.java @@ -20,8 +20,8 @@ public final class CertificateObjectLocalRulestackListByLocalRulestacksSamples { */ public static void certificateObjectLocalRulestackListByLocalRulestacksMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectLocalRulestacks().listByLocalRulestacks("rgopenapi", "lrs1", - com.azure.core.util.Context.NONE); + manager.certificateObjectLocalRulestacks() + .listByLocalRulestacks("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); } /* @@ -36,7 +36,7 @@ public static void certificateObjectLocalRulestackListByLocalRulestacksMaximumSe */ public static void certificateObjectLocalRulestackListByLocalRulestacksMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.certificateObjectLocalRulestacks().listByLocalRulestacks("rgopenapi", "lrs1", - com.azure.core.util.Context.NONE); + manager.certificateObjectLocalRulestacks() + .listByLocalRulestacks("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsCreateOrUpdateSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsCreateOrUpdateSamples.java index 7a844c0ee34f9..b4666f8354c49 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsCreateOrUpdateSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsCreateOrUpdateSamples.java @@ -48,7 +48,10 @@ public final class FirewallsCreateOrUpdateSamples { */ public static void firewallsCreateOrUpdateMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.firewalls().define("firewall1").withRegion("eastus").withExistingResourceGroup("firewall-rg") + manager.firewalls() + .define("firewall1") + .withRegion("eastus") + .withExistingResourceGroup("firewall-rg") .withNetworkProfile(new NetworkProfile().withVnetConfiguration(new VnetConfiguration() .withVnet(new IpAddressSpace().withResourceId( "/subscriptions/2bf4a339-294d-4c25-b0b2-ef649e9f5c27/resourceGroups/os-liftr-integration/providers/Microsoft.Network/virtualNetworks/os-liftr-integration-vnet") @@ -90,17 +93,19 @@ public static void firewallsCreateOrUpdateMaximumSetGen( .withDnsServers(Arrays.asList(new IpAddress().withResourceId( "/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-egressNatIp1") .withAddress("20.22.92.111")))) - .withPlanData(new PlanData().withUsageType(UsageType.PAYG).withBillingCycle(BillingCycle.MONTHLY) + .withPlanData(new PlanData().withUsageType(UsageType.PAYG) + .withBillingCycle(BillingCycle.MONTHLY) .withPlanId("liftrpantestplan")) - .withMarketplaceDetails( - new MarketplaceDetails().withOfferId("liftr-pan-ame-test").withPublisherId("isvtestuklegacy") - .withMarketplaceSubscriptionStatus(MarketplaceSubscriptionStatus.PENDING_FULFILLMENT_START)) + .withMarketplaceDetails(new MarketplaceDetails().withOfferId("liftr-pan-ame-test") + .withPublisherId("isvtestuklegacy") + .withMarketplaceSubscriptionStatus(MarketplaceSubscriptionStatus.PENDING_FULFILLMENT_START)) .withTags(mapOf("tagName", "value")) .withIdentity(new AzureResourceManagerManagedIdentityProperties().withType(ManagedIdentityType.NONE) .withUserAssignedIdentities(mapOf("key16", new AzureResourceManagerUserAssignedIdentity().withClientId("aaaa") .withPrincipalId("aaaaaaaaaaaaaaa")))) - .withPanEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c12").withIsPanoramaManaged(BooleanEnum.TRUE) + .withPanEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c12") + .withIsPanoramaManaged(BooleanEnum.TRUE) .withPanoramaConfig(new PanoramaConfig().withConfigString("bas64EncodedString")) .withAssociatedRulestack( new RulestackDetails().withResourceId("lrs1").withRulestackId("PANRSID").withLocation("eastus")) @@ -129,7 +134,10 @@ public static void firewallsCreateOrUpdateMaximumSetGen( */ public static void firewallsCreateOrUpdateMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.firewalls().define("firewall1").withRegion("eastus").withExistingResourceGroup("firewall-rg") + manager.firewalls() + .define("firewall1") + .withRegion("eastus") + .withExistingResourceGroup("firewall-rg") .withNetworkProfile(new NetworkProfile().withNetworkType(NetworkType.VNET) .withPublicIps(Arrays.asList(new IpAddress().withResourceId( "/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-PublicIp1") diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsGetByResourceGroupSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsGetByResourceGroupSamples.java index 4ca4ad49a130d..4cf64abac75ba 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsGetByResourceGroupSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsGetByResourceGroupSamples.java @@ -20,8 +20,8 @@ public final class FirewallsGetByResourceGroupSamples { */ public static void firewallsGetMaximumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.firewalls().getByResourceGroupWithResponse("firewall-rg", "firewall1", - com.azure.core.util.Context.NONE); + manager.firewalls() + .getByResourceGroupWithResponse("firewall-rg", "firewall1", com.azure.core.util.Context.NONE); } /* @@ -36,7 +36,7 @@ public final class FirewallsGetByResourceGroupSamples { */ public static void firewallsGetMinimumSetGen(com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.firewalls().getByResourceGroupWithResponse("firewall-rg", "firewall1", - com.azure.core.util.Context.NONE); + manager.firewalls() + .getByResourceGroupWithResponse("firewall-rg", "firewall1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsGetGlobalRulestackSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsGetGlobalRulestackSamples.java index d8026fbc71f49..5e7585d15d08f 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsGetGlobalRulestackSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsGetGlobalRulestackSamples.java @@ -20,8 +20,8 @@ public final class FirewallsGetGlobalRulestackSamples { */ public static void firewallsGetGlobalRulestackMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.firewalls().getGlobalRulestackWithResponse("firewall-rg", "firewall1", - com.azure.core.util.Context.NONE); + manager.firewalls() + .getGlobalRulestackWithResponse("firewall-rg", "firewall1", com.azure.core.util.Context.NONE); } /* @@ -36,7 +36,7 @@ public static void firewallsGetGlobalRulestackMaximumSetGen( */ public static void firewallsGetGlobalRulestackMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.firewalls().getGlobalRulestackWithResponse("firewall-rg", "firewall1", - com.azure.core.util.Context.NONE); + manager.firewalls() + .getGlobalRulestackWithResponse("firewall-rg", "firewall1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsGetSupportInfoSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsGetSupportInfoSamples.java index 281c1a412e7cd..bd962ece6bf12 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsGetSupportInfoSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsGetSupportInfoSamples.java @@ -20,8 +20,8 @@ public final class FirewallsGetSupportInfoSamples { */ public static void firewallsGetSupportInfoMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.firewalls().getSupportInfoWithResponse("rgopenapi", "firewall1", null, - com.azure.core.util.Context.NONE); + manager.firewalls() + .getSupportInfoWithResponse("rgopenapi", "firewall1", null, com.azure.core.util.Context.NONE); } /* @@ -36,7 +36,7 @@ public static void firewallsGetSupportInfoMinimumSetGen( */ public static void firewallsGetSupportInfoMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.firewalls().getSupportInfoWithResponse("rgopenapi", "firewall1", "user1@domain.com", - com.azure.core.util.Context.NONE); + manager.firewalls() + .getSupportInfoWithResponse("rgopenapi", "firewall1", "user1@domain.com", com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsSaveLogProfileSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsSaveLogProfileSamples.java index 494bdde5b8887..b18d53c6b620f 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsSaveLogProfileSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsSaveLogProfileSamples.java @@ -29,43 +29,69 @@ public final class FirewallsSaveLogProfileSamples { */ public static void firewallsSaveLogProfileMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.firewalls().saveLogProfileWithResponse("firewall-rg", "firewall1", - new LogSettingsInner().withLogType(LogType.TRAFFIC).withLogOption(LogOption.SAME_DESTINATION) - .withApplicationInsights( - new ApplicationInsights().withId("aaaaaaaaaaaaaaaa").withKey("fakeTokenPlaceholder")) - .withCommonDestination(new LogDestination() - .withStorageConfigurations(new StorageAccount().withId("aaaaaaaaaaaaaaa") - .withSubscriptionId("aaaaaaaaa").withAccountName("aaaaaaaaaaaaaaaaaaaaaaa")) - .withEventHubConfigurations(new EventHub().withId("aaaaaaaaaa").withSubscriptionId("aaaaaaaaaa") - .withName("aaaaaaaa").withNameSpace("aaaaaaaaaaaaaaaaaaaaa").withPolicyName("aaaaaaaaaaaa")) - .withMonitorConfigurations(new MonitorLog().withId("aaaaaaaaaaaaaaaaaaa") - .withSubscriptionId("aaaaaaaaaaaaa").withWorkspace("aaaaaaaaaaa") - .withPrimaryKey("fakeTokenPlaceholder").withSecondaryKey("fakeTokenPlaceholder"))) - .withTrafficLogDestination(new LogDestination() - .withStorageConfigurations(new StorageAccount().withId("aaaaaaaaaaaaaaa") - .withSubscriptionId("aaaaaaaaa").withAccountName("aaaaaaaaaaaaaaaaaaaaaaa")) - .withEventHubConfigurations(new EventHub().withId("aaaaaaaaaa").withSubscriptionId("aaaaaaaaaa") - .withName("aaaaaaaa").withNameSpace("aaaaaaaaaaaaaaaaaaaaa").withPolicyName("aaaaaaaaaaaa")) - .withMonitorConfigurations(new MonitorLog().withId("aaaaaaaaaaaaaaaaaaa") - .withSubscriptionId("aaaaaaaaaaaaa").withWorkspace("aaaaaaaaaaa") - .withPrimaryKey("fakeTokenPlaceholder").withSecondaryKey("fakeTokenPlaceholder"))) - .withThreatLogDestination(new LogDestination() - .withStorageConfigurations(new StorageAccount().withId("aaaaaaaaaaaaaaa") - .withSubscriptionId("aaaaaaaaa").withAccountName("aaaaaaaaaaaaaaaaaaaaaaa")) - .withEventHubConfigurations(new EventHub().withId("aaaaaaaaaa").withSubscriptionId("aaaaaaaaaa") - .withName("aaaaaaaa").withNameSpace("aaaaaaaaaaaaaaaaaaaaa").withPolicyName("aaaaaaaaaaaa")) - .withMonitorConfigurations(new MonitorLog().withId("aaaaaaaaaaaaaaaaaaa") - .withSubscriptionId("aaaaaaaaaaaaa").withWorkspace("aaaaaaaaaaa") - .withPrimaryKey("fakeTokenPlaceholder").withSecondaryKey("fakeTokenPlaceholder"))) - .withDecryptLogDestination(new LogDestination() - .withStorageConfigurations(new StorageAccount().withId("aaaaaaaaaaaaaaa") - .withSubscriptionId("aaaaaaaaa").withAccountName("aaaaaaaaaaaaaaaaaaaaaaa")) - .withEventHubConfigurations(new EventHub().withId("aaaaaaaaaa").withSubscriptionId("aaaaaaaaaa") - .withName("aaaaaaaa").withNameSpace("aaaaaaaaaaaaaaaaaaaaa").withPolicyName("aaaaaaaaaaaa")) - .withMonitorConfigurations(new MonitorLog().withId("aaaaaaaaaaaaaaaaaaa") - .withSubscriptionId("aaaaaaaaaaaaa").withWorkspace("aaaaaaaaaaa") - .withPrimaryKey("fakeTokenPlaceholder").withSecondaryKey("fakeTokenPlaceholder"))), - com.azure.core.util.Context.NONE); + manager.firewalls() + .saveLogProfileWithResponse("firewall-rg", "firewall1", + new LogSettingsInner().withLogType(LogType.TRAFFIC) + .withLogOption(LogOption.SAME_DESTINATION) + .withApplicationInsights( + new ApplicationInsights().withId("aaaaaaaaaaaaaaaa").withKey("fakeTokenPlaceholder")) + .withCommonDestination(new LogDestination() + .withStorageConfigurations(new StorageAccount().withId("aaaaaaaaaaaaaaa") + .withSubscriptionId("aaaaaaaaa") + .withAccountName("aaaaaaaaaaaaaaaaaaaaaaa")) + .withEventHubConfigurations(new EventHub().withId("aaaaaaaaaa") + .withSubscriptionId("aaaaaaaaaa") + .withName("aaaaaaaa") + .withNameSpace("aaaaaaaaaaaaaaaaaaaaa") + .withPolicyName("aaaaaaaaaaaa")) + .withMonitorConfigurations(new MonitorLog().withId("aaaaaaaaaaaaaaaaaaa") + .withSubscriptionId("aaaaaaaaaaaaa") + .withWorkspace("aaaaaaaaaaa") + .withPrimaryKey("fakeTokenPlaceholder") + .withSecondaryKey("fakeTokenPlaceholder"))) + .withTrafficLogDestination(new LogDestination() + .withStorageConfigurations(new StorageAccount().withId("aaaaaaaaaaaaaaa") + .withSubscriptionId("aaaaaaaaa") + .withAccountName("aaaaaaaaaaaaaaaaaaaaaaa")) + .withEventHubConfigurations(new EventHub().withId("aaaaaaaaaa") + .withSubscriptionId("aaaaaaaaaa") + .withName("aaaaaaaa") + .withNameSpace("aaaaaaaaaaaaaaaaaaaaa") + .withPolicyName("aaaaaaaaaaaa")) + .withMonitorConfigurations(new MonitorLog().withId("aaaaaaaaaaaaaaaaaaa") + .withSubscriptionId("aaaaaaaaaaaaa") + .withWorkspace("aaaaaaaaaaa") + .withPrimaryKey("fakeTokenPlaceholder") + .withSecondaryKey("fakeTokenPlaceholder"))) + .withThreatLogDestination(new LogDestination() + .withStorageConfigurations(new StorageAccount().withId("aaaaaaaaaaaaaaa") + .withSubscriptionId("aaaaaaaaa") + .withAccountName("aaaaaaaaaaaaaaaaaaaaaaa")) + .withEventHubConfigurations(new EventHub().withId("aaaaaaaaaa") + .withSubscriptionId("aaaaaaaaaa") + .withName("aaaaaaaa") + .withNameSpace("aaaaaaaaaaaaaaaaaaaaa") + .withPolicyName("aaaaaaaaaaaa")) + .withMonitorConfigurations(new MonitorLog().withId("aaaaaaaaaaaaaaaaaaa") + .withSubscriptionId("aaaaaaaaaaaaa") + .withWorkspace("aaaaaaaaaaa") + .withPrimaryKey("fakeTokenPlaceholder") + .withSecondaryKey("fakeTokenPlaceholder"))) + .withDecryptLogDestination(new LogDestination() + .withStorageConfigurations(new StorageAccount().withId("aaaaaaaaaaaaaaa") + .withSubscriptionId("aaaaaaaaa") + .withAccountName("aaaaaaaaaaaaaaaaaaaaaaa")) + .withEventHubConfigurations(new EventHub().withId("aaaaaaaaaa") + .withSubscriptionId("aaaaaaaaaa") + .withName("aaaaaaaa") + .withNameSpace("aaaaaaaaaaaaaaaaaaaaa") + .withPolicyName("aaaaaaaaaaaa")) + .withMonitorConfigurations(new MonitorLog().withId("aaaaaaaaaaaaaaaaaaa") + .withSubscriptionId("aaaaaaaaaaaaa") + .withWorkspace("aaaaaaaaaaa") + .withPrimaryKey("fakeTokenPlaceholder") + .withSecondaryKey("fakeTokenPlaceholder"))), + com.azure.core.util.Context.NONE); } /* @@ -80,7 +106,7 @@ public static void firewallsSaveLogProfileMaximumSetGen( */ public static void firewallsSaveLogProfileMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.firewalls().saveLogProfileWithResponse("firewall-rg", "firewall1", null, - com.azure.core.util.Context.NONE); + manager.firewalls() + .saveLogProfileWithResponse("firewall-rg", "firewall1", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsUpdateSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsUpdateSamples.java index 588e982f7104e..a3e6a291397a8 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsUpdateSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsUpdateSamples.java @@ -51,7 +51,8 @@ public final class FirewallsUpdateSamples { public static void firewallsUpdateMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { FirewallResource resource = manager.firewalls() - .getByResourceGroupWithResponse("firewall-rg", "firewall1", com.azure.core.util.Context.NONE).getValue(); + .getByResourceGroupWithResponse("firewall-rg", "firewall1", com.azure.core.util.Context.NONE) + .getValue(); resource.update().apply(); } @@ -68,8 +69,10 @@ public static void firewallsUpdateMinimumSetGen( public static void firewallsUpdateMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { FirewallResource resource = manager.firewalls() - .getByResourceGroupWithResponse("firewall-rg", "firewall1", com.azure.core.util.Context.NONE).getValue(); - resource.update().withTags(mapOf("tagName", "value")) + .getByResourceGroupWithResponse("firewall-rg", "firewall1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("tagName", "value")) .withIdentity(new AzureResourceManagerManagedIdentityProperties().withType(ManagedIdentityType.NONE) .withUserAssignedIdentities(mapOf("key16", new AzureResourceManagerUserAssignedIdentity().withClientId("aaaa") @@ -114,7 +117,8 @@ public static void firewallsUpdateMaximumSetGen( .withIsPanoramaManaged(BooleanEnum.TRUE) .withPanoramaConfig(new PanoramaConfig().withConfigString("bas64EncodedString")) .withAssociatedRulestack(new RulestackDetails().withResourceId("aaaaaaaaaa") - .withRulestackId("aaaaaaaaaaaaaaaa").withLocation("eastus")) + .withRulestackId("aaaaaaaaaaaaaaaa") + .withLocation("eastus")) .withDnsSettings(new DnsSettings().withEnableDnsProxy(DnsProxy.DISABLED) .withEnabledDnsType(EnabledDnsType.CUSTOM) .withDnsServers(Arrays.asList(new IpAddress().withResourceId( @@ -130,11 +134,12 @@ public static void firewallsUpdateMaximumSetGen( .withAddress(new IpAddress().withResourceId( "/subscriptions/01c7d41f-afaf-464e-8a8b-5c6f9f98cee8/resourceGroups/mj-liftr-integration/providers/Microsoft.Network/publicIPAddresses/mj-liftr-integration-frontendSettingIp2") .withAddress("20.22.32.136"))))) - .withPlanData(new PlanData().withUsageType(UsageType.PAYG).withBillingCycle(BillingCycle.WEEKLY) + .withPlanData(new PlanData().withUsageType(UsageType.PAYG) + .withBillingCycle(BillingCycle.WEEKLY) .withPlanId("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) - .withMarketplaceDetails( - new MarketplaceDetails().withOfferId("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa").withPublisherId("aaaa") - .withMarketplaceSubscriptionStatus(MarketplaceSubscriptionStatus.PENDING_FULFILLMENT_START))) + .withMarketplaceDetails(new MarketplaceDetails().withOfferId("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + .withPublisherId("aaaa") + .withMarketplaceSubscriptionStatus(MarketplaceSubscriptionStatus.PENDING_FULFILLMENT_START))) .apply(); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListGlobalRulestackCreateOrUpdateSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListGlobalRulestackCreateOrUpdateSamples.java index 2f32a027c03a0..93894d3838d61 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListGlobalRulestackCreateOrUpdateSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListGlobalRulestackCreateOrUpdateSamples.java @@ -23,11 +23,13 @@ public final class FqdnListGlobalRulestackCreateOrUpdateSamples { */ public static void fqdnListGlobalRulestackCreateOrUpdateMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.fqdnListGlobalRulestacks().createOrUpdate("praval", "armid1", - new FqdnListGlobalRulestackResourceInner().withDescription("string") - .withFqdnList(Arrays.asList("string1", "string2")).withEtag("aaaaaaaaaaaaaaaaaa") - .withAuditComment("string"), - com.azure.core.util.Context.NONE); + manager.fqdnListGlobalRulestacks() + .createOrUpdate("praval", "armid1", + new FqdnListGlobalRulestackResourceInner().withDescription("string") + .withFqdnList(Arrays.asList("string1", "string2")) + .withEtag("aaaaaaaaaaaaaaaaaa") + .withAuditComment("string"), + com.azure.core.util.Context.NONE); } /* @@ -42,8 +44,9 @@ public static void fqdnListGlobalRulestackCreateOrUpdateMaximumSetGen( */ public static void fqdnListGlobalRulestackCreateOrUpdateMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.fqdnListGlobalRulestacks().createOrUpdate("praval", "armid1", - new FqdnListGlobalRulestackResourceInner().withFqdnList(Arrays.asList("string1", "string2")), - com.azure.core.util.Context.NONE); + manager.fqdnListGlobalRulestacks() + .createOrUpdate("praval", "armid1", + new FqdnListGlobalRulestackResourceInner().withFqdnList(Arrays.asList("string1", "string2")), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestackCreateOrUpdateSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestackCreateOrUpdateSamples.java index c6c2b6fd2067f..8cadae95eca52 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestackCreateOrUpdateSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestackCreateOrUpdateSamples.java @@ -22,9 +22,14 @@ public final class FqdnListLocalRulestackCreateOrUpdateSamples { */ public static void fqdnListLocalRulestackCreateOrUpdateMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.fqdnListLocalRulestacks().define("armid1").withExistingLocalRulestack("rgopenapi", "lrs1") - .withFqdnList(Arrays.asList("string1", "string2")).withDescription("string").withEtag("aaaaaaaaaaaaaaaaaa") - .withAuditComment("string").create(); + manager.fqdnListLocalRulestacks() + .define("armid1") + .withExistingLocalRulestack("rgopenapi", "lrs1") + .withFqdnList(Arrays.asList("string1", "string2")) + .withDescription("string") + .withEtag("aaaaaaaaaaaaaaaaaa") + .withAuditComment("string") + .create(); } /* @@ -39,7 +44,10 @@ public static void fqdnListLocalRulestackCreateOrUpdateMaximumSetGen( */ public static void fqdnListLocalRulestackCreateOrUpdateMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.fqdnListLocalRulestacks().define("armid1").withExistingLocalRulestack("rgopenapi", "lrs1") - .withFqdnList(Arrays.asList("string1", "string2")).create(); + manager.fqdnListLocalRulestacks() + .define("armid1") + .withExistingLocalRulestack("rgopenapi", "lrs1") + .withFqdnList(Arrays.asList("string1", "string2")) + .create(); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestackGetSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestackGetSamples.java index eb7e012212246..8e34887a14c1a 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestackGetSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestackGetSamples.java @@ -20,8 +20,8 @@ public final class FqdnListLocalRulestackGetSamples { */ public static void fqdnListLocalRulestackGetMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.fqdnListLocalRulestacks().getWithResponse("rgopenapi", "lrs1", "armid1", - com.azure.core.util.Context.NONE); + manager.fqdnListLocalRulestacks() + .getWithResponse("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); } /* @@ -36,7 +36,7 @@ public static void fqdnListLocalRulestackGetMinimumSetGen( */ public static void fqdnListLocalRulestackGetMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.fqdnListLocalRulestacks().getWithResponse("rgopenapi", "lrs1", "armid1", - com.azure.core.util.Context.NONE); + manager.fqdnListLocalRulestacks() + .getWithResponse("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackCreateOrUpdateSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackCreateOrUpdateSamples.java index d5a6755219bf1..ab1c2df71ff74 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackCreateOrUpdateSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackCreateOrUpdateSamples.java @@ -31,8 +31,9 @@ public final class GlobalRulestackCreateOrUpdateSamples { */ public static void globalRulestackCreateOrUpdateMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().createOrUpdate("praval", new GlobalRulestackResourceInner().withLocation("eastus"), - com.azure.core.util.Context.NONE); + manager.globalRulestacks() + .createOrUpdate("praval", new GlobalRulestackResourceInner().withLocation("eastus"), + com.azure.core.util.Context.NONE); } /* @@ -47,19 +48,29 @@ public static void globalRulestackCreateOrUpdateMinimumSetGen( */ public static void globalRulestackCreateOrUpdateMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().createOrUpdate("praval", new GlobalRulestackResourceInner().withLocation("eastus") - .withIdentity(new AzureResourceManagerManagedIdentityProperties().withType(ManagedIdentityType.NONE) - .withUserAssignedIdentities(mapOf("key16", - new AzureResourceManagerUserAssignedIdentity().withClientId("aaaa") - .withPrincipalId("aaaaaaaaaaaaaaa")))) - .withPanEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c12").withPanLocation("eastus").withScope(ScopeType.GLOBAL) - .withAssociatedSubscriptions(Arrays.asList("2bf4a339-294d-4c25-b0b2-ef649e9f5c27")) - .withDescription("global rulestacks").withDefaultMode(DefaultMode.IPS).withMinAppIdVersion("8.5.3") - .withSecurityServices(new SecurityServices().withVulnerabilityProfile("default") - .withAntiSpywareProfile("default").withAntiVirusProfile("default").withUrlFilteringProfile("default") - .withFileBlockingProfile("default").withDnsSubscription("default") - .withOutboundUnTrustCertificate("default").withOutboundTrustCertificate("default")), - com.azure.core.util.Context.NONE); + manager.globalRulestacks() + .createOrUpdate("praval", + new GlobalRulestackResourceInner().withLocation("eastus") + .withIdentity(new AzureResourceManagerManagedIdentityProperties().withType(ManagedIdentityType.NONE) + .withUserAssignedIdentities(mapOf("key16", + new AzureResourceManagerUserAssignedIdentity().withClientId("aaaa") + .withPrincipalId("aaaaaaaaaaaaaaa")))) + .withPanEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c12") + .withPanLocation("eastus") + .withScope(ScopeType.GLOBAL) + .withAssociatedSubscriptions(Arrays.asList("2bf4a339-294d-4c25-b0b2-ef649e9f5c27")) + .withDescription("global rulestacks") + .withDefaultMode(DefaultMode.IPS) + .withMinAppIdVersion("8.5.3") + .withSecurityServices(new SecurityServices().withVulnerabilityProfile("default") + .withAntiSpywareProfile("default") + .withAntiVirusProfile("default") + .withUrlFilteringProfile("default") + .withFileBlockingProfile("default") + .withDnsSubscription("default") + .withOutboundUnTrustCertificate("default") + .withOutboundTrustCertificate("default")), + com.azure.core.util.Context.NONE); } // Use "Map.of" if available diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackListAdvancedSecurityObjectsSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackListAdvancedSecurityObjectsSamples.java index 00f2d4b5068d3..85f1d3fcbdef5 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackListAdvancedSecurityObjectsSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackListAdvancedSecurityObjectsSamples.java @@ -22,8 +22,9 @@ public final class GlobalRulestackListAdvancedSecurityObjectsSamples { */ public static void globalRulestackListAdvancedSecurityObjectsMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().listAdvancedSecurityObjectsWithResponse("praval", - AdvSecurityObjectTypeEnum.fromString("globalRulestacks"), "a6a321", 20, com.azure.core.util.Context.NONE); + manager.globalRulestacks() + .listAdvancedSecurityObjectsWithResponse("praval", AdvSecurityObjectTypeEnum.fromString("globalRulestacks"), + "a6a321", 20, com.azure.core.util.Context.NONE); } /* @@ -38,7 +39,8 @@ public static void globalRulestackListAdvancedSecurityObjectsMaximumSetGen( */ public static void globalRulestackListAdvancedSecurityObjectsMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().listAdvancedSecurityObjectsWithResponse("praval", - AdvSecurityObjectTypeEnum.fromString("globalRulestacks"), null, null, com.azure.core.util.Context.NONE); + manager.globalRulestacks() + .listAdvancedSecurityObjectsWithResponse("praval", AdvSecurityObjectTypeEnum.fromString("globalRulestacks"), + null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackListAppIdsSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackListAppIdsSamples.java index 7064de24c2dcc..c8751416c2676 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackListAppIdsSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackListAppIdsSamples.java @@ -20,8 +20,8 @@ public final class GlobalRulestackListAppIdsSamples { */ public static void globalRulestackListAppIdsMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().listAppIdsWithResponse("praval", "8543", "pref", "a6a321", 20, - com.azure.core.util.Context.NONE); + manager.globalRulestacks() + .listAppIdsWithResponse("praval", "8543", "pref", "a6a321", 20, com.azure.core.util.Context.NONE); } /* @@ -36,7 +36,7 @@ public static void globalRulestackListAppIdsMaximumSetGen( */ public static void globalRulestackListAppIdsMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().listAppIdsWithResponse("praval", null, null, null, null, - com.azure.core.util.Context.NONE); + manager.globalRulestacks() + .listAppIdsWithResponse("praval", null, null, null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackListPredefinedUrlCategoriesSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackListPredefinedUrlCategoriesSamples.java index cf798257af6b5..a8c8b4b1fbcee 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackListPredefinedUrlCategoriesSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackListPredefinedUrlCategoriesSamples.java @@ -20,8 +20,8 @@ public final class GlobalRulestackListPredefinedUrlCategoriesSamples { */ public static void globalRulestackListPredefinedUrlCategoriesMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().listPredefinedUrlCategoriesWithResponse("praval", "a6a321", 20, - com.azure.core.util.Context.NONE); + manager.globalRulestacks() + .listPredefinedUrlCategoriesWithResponse("praval", "a6a321", 20, com.azure.core.util.Context.NONE); } /* @@ -36,7 +36,7 @@ public static void globalRulestackListPredefinedUrlCategoriesMaximumSetGen( */ public static void globalRulestackListPredefinedUrlCategoriesMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().listPredefinedUrlCategoriesWithResponse("praval", null, null, - com.azure.core.util.Context.NONE); + manager.globalRulestacks() + .listPredefinedUrlCategoriesWithResponse("praval", null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackListSecurityServicesSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackListSecurityServicesSamples.java index a3bc83d2a7478..a0f693599a5e1 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackListSecurityServicesSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackListSecurityServicesSamples.java @@ -22,8 +22,9 @@ public final class GlobalRulestackListSecurityServicesSamples { */ public static void globalRulestackListSecurityServicesMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().listSecurityServicesWithResponse("praval", - SecurityServicesTypeEnum.fromString("globalRulestacks"), null, null, com.azure.core.util.Context.NONE); + manager.globalRulestacks() + .listSecurityServicesWithResponse("praval", SecurityServicesTypeEnum.fromString("globalRulestacks"), null, + null, com.azure.core.util.Context.NONE); } /* @@ -38,7 +39,8 @@ public static void globalRulestackListSecurityServicesMinimumSetGen( */ public static void globalRulestackListSecurityServicesMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().listSecurityServicesWithResponse("praval", - SecurityServicesTypeEnum.fromString("globalRulestacks"), "a6a321", 20, com.azure.core.util.Context.NONE); + manager.globalRulestacks() + .listSecurityServicesWithResponse("praval", SecurityServicesTypeEnum.fromString("globalRulestacks"), + "a6a321", 20, com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackUpdateSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackUpdateSamples.java index 5a65075ce0116..6b7c1cb9909d7 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackUpdateSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestackUpdateSamples.java @@ -32,23 +32,29 @@ public final class GlobalRulestackUpdateSamples { */ public static void globalRulestackUpdateMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().updateWithResponse("praval", - new GlobalRulestackResourceUpdate().withLocation("eastus") + manager.globalRulestacks() + .updateWithResponse("praval", new GlobalRulestackResourceUpdate().withLocation("eastus") .withIdentity(new AzureResourceManagerManagedIdentityProperties().withType(ManagedIdentityType.NONE) .withUserAssignedIdentities(mapOf("key16", new AzureResourceManagerUserAssignedIdentity().withClientId("aaaa") .withPrincipalId("aaaaaaaaaaaaaaa")))) .withProperties( new GlobalRulestackResourceUpdateProperties().withPanEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c12") - .withPanLocation("eastus").withScope(ScopeType.GLOBAL) + .withPanLocation("eastus") + .withScope(ScopeType.GLOBAL) .withAssociatedSubscriptions(Arrays.asList("2bf4a339-294d-4c25-b0b2-ef649e9f5c27")) - .withDescription("global rulestacks").withDefaultMode(DefaultMode.IPS) - .withMinAppIdVersion("8.5.3").withSecurityServices( - new SecurityServices().withVulnerabilityProfile("default").withAntiSpywareProfile("default") - .withAntiVirusProfile("default").withUrlFilteringProfile("default") - .withFileBlockingProfile("default").withDnsSubscription("default") - .withOutboundUnTrustCertificate("default").withOutboundTrustCertificate("default"))), - com.azure.core.util.Context.NONE); + .withDescription("global rulestacks") + .withDefaultMode(DefaultMode.IPS) + .withMinAppIdVersion("8.5.3") + .withSecurityServices(new SecurityServices().withVulnerabilityProfile("default") + .withAntiSpywareProfile("default") + .withAntiVirusProfile("default") + .withUrlFilteringProfile("default") + .withFileBlockingProfile("default") + .withDnsSubscription("default") + .withOutboundUnTrustCertificate("default") + .withOutboundTrustCertificate("default"))), + com.azure.core.util.Context.NONE); } /* @@ -63,8 +69,8 @@ public static void globalRulestackUpdateMaximumSetGen( */ public static void globalRulestackUpdateMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.globalRulestacks().updateWithResponse("praval", new GlobalRulestackResourceUpdate(), - com.azure.core.util.Context.NONE); + manager.globalRulestacks() + .updateWithResponse("praval", new GlobalRulestackResourceUpdate(), com.azure.core.util.Context.NONE); } // Use "Map.of" if available diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesCreateOrUpdateSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesCreateOrUpdateSamples.java index ea33067c9c877..5458f910547a3 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesCreateOrUpdateSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesCreateOrUpdateSamples.java @@ -30,7 +30,10 @@ public final class LocalRulesCreateOrUpdateSamples { */ public static void localRulesCreateOrUpdateMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRules().define("1").withExistingLocalRulestack("firewall-rg", "lrs1").withRuleName("localRule1") + manager.localRules() + .define("1") + .withExistingLocalRulestack("firewall-rg", "lrs1") + .withRuleName("localRule1") .create(); } @@ -46,21 +49,35 @@ public static void localRulesCreateOrUpdateMinimumSetGen( */ public static void localRulesCreateOrUpdateMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRules().define("1").withExistingLocalRulestack("firewall-rg", "lrs1").withRuleName("localRule1") + manager.localRules() + .define("1") + .withExistingLocalRulestack("firewall-rg", "lrs1") + .withRuleName("localRule1") .withTags(Arrays.asList(new TagInfo().withKey("fakeTokenPlaceholder").withValue("value"))) - .withEtag("c18e6eef-ba3e-49ee-8a85-2b36c863a9d0").withDescription("description of local rule") + .withEtag("c18e6eef-ba3e-49ee-8a85-2b36c863a9d0") + .withDescription("description of local rule") .withRuleState(StateEnum.DISABLED) - .withSource(new SourceAddr().withCidrs(Arrays.asList("1.0.0.1/10")).withCountries(Arrays.asList("India")) - .withFeeds(Arrays.asList("feed")).withPrefixLists(Arrays.asList("PL1"))) + .withSource(new SourceAddr().withCidrs(Arrays.asList("1.0.0.1/10")) + .withCountries(Arrays.asList("India")) + .withFeeds(Arrays.asList("feed")) + .withPrefixLists(Arrays.asList("PL1"))) .withNegateSource(BooleanEnum.TRUE) .withDestination(new DestinationAddr().withCidrs(Arrays.asList("1.0.0.1/10")) - .withCountries(Arrays.asList("India")).withFeeds(Arrays.asList("feed")) - .withPrefixLists(Arrays.asList("PL1")).withFqdnLists(Arrays.asList("FQDN1"))) - .withNegateDestination(BooleanEnum.TRUE).withApplications(Arrays.asList("app1")) + .withCountries(Arrays.asList("India")) + .withFeeds(Arrays.asList("feed")) + .withPrefixLists(Arrays.asList("PL1")) + .withFqdnLists(Arrays.asList("FQDN1"))) + .withNegateDestination(BooleanEnum.TRUE) + .withApplications(Arrays.asList("app1")) .withCategory( new Category().withUrlCustom(Arrays.asList("https://microsoft.com")).withFeeds(Arrays.asList("feed"))) - .withProtocol("HTTP").withProtocolPortList(Arrays.asList("80")).withInboundInspectionCertificate("cert1") - .withAuditComment("example comment").withActionType(ActionEnum.ALLOW).withEnableLogging(StateEnum.DISABLED) - .withDecryptionRuleType(DecryptionRuleTypeEnum.SSLOUTBOUND_INSPECTION).create(); + .withProtocol("HTTP") + .withProtocolPortList(Arrays.asList("80")) + .withInboundInspectionCertificate("cert1") + .withAuditComment("example comment") + .withActionType(ActionEnum.ALLOW) + .withEnableLogging(StateEnum.DISABLED) + .withDecryptionRuleType(DecryptionRuleTypeEnum.SSLOUTBOUND_INSPECTION) + .create(); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesGetCountersSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesGetCountersSamples.java index b887439863094..b7d2149f7b107 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesGetCountersSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesGetCountersSamples.java @@ -20,8 +20,8 @@ public final class LocalRulesGetCountersSamples { */ public static void localRulesGetCountersMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRules().getCountersWithResponse("firewall-rg", "lrs1", "1", "firewall1", - com.azure.core.util.Context.NONE); + manager.localRules() + .getCountersWithResponse("firewall-rg", "lrs1", "1", "firewall1", com.azure.core.util.Context.NONE); } /* @@ -36,7 +36,7 @@ public static void localRulesGetCountersMaximumSetGen( */ public static void localRulesGetCountersMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRules().getCountersWithResponse("firewall-rg", "lrs1", "1", null, - com.azure.core.util.Context.NONE); + manager.localRules() + .getCountersWithResponse("firewall-rg", "lrs1", "1", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesRefreshCountersSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesRefreshCountersSamples.java index ba8d883266bf4..d3776fb1d0bfb 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesRefreshCountersSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesRefreshCountersSamples.java @@ -20,8 +20,8 @@ public final class LocalRulesRefreshCountersSamples { */ public static void localRulesRefreshCountersMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRules().refreshCountersWithResponse("firewall-rg", "lrs1", "1", null, - com.azure.core.util.Context.NONE); + manager.localRules() + .refreshCountersWithResponse("firewall-rg", "lrs1", "1", null, com.azure.core.util.Context.NONE); } /* @@ -36,7 +36,7 @@ public static void localRulesRefreshCountersMinimumSetGen( */ public static void localRulesRefreshCountersMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRules().refreshCountersWithResponse("firewall-rg", "lrs1", "1", "firewall1", - com.azure.core.util.Context.NONE); + manager.localRules() + .refreshCountersWithResponse("firewall-rg", "lrs1", "1", "firewall1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesResetCountersSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesResetCountersSamples.java index a9b9f51210485..fc933f2bc46d6 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesResetCountersSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesResetCountersSamples.java @@ -20,8 +20,8 @@ public final class LocalRulesResetCountersSamples { */ public static void localRulesResetCountersMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRules().resetCountersWithResponse("firewall-rg", "lrs1", "1", "firewall1", - com.azure.core.util.Context.NONE); + manager.localRules() + .resetCountersWithResponse("firewall-rg", "lrs1", "1", "firewall1", com.azure.core.util.Context.NONE); } /* @@ -36,7 +36,7 @@ public static void localRulesResetCountersMaximumSetGen( */ public static void localRulesResetCountersMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRules().resetCountersWithResponse("firewall-rg", "lrs1", "1", null, - com.azure.core.util.Context.NONE); + manager.localRules() + .resetCountersWithResponse("firewall-rg", "lrs1", "1", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksCreateOrUpdateSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksCreateOrUpdateSamples.java index dae15a89792e5..1ec5c9a1dc2bf 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksCreateOrUpdateSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksCreateOrUpdateSamples.java @@ -45,19 +45,30 @@ public static void localRulestacksCreateOrUpdateMinimumSetGen( */ public static void localRulestacksCreateOrUpdateMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().define("lrs1").withRegion("eastus").withExistingResourceGroup("rgopenapi") + manager.localRulestacks() + .define("lrs1") + .withRegion("eastus") + .withExistingResourceGroup("rgopenapi") .withTags(mapOf("tagName", "value")) .withIdentity(new AzureResourceManagerManagedIdentityProperties().withType(ManagedIdentityType.NONE) .withUserAssignedIdentities(mapOf("key16", new AzureResourceManagerUserAssignedIdentity().withClientId("aaaa") .withPrincipalId("aaaaaaaaaaaaaaa")))) - .withPanEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c12").withPanLocation("eastus").withScope(ScopeType.LOCAL) + .withPanEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c12") + .withPanLocation("eastus") + .withScope(ScopeType.LOCAL) .withAssociatedSubscriptions(Arrays.asList("2bf4a339-294d-4c25-b0b2-ef649e9f5c27")) - .withDescription("local rulestacks").withDefaultMode(DefaultMode.IPS).withMinAppIdVersion("8.5.3") + .withDescription("local rulestacks") + .withDefaultMode(DefaultMode.IPS) + .withMinAppIdVersion("8.5.3") .withSecurityServices(new SecurityServices().withVulnerabilityProfile("default") - .withAntiSpywareProfile("default").withAntiVirusProfile("default").withUrlFilteringProfile("default") - .withFileBlockingProfile("default").withDnsSubscription("default") - .withOutboundUnTrustCertificate("default").withOutboundTrustCertificate("default")) + .withAntiSpywareProfile("default") + .withAntiVirusProfile("default") + .withUrlFilteringProfile("default") + .withFileBlockingProfile("default") + .withDnsSubscription("default") + .withOutboundUnTrustCertificate("default") + .withOutboundTrustCertificate("default")) .create(); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksGetSupportInfoSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksGetSupportInfoSamples.java index ab2df1a4a01e5..7e822cf8d5438 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksGetSupportInfoSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksGetSupportInfoSamples.java @@ -20,8 +20,8 @@ public final class LocalRulestacksGetSupportInfoSamples { */ public static void localRulestacksGetSupportInfoMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().getSupportInfoWithResponse("rgopenapi", "lrs1", null, - com.azure.core.util.Context.NONE); + manager.localRulestacks() + .getSupportInfoWithResponse("rgopenapi", "lrs1", null, com.azure.core.util.Context.NONE); } /* @@ -36,7 +36,7 @@ public static void localRulestacksGetSupportInfoMinimumSetGen( */ public static void localRulestacksGetSupportInfoMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().getSupportInfoWithResponse("rgopenapi", "lrs1", "user1@domain.com", - com.azure.core.util.Context.NONE); + manager.localRulestacks() + .getSupportInfoWithResponse("rgopenapi", "lrs1", "user1@domain.com", com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListAdvancedSecurityObjectsSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListAdvancedSecurityObjectsSamples.java index 92dd644d7bf22..d71a377e63700 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListAdvancedSecurityObjectsSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListAdvancedSecurityObjectsSamples.java @@ -22,8 +22,10 @@ public final class LocalRulestacksListAdvancedSecurityObjectsSamples { */ public static void localRulestacksListAdvancedSecurityObjectsMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().listAdvancedSecurityObjectsWithResponse("rgopenapi", "lrs1", - AdvSecurityObjectTypeEnum.fromString("localRulestacks"), "a6a321", 20, com.azure.core.util.Context.NONE); + manager.localRulestacks() + .listAdvancedSecurityObjectsWithResponse("rgopenapi", "lrs1", + AdvSecurityObjectTypeEnum.fromString("localRulestacks"), "a6a321", 20, + com.azure.core.util.Context.NONE); } /* @@ -38,7 +40,8 @@ public static void localRulestacksListAdvancedSecurityObjectsMaximumSetGen( */ public static void localRulestacksListAdvancedSecurityObjectsMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().listAdvancedSecurityObjectsWithResponse("rgopenapi", "lrs1", - AdvSecurityObjectTypeEnum.fromString("localRulestacks"), null, null, com.azure.core.util.Context.NONE); + manager.localRulestacks() + .listAdvancedSecurityObjectsWithResponse("rgopenapi", "lrs1", + AdvSecurityObjectTypeEnum.fromString("localRulestacks"), null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListAppIdsSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListAppIdsSamples.java index 715085ab650de..ffaa3d4009d1e 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListAppIdsSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListAppIdsSamples.java @@ -20,8 +20,9 @@ public final class LocalRulestacksListAppIdsSamples { */ public static void localRulestacksListAppIdsMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().listAppIdsWithResponse("rgopenapi", "lrs1", "8543", "pref", "a6a321", 20, - com.azure.core.util.Context.NONE); + manager.localRulestacks() + .listAppIdsWithResponse("rgopenapi", "lrs1", "8543", "pref", "a6a321", 20, + com.azure.core.util.Context.NONE); } /* @@ -36,7 +37,7 @@ public static void localRulestacksListAppIdsMaximumSetGen( */ public static void localRulestacksListAppIdsMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().listAppIdsWithResponse("rgopenapi", "lrs1", null, null, null, null, - com.azure.core.util.Context.NONE); + manager.localRulestacks() + .listAppIdsWithResponse("rgopenapi", "lrs1", null, null, null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListCountriesSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListCountriesSamples.java index 7d1368180c9ba..4153abb381ac6 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListCountriesSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListCountriesSamples.java @@ -20,8 +20,8 @@ public final class LocalRulestacksListCountriesSamples { */ public static void localRulestacksListCountriesMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().listCountriesWithResponse("rgopenapi", "lrs1", "a6a321", 20, - com.azure.core.util.Context.NONE); + manager.localRulestacks() + .listCountriesWithResponse("rgopenapi", "lrs1", "a6a321", 20, com.azure.core.util.Context.NONE); } /* @@ -36,7 +36,7 @@ public static void localRulestacksListCountriesMaximumSetGen( */ public static void localRulestacksListCountriesMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().listCountriesWithResponse("rgopenapi", "lrs1", null, null, - com.azure.core.util.Context.NONE); + manager.localRulestacks() + .listCountriesWithResponse("rgopenapi", "lrs1", null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListPredefinedUrlCategoriesSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListPredefinedUrlCategoriesSamples.java index c95453b5640ee..4c92517893140 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListPredefinedUrlCategoriesSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListPredefinedUrlCategoriesSamples.java @@ -20,8 +20,8 @@ public final class LocalRulestacksListPredefinedUrlCategoriesSamples { */ public static void localRulestacksListPredefinedUrlCategoriesMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().listPredefinedUrlCategoriesWithResponse("rgopenapi", "lrs1", null, null, - com.azure.core.util.Context.NONE); + manager.localRulestacks() + .listPredefinedUrlCategoriesWithResponse("rgopenapi", "lrs1", null, null, com.azure.core.util.Context.NONE); } /* @@ -36,7 +36,8 @@ public static void localRulestacksListPredefinedUrlCategoriesMinimumSetGen( */ public static void localRulestacksListPredefinedUrlCategoriesMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().listPredefinedUrlCategoriesWithResponse("rgopenapi", "lrs1", "a6a321", 20, - com.azure.core.util.Context.NONE); + manager.localRulestacks() + .listPredefinedUrlCategoriesWithResponse("rgopenapi", "lrs1", "a6a321", 20, + com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListSecurityServicesSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListSecurityServicesSamples.java index 58d1a8200a2f4..97e28f927aafb 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListSecurityServicesSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListSecurityServicesSamples.java @@ -22,8 +22,9 @@ public final class LocalRulestacksListSecurityServicesSamples { */ public static void localRulestacksListSecurityServicesMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().listSecurityServicesWithResponse("rgopenapi", "lrs1", - SecurityServicesTypeEnum.fromString("localRulestacks"), null, null, com.azure.core.util.Context.NONE); + manager.localRulestacks() + .listSecurityServicesWithResponse("rgopenapi", "lrs1", + SecurityServicesTypeEnum.fromString("localRulestacks"), null, null, com.azure.core.util.Context.NONE); } /* @@ -38,7 +39,8 @@ public static void localRulestacksListSecurityServicesMinimumSetGen( */ public static void localRulestacksListSecurityServicesMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.localRulestacks().listSecurityServicesWithResponse("rgopenapi", "lrs1", - SecurityServicesTypeEnum.fromString("localRulestacks"), "a6a321", 20, com.azure.core.util.Context.NONE); + manager.localRulestacks() + .listSecurityServicesWithResponse("rgopenapi", "lrs1", + SecurityServicesTypeEnum.fromString("localRulestacks"), "a6a321", 20, com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksUpdateSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksUpdateSamples.java index afffafec77aea..9364f8109267f 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksUpdateSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksUpdateSamples.java @@ -33,22 +33,30 @@ public final class LocalRulestacksUpdateSamples { public static void localRulestacksUpdateMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { LocalRulestackResource resource = manager.localRulestacks() - .getByResourceGroupWithResponse("rgopenapi", "lrs1", com.azure.core.util.Context.NONE).getValue(); - resource.update().withTags(mapOf("tagName", "value")) + .getByResourceGroupWithResponse("rgopenapi", "lrs1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("tagName", "value")) .withIdentity(new AzureResourceManagerManagedIdentityProperties().withType(ManagedIdentityType.NONE) .withUserAssignedIdentities(mapOf("key16", new AzureResourceManagerUserAssignedIdentity().withClientId("aaaa") .withPrincipalId("aaaaaaaaaaaaaaa")))) .withProperties( new LocalRulestackResourceUpdateProperties().withPanEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c12") - .withPanLocation("eastus").withScope(ScopeType.LOCAL) + .withPanLocation("eastus") + .withScope(ScopeType.LOCAL) .withAssociatedSubscriptions(Arrays.asList("2bf4a339-294d-4c25-b0b2-ef649e9f5c27")) - .withDescription("local rulestacks").withDefaultMode(DefaultMode.IPS).withMinAppIdVersion("8.5.3") - .withSecurityServices( - new SecurityServices().withVulnerabilityProfile("default").withAntiSpywareProfile("default") - .withAntiVirusProfile("default").withUrlFilteringProfile("default") - .withFileBlockingProfile("default").withDnsSubscription("default") - .withOutboundUnTrustCertificate("default").withOutboundTrustCertificate("default"))) + .withDescription("local rulestacks") + .withDefaultMode(DefaultMode.IPS) + .withMinAppIdVersion("8.5.3") + .withSecurityServices(new SecurityServices().withVulnerabilityProfile("default") + .withAntiSpywareProfile("default") + .withAntiVirusProfile("default") + .withUrlFilteringProfile("default") + .withFileBlockingProfile("default") + .withDnsSubscription("default") + .withOutboundUnTrustCertificate("default") + .withOutboundTrustCertificate("default"))) .apply(); } @@ -65,7 +73,8 @@ public static void localRulestacksUpdateMaximumSetGen( public static void localRulestacksUpdateMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { LocalRulestackResource resource = manager.localRulestacks() - .getByResourceGroupWithResponse("rgopenapi", "lrs1", com.azure.core.util.Context.NONE).getValue(); + .getByResourceGroupWithResponse("rgopenapi", "lrs1", com.azure.core.util.Context.NONE) + .getValue(); resource.update().apply(); } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PostRulesCreateOrUpdateSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PostRulesCreateOrUpdateSamples.java index b3813de1dd63c..b8fa3f4b21a11 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PostRulesCreateOrUpdateSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PostRulesCreateOrUpdateSamples.java @@ -31,23 +31,35 @@ public final class PostRulesCreateOrUpdateSamples { */ public static void postRulesCreateOrUpdateMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.postRules().createOrUpdate("lrs1", "1", new PostRulesResourceInner() - .withEtag("c18e6eef-ba3e-49ee-8a85-2b36c863a9d0").withRuleName("postRule1") - .withDescription("description of post rule").withRuleState(StateEnum.DISABLED) - .withSource(new SourceAddr().withCidrs(Arrays.asList("1.0.0.1/10")).withCountries(Arrays.asList("India")) - .withFeeds(Arrays.asList("feed")).withPrefixLists(Arrays.asList("PL1"))) - .withNegateSource(BooleanEnum.TRUE) - .withDestination(new DestinationAddr().withCidrs(Arrays.asList("1.0.0.1/10")) - .withCountries(Arrays.asList("India")).withFeeds(Arrays.asList("feed")) - .withPrefixLists(Arrays.asList("PL1")).withFqdnLists(Arrays.asList("FQDN1"))) - .withNegateDestination(BooleanEnum.TRUE).withApplications(Arrays.asList("app1")) - .withCategory( - new Category().withUrlCustom(Arrays.asList("https://microsoft.com")).withFeeds(Arrays.asList("feed"))) - .withProtocol("HTTP").withProtocolPortList(Arrays.asList("80")).withInboundInspectionCertificate("cert1") - .withAuditComment("example comment").withActionType(ActionEnum.ALLOW).withEnableLogging(StateEnum.DISABLED) - .withDecryptionRuleType(DecryptionRuleTypeEnum.SSLOUTBOUND_INSPECTION) - .withTags(Arrays.asList(new TagInfo().withKey("fakeTokenPlaceholder").withValue("value"))), - com.azure.core.util.Context.NONE); + manager.postRules() + .createOrUpdate("lrs1", "1", + new PostRulesResourceInner().withEtag("c18e6eef-ba3e-49ee-8a85-2b36c863a9d0") + .withRuleName("postRule1") + .withDescription("description of post rule") + .withRuleState(StateEnum.DISABLED) + .withSource(new SourceAddr().withCidrs(Arrays.asList("1.0.0.1/10")) + .withCountries(Arrays.asList("India")) + .withFeeds(Arrays.asList("feed")) + .withPrefixLists(Arrays.asList("PL1"))) + .withNegateSource(BooleanEnum.TRUE) + .withDestination(new DestinationAddr().withCidrs(Arrays.asList("1.0.0.1/10")) + .withCountries(Arrays.asList("India")) + .withFeeds(Arrays.asList("feed")) + .withPrefixLists(Arrays.asList("PL1")) + .withFqdnLists(Arrays.asList("FQDN1"))) + .withNegateDestination(BooleanEnum.TRUE) + .withApplications(Arrays.asList("app1")) + .withCategory(new Category().withUrlCustom(Arrays.asList("https://microsoft.com")) + .withFeeds(Arrays.asList("feed"))) + .withProtocol("HTTP") + .withProtocolPortList(Arrays.asList("80")) + .withInboundInspectionCertificate("cert1") + .withAuditComment("example comment") + .withActionType(ActionEnum.ALLOW) + .withEnableLogging(StateEnum.DISABLED) + .withDecryptionRuleType(DecryptionRuleTypeEnum.SSLOUTBOUND_INSPECTION) + .withTags(Arrays.asList(new TagInfo().withKey("fakeTokenPlaceholder").withValue("value"))), + com.azure.core.util.Context.NONE); } /* @@ -62,7 +74,8 @@ public static void postRulesCreateOrUpdateMaximumSetGen( */ public static void postRulesCreateOrUpdateMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.postRules().createOrUpdate("lrs1", "1", new PostRulesResourceInner().withRuleName("postRule1"), - com.azure.core.util.Context.NONE); + manager.postRules() + .createOrUpdate("lrs1", "1", new PostRulesResourceInner().withRuleName("postRule1"), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PreRulesCreateOrUpdateSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PreRulesCreateOrUpdateSamples.java index ebebdbe9caaaf..b34656fa77c32 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PreRulesCreateOrUpdateSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PreRulesCreateOrUpdateSamples.java @@ -31,23 +31,35 @@ public final class PreRulesCreateOrUpdateSamples { */ public static void preRulesCreateOrUpdateMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.preRules().createOrUpdate("lrs1", "1", new PreRulesResourceInner() - .withEtag("c18e6eef-ba3e-49ee-8a85-2b36c863a9d0").withRuleName("preRule1") - .withDescription("description of pre rule").withRuleState(StateEnum.DISABLED) - .withSource(new SourceAddr().withCidrs(Arrays.asList("1.0.0.1/10")).withCountries(Arrays.asList("India")) - .withFeeds(Arrays.asList("feed")).withPrefixLists(Arrays.asList("PL1"))) - .withNegateSource(BooleanEnum.TRUE) - .withDestination(new DestinationAddr().withCidrs(Arrays.asList("1.0.0.1/10")) - .withCountries(Arrays.asList("India")).withFeeds(Arrays.asList("feed")) - .withPrefixLists(Arrays.asList("PL1")).withFqdnLists(Arrays.asList("FQDN1"))) - .withNegateDestination(BooleanEnum.TRUE).withApplications(Arrays.asList("app1")) - .withCategory( - new Category().withUrlCustom(Arrays.asList("https://microsoft.com")).withFeeds(Arrays.asList("feed"))) - .withProtocol("HTTP").withProtocolPortList(Arrays.asList("80")).withInboundInspectionCertificate("cert1") - .withAuditComment("example comment").withActionType(ActionEnum.ALLOW).withEnableLogging(StateEnum.DISABLED) - .withDecryptionRuleType(DecryptionRuleTypeEnum.SSLOUTBOUND_INSPECTION) - .withTags(Arrays.asList(new TagInfo().withKey("fakeTokenPlaceholder").withValue("value"))), - com.azure.core.util.Context.NONE); + manager.preRules() + .createOrUpdate("lrs1", "1", + new PreRulesResourceInner().withEtag("c18e6eef-ba3e-49ee-8a85-2b36c863a9d0") + .withRuleName("preRule1") + .withDescription("description of pre rule") + .withRuleState(StateEnum.DISABLED) + .withSource(new SourceAddr().withCidrs(Arrays.asList("1.0.0.1/10")) + .withCountries(Arrays.asList("India")) + .withFeeds(Arrays.asList("feed")) + .withPrefixLists(Arrays.asList("PL1"))) + .withNegateSource(BooleanEnum.TRUE) + .withDestination(new DestinationAddr().withCidrs(Arrays.asList("1.0.0.1/10")) + .withCountries(Arrays.asList("India")) + .withFeeds(Arrays.asList("feed")) + .withPrefixLists(Arrays.asList("PL1")) + .withFqdnLists(Arrays.asList("FQDN1"))) + .withNegateDestination(BooleanEnum.TRUE) + .withApplications(Arrays.asList("app1")) + .withCategory(new Category().withUrlCustom(Arrays.asList("https://microsoft.com")) + .withFeeds(Arrays.asList("feed"))) + .withProtocol("HTTP") + .withProtocolPortList(Arrays.asList("80")) + .withInboundInspectionCertificate("cert1") + .withAuditComment("example comment") + .withActionType(ActionEnum.ALLOW) + .withEnableLogging(StateEnum.DISABLED) + .withDecryptionRuleType(DecryptionRuleTypeEnum.SSLOUTBOUND_INSPECTION) + .withTags(Arrays.asList(new TagInfo().withKey("fakeTokenPlaceholder").withValue("value"))), + com.azure.core.util.Context.NONE); } /* @@ -62,7 +74,8 @@ public static void preRulesCreateOrUpdateMaximumSetGen( */ public static void preRulesCreateOrUpdateMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.preRules().createOrUpdate("lrs1", "1", new PreRulesResourceInner().withRuleName("preRule1"), - com.azure.core.util.Context.NONE); + manager.preRules() + .createOrUpdate("lrs1", "1", new PreRulesResourceInner().withRuleName("preRule1"), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListGlobalRulestackCreateOrUpdateSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListGlobalRulestackCreateOrUpdateSamples.java index 72056aca16185..bb0203f9c97aa 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListGlobalRulestackCreateOrUpdateSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListGlobalRulestackCreateOrUpdateSamples.java @@ -23,11 +23,13 @@ public final class PrefixListGlobalRulestackCreateOrUpdateSamples { */ public static void prefixListGlobalRulestackCreateOrUpdateMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.prefixListGlobalRulestacks().createOrUpdate("praval", "armid1", - new PrefixListGlobalRulestackResourceInner().withDescription("string") - .withPrefixList(Arrays.asList("1.0.0.0/24")).withEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c27") - .withAuditComment("comment"), - com.azure.core.util.Context.NONE); + manager.prefixListGlobalRulestacks() + .createOrUpdate("praval", "armid1", + new PrefixListGlobalRulestackResourceInner().withDescription("string") + .withPrefixList(Arrays.asList("1.0.0.0/24")) + .withEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c27") + .withAuditComment("comment"), + com.azure.core.util.Context.NONE); } /* @@ -42,8 +44,9 @@ public static void prefixListGlobalRulestackCreateOrUpdateMaximumSetGen( */ public static void prefixListGlobalRulestackCreateOrUpdateMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.prefixListGlobalRulestacks().createOrUpdate("praval", "armid1", - new PrefixListGlobalRulestackResourceInner().withPrefixList(Arrays.asList("1.0.0.0/24")), - com.azure.core.util.Context.NONE); + manager.prefixListGlobalRulestacks() + .createOrUpdate("praval", "armid1", + new PrefixListGlobalRulestackResourceInner().withPrefixList(Arrays.asList("1.0.0.0/24")), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestackCreateOrUpdateSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestackCreateOrUpdateSamples.java index 0336880ab683d..83804d0ecd46b 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestackCreateOrUpdateSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestackCreateOrUpdateSamples.java @@ -22,8 +22,11 @@ public final class PrefixListLocalRulestackCreateOrUpdateSamples { */ public static void prefixListLocalRulestackCreateOrUpdateMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.prefixListLocalRulestacks().define("armid1").withExistingLocalRulestack("rgopenapi", "lrs1") - .withPrefixList(Arrays.asList("1.0.0.0/24")).create(); + manager.prefixListLocalRulestacks() + .define("armid1") + .withExistingLocalRulestack("rgopenapi", "lrs1") + .withPrefixList(Arrays.asList("1.0.0.0/24")) + .create(); } /* @@ -38,8 +41,13 @@ public static void prefixListLocalRulestackCreateOrUpdateMinimumSetGen( */ public static void prefixListLocalRulestackCreateOrUpdateMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.prefixListLocalRulestacks().define("armid1").withExistingLocalRulestack("rgopenapi", "lrs1") - .withPrefixList(Arrays.asList("1.0.0.0/24")).withDescription("string") - .withEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c27").withAuditComment("comment").create(); + manager.prefixListLocalRulestacks() + .define("armid1") + .withExistingLocalRulestack("rgopenapi", "lrs1") + .withPrefixList(Arrays.asList("1.0.0.0/24")) + .withDescription("string") + .withEtag("2bf4a339-294d-4c25-b0b2-ef649e9f5c27") + .withAuditComment("comment") + .create(); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestackGetSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestackGetSamples.java index b9e77cfae2154..b2c834e72fbc8 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestackGetSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestackGetSamples.java @@ -20,8 +20,8 @@ public final class PrefixListLocalRulestackGetSamples { */ public static void prefixListLocalRulestackGetMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.prefixListLocalRulestacks().getWithResponse("rgopenapi", "lrs1", "armid1", - com.azure.core.util.Context.NONE); + manager.prefixListLocalRulestacks() + .getWithResponse("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); } /* @@ -36,7 +36,7 @@ public static void prefixListLocalRulestackGetMinimumSetGen( */ public static void prefixListLocalRulestackGetMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.prefixListLocalRulestacks().getWithResponse("rgopenapi", "lrs1", "armid1", - com.azure.core.util.Context.NONE); + manager.prefixListLocalRulestacks() + .getWithResponse("rgopenapi", "lrs1", "armid1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestackListByLocalRulestacksSamples.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestackListByLocalRulestacksSamples.java index f8b04cae7c69f..a6ad210d3d288 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestackListByLocalRulestacksSamples.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/samples/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestackListByLocalRulestacksSamples.java @@ -20,8 +20,8 @@ public final class PrefixListLocalRulestackListByLocalRulestacksSamples { */ public static void prefixListLocalRulestackListByLocalRulestacksMaximumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.prefixListLocalRulestacks().listByLocalRulestacks("rgopenapi", "lrs1", - com.azure.core.util.Context.NONE); + manager.prefixListLocalRulestacks() + .listByLocalRulestacks("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); } /* @@ -36,7 +36,7 @@ public static void prefixListLocalRulestackListByLocalRulestacksMaximumSetGen( */ public static void prefixListLocalRulestackListByLocalRulestacksMinimumSetGen( com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager manager) { - manager.prefixListLocalRulestacks().listByLocalRulestacks("rgopenapi", "lrs1", - com.azure.core.util.Context.NONE); + manager.prefixListLocalRulestacks() + .listByLocalRulestacks("rgopenapi", "lrs1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestacksCreateOrUpdateMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestacksCreateOrUpdateMockTests.java index 47a28c90b0a61..98ac31fa7869f 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestacksCreateOrUpdateMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestacksCreateOrUpdateMockTests.java @@ -6,46 +6,27 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.CertificateObjectGlobalRulestackResourceInner; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.CertificateObjectGlobalRulestackResource; -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 CertificateObjectGlobalRulestacksCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"properties\":{\"certificateSignerResourceId\":\"xpunjqi\",\"certificateSelfSigned\":\"TRUE\",\"auditComment\":\"vvi\",\"description\":\"cgx\",\"etag\":\"csserxht\",\"provisioningState\":\"Succeeded\"},\"id\":\"hlwntsjgq\",\"name\":\"sxypruuu\",\"type\":\"bnchrsziz\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestacksDeleteMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestacksDeleteMockTests.java index 34271714c2f55..16bcc9ced6e08 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestacksDeleteMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestacksDeleteMockTests.java @@ -6,41 +6,22 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; -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 CertificateObjectGlobalRulestacksDeleteMockTests { @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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestacksGetWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestacksGetWithResponseMockTests.java index 58ee4bf909694..4e3193f1d842d 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestacksGetWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestacksGetWithResponseMockTests.java @@ -6,45 +6,26 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.CertificateObjectGlobalRulestackResource; -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 CertificateObjectGlobalRulestacksGetWithResponseMockTests { @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\":{\"certificateSignerResourceId\":\"ebnfxofvc\",\"certificateSelfSigned\":\"TRUE\",\"auditComment\":\"dirazf\",\"description\":\"ejwabmdujtmvco\",\"etag\":\"xcmjurbu\",\"provisioningState\":\"Deleting\"},\"id\":\"yqltqsro\",\"name\":\"tuwkffdj\",\"type\":\"tsysi\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestacksListMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestacksListMockTests.java index e56e5f97cff2a..af7199d3a0206 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestacksListMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectGlobalRulestacksListMockTests.java @@ -6,46 +6,27 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.CertificateObjectGlobalRulestackResource; -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 CertificateObjectGlobalRulestacksListMockTests { @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\":{\"certificateSignerResourceId\":\"bgdlfgtdysna\",\"certificateSelfSigned\":\"TRUE\",\"auditComment\":\"lqbctqhamzjrw\",\"description\":\"qzeqyjleziunjxdf\",\"etag\":\"ntkwcegy\",\"provisioningState\":\"Failed\"},\"id\":\"nseqacjjvp\",\"name\":\"lguooqjagmd\",\"type\":\"tg\"}]}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestacksCreateOrUpdateMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestacksCreateOrUpdateMockTests.java index ab56a37438fff..730d5db922933 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestacksCreateOrUpdateMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestacksCreateOrUpdateMockTests.java @@ -6,45 +6,26 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.CertificateObjectLocalRulestackResource; -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 CertificateObjectLocalRulestacksCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"properties\":{\"certificateSignerResourceId\":\"u\",\"certificateSelfSigned\":\"TRUE\",\"auditComment\":\"mdwmf\",\"description\":\"pycvjqdvdwkqpldr\",\"etag\":\"fgnaavuagnteta\",\"provisioningState\":\"Succeeded\"},\"id\":\"pdctuhspfefyi\",\"name\":\"duyeuyl\",\"type\":\"phm\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestacksDeleteMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestacksDeleteMockTests.java index d5c5dd26e08d1..286cc304ed704 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestacksDeleteMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestacksDeleteMockTests.java @@ -6,41 +6,22 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; -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 CertificateObjectLocalRulestacksDeleteMockTests { @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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestacksGetWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestacksGetWithResponseMockTests.java index 47b8add0f39c7..15a4f8030d547 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestacksGetWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestacksGetWithResponseMockTests.java @@ -6,45 +6,26 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.CertificateObjectLocalRulestackResource; -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 CertificateObjectLocalRulestacksGetWithResponseMockTests { @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\":{\"certificateSignerResourceId\":\"hmptyrilkfbn\",\"certificateSelfSigned\":\"FALSE\",\"auditComment\":\"xvztpbnfnqtxj\",\"description\":\"m\",\"etag\":\"swbnfddepldwqjns\",\"provisioningState\":\"Accepted\"},\"id\":\"leexahvmywh\",\"name\":\"brcary\",\"type\":\"sjjzyvoaqajuveh\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestacksListByLocalRulestacksMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestacksListByLocalRulestacksMockTests.java index 723bd241afb41..999a44df7a8d0 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestacksListByLocalRulestacksMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/CertificateObjectLocalRulestacksListByLocalRulestacksMockTests.java @@ -6,46 +6,27 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.CertificateObjectLocalRulestackResource; -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 CertificateObjectLocalRulestacksListByLocalRulestacksMockTests { @Test public void testListByLocalRulestacks() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[{\"properties\":{\"certificateSignerResourceId\":\"xawqy\",\"certificateSelfSigned\":\"TRUE\",\"auditComment\":\"hd\",\"description\":\"myck\",\"etag\":\"xnx\",\"provisioningState\":\"Accepted\"},\"id\":\"ywymxgaabj\",\"name\":\"dtfohfaog\",\"type\":\"vkiwrsiwdyjqu\"}]}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallStatusGetWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallStatusGetWithResponseMockTests.java index f4eb91e472a17..149bb1ef79a6b 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallStatusGetWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallStatusGetWithResponseMockTests.java @@ -6,43 +6,24 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.FirewallStatusResource; -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 FirewallStatusGetWithResponseMockTests { @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\":{\"isPanoramaManaged\":\"TRUE\",\"healthStatus\":\"INITIALIZING\",\"healthReason\":\"zji\",\"panoramaStatus\":{\"panoramaServerStatus\":\"UP\",\"panoramaServer2Status\":\"UP\"},\"provisioningState\":\"Failed\"},\"id\":\"absol\",\"name\":\"onqqlmgn\",\"type\":\"qxsjxte\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallStatusListByFirewallsMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallStatusListByFirewallsMockTests.java index 34dde3b7f87df..b3a14c2c3ea9d 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallStatusListByFirewallsMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallStatusListByFirewallsMockTests.java @@ -6,44 +6,25 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.FirewallStatusResource; -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 FirewallStatusListByFirewallsMockTests { @Test public void testListByFirewalls() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[{\"properties\":{\"isPanoramaManaged\":\"FALSE\",\"healthStatus\":\"INITIALIZING\",\"healthReason\":\"ibtyibuyvpirfqjp\",\"panoramaStatus\":{\"panoramaServerStatus\":\"UP\",\"panoramaServer2Status\":\"UP\"},\"provisioningState\":\"Deleted\"},\"id\":\"denrexkxbhxv\",\"name\":\"cnulgmnhjevdy\",\"type\":\"nfa\"}]}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsDeleteMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsDeleteMockTests.java index 0cd60c2b02b64..d7180feb2c8c4 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsDeleteMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsDeleteMockTests.java @@ -6,41 +6,22 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; -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 FirewallsDeleteMockTests { @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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsGetGlobalRulestackWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsGetGlobalRulestackWithResponseMockTests.java index 6d75a837a738e..9cb795bcf88a2 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsGetGlobalRulestackWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsGetGlobalRulestackWithResponseMockTests.java @@ -6,43 +6,24 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.GlobalRulestackInfo; -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 FirewallsGetGlobalRulestackWithResponseMockTests { @Test public void testGetGlobalRulestackWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"azureId\":\"gckbb\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsGetSupportInfoWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsGetSupportInfoWithResponseMockTests.java index db18c94a4cda1..792fd1e70efac 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsGetSupportInfoWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FirewallsGetSupportInfoWithResponseMockTests.java @@ -6,45 +6,26 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SupportInfo; -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 FirewallsGetSupportInfoWithResponseMockTests { @Test public void testGetSupportInfoWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"productSku\":\"crkdlbn\",\"productSerial\":\"xvhcs\",\"accountRegistered\":\"FALSE\",\"accountId\":\"wxaeaovure\",\"userDomainSupported\":\"TRUE\",\"userRegistered\":\"FALSE\",\"freeTrial\":\"TRUE\",\"freeTrialDaysLeft\":793524985,\"freeTrialCreditLeft\":187101645,\"helpURL\":\"rzmwn\",\"supportURL\":\"pag\",\"registerURL\":\"mvmmagoaqylkjz\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListGlobalRulestacksCreateOrUpdateMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListGlobalRulestacksCreateOrUpdateMockTests.java index b4f0647e814e8..ecd7542cf130b 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListGlobalRulestacksCreateOrUpdateMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListGlobalRulestacksCreateOrUpdateMockTests.java @@ -6,46 +6,27 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.FqdnListGlobalRulestackResourceInner; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.FqdnListGlobalRulestackResource; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class FqdnListGlobalRulestacksCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"properties\":{\"description\":\"tprwnw\",\"fqdnList\":[\"oevytlyokr\",\"rouuxvnsasbcry\"],\"etag\":\"dizr\",\"auditComment\":\"lobdxna\",\"provisioningState\":\"Succeeded\"},\"id\":\"mlmvevfxzo\",\"name\":\"jhbzxliohrdddtf\",\"type\":\"xqbawpc\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListGlobalRulestacksDeleteMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListGlobalRulestacksDeleteMockTests.java index 3aa6bddb9b226..2a3241b2deda1 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListGlobalRulestacksDeleteMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListGlobalRulestacksDeleteMockTests.java @@ -6,41 +6,22 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; -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 FqdnListGlobalRulestacksDeleteMockTests { @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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListGlobalRulestacksGetWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListGlobalRulestacksGetWithResponseMockTests.java index bde05a8cc80eb..62b3b1418f3d9 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListGlobalRulestacksGetWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListGlobalRulestacksGetWithResponseMockTests.java @@ -6,44 +6,25 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.FqdnListGlobalRulestackResource; -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 FqdnListGlobalRulestacksGetWithResponseMockTests { @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\":{\"description\":\"nmg\",\"fqdnList\":[\"ouxddbhfhpfpazj\"],\"etag\":\"ywjxh\",\"auditComment\":\"ulontacnpqwteht\",\"provisioningState\":\"Canceled\"},\"id\":\"hrljy\",\"name\":\"ogwxhnsduugwb\",\"type\":\"reur\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListGlobalRulestacksListMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListGlobalRulestacksListMockTests.java index a4e2787bfd81b..121f0bb505083 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListGlobalRulestacksListMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListGlobalRulestacksListMockTests.java @@ -6,45 +6,26 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.FqdnListGlobalRulestackResource; -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 FqdnListGlobalRulestacksListMockTests { @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\":{\"description\":\"tb\",\"fqdnList\":[\"plrohkpigq\"],\"etag\":\"suckzm\",\"auditComment\":\"klsnoxaxmqeqa\",\"provisioningState\":\"Accepted\"},\"id\":\"nhg\",\"name\":\"ydyynfsvkh\",\"type\":\"bvqt\"}]}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestacksCreateOrUpdateMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestacksCreateOrUpdateMockTests.java index f06cce7c8afce..61fe7ca4fb015 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestacksCreateOrUpdateMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestacksCreateOrUpdateMockTests.java @@ -6,45 +6,26 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.FqdnListLocalRulestackResource; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class FqdnListLocalRulestacksCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"properties\":{\"description\":\"aokgkskjivbsshaj\",\"fqdnList\":[\"u\",\"peexpgeumilhwuit\",\"dexyionofninbdb\"],\"etag\":\"xcwqqrsmpc\",\"auditComment\":\"prtug\",\"provisioningState\":\"Succeeded\"},\"id\":\"bcyksivmfogd\",\"name\":\"tbfcm\",\"type\":\"rftsjcwjjxs\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestacksDeleteMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestacksDeleteMockTests.java index 20e53d81545d5..6bdf1a63e6ddf 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestacksDeleteMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestacksDeleteMockTests.java @@ -6,41 +6,22 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; -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 FqdnListLocalRulestacksDeleteMockTests { @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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestacksGetWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestacksGetWithResponseMockTests.java index 65ff35ed1bc15..172bfaf6242ae 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestacksGetWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestacksGetWithResponseMockTests.java @@ -6,44 +6,25 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.FqdnListLocalRulestackResource; -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 FqdnListLocalRulestacksGetWithResponseMockTests { @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\":{\"description\":\"ricctkwmuqqoa\",\"fqdnList\":[\"eiyglesrwvaexhdc\",\"rceqnkbrupob\",\"hdmljz\"],\"etag\":\"vume\",\"auditComment\":\"pbibn\",\"provisioningState\":\"Canceled\"},\"id\":\"epifexleqirccjc\",\"name\":\"ykcgxvrpjlvcz\",\"type\":\"odacpunettepdjxq\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestacksListByLocalRulestacksMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestacksListByLocalRulestacksMockTests.java index 1004c090241b1..734a1b0c67b8b 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestacksListByLocalRulestacksMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/FqdnListLocalRulestacksListByLocalRulestacksMockTests.java @@ -6,45 +6,26 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.FqdnListLocalRulestackResource; -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 FqdnListLocalRulestacksListByLocalRulestacksMockTests { @Test public void testListByLocalRulestacks() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[{\"properties\":{\"description\":\"atxtjrrlkmdskjhh\",\"fqdnList\":[\"lajfoxcxscvslxlh\"],\"etag\":\"vkrmukmyjmkx\",\"auditComment\":\"tcsloj\",\"provisioningState\":\"Succeeded\"},\"id\":\"dnqtoqxjhqx\",\"name\":\"s\",\"type\":\"htkbtnq\"}]}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksCreateOrUpdateMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksCreateOrUpdateMockTests.java index c36efe7d61ff9..fec42e9cb90a1 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksCreateOrUpdateMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksCreateOrUpdateMockTests.java @@ -6,11 +6,9 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.GlobalRulestackResourceInner; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.AzureResourceManagerManagedIdentityProperties; @@ -20,7 +18,6 @@ import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ManagedIdentityType; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ScopeType; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SecurityServices; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; @@ -28,32 +25,16 @@ 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 GlobalRulestacksCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"properties\":{\"panEtag\":\"e\",\"panLocation\":\"jetagltsxoatft\",\"scope\":\"GLOBAL\",\"associatedSubscriptions\":[\"bs\",\"vefloccsrmozihmi\",\"g\",\"wtxxpkyjcx\"],\"description\":\"xgrytfmp\",\"defaultMode\":\"FIREWALL\",\"minAppIdVersion\":\"lrmcaykg\",\"provisioningState\":\"Succeeded\",\"securityServices\":{\"vulnerabilityProfile\":\"ztrksxwpndf\",\"antiSpywareProfile\":\"fnznth\",\"antiVirusProfile\":\"wkjaos\",\"urlFilteringProfile\":\"uzvoamktcqiosm\",\"fileBlockingProfile\":\"zah\",\"dnsSubscription\":\"qdlyrtl\",\"outboundUnTrustCertificate\":\"ap\",\"outboundTrustCertificate\":\"tz\"}},\"location\":\"atbhjmznn\",\"identity\":{\"tenantId\":\"qeqala\",\"principalId\":\"lagun\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"zqavbpdqmjx\":{\"clientId\":\"bwln\",\"principalId\":\"hyreeu\"},\"yuojqtobaxk\":{\"clientId\":\"yzglgo\",\"principalId\":\"tlmj\"},\"njqhdenxa\":{\"clientId\":\"ytunlbfjkwr\",\"principalId\":\"nkqbhsyrq\"},\"wtqabpxuckp\":{\"clientId\":\"kpak\",\"principalId\":\"ifmjnn\"}}},\"id\":\"qoweyirdhl\",\"name\":\"sn\",\"type\":\"wfl\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksDeleteMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksDeleteMockTests.java index a5bdf951e434a..406724291b240 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksDeleteMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksDeleteMockTests.java @@ -6,41 +6,22 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; -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 GlobalRulestacksDeleteMockTests { @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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksGetChangeLogWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksGetChangeLogWithResponseMockTests.java index 9bad35481a845..4d244da8f9120 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksGetChangeLogWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksGetChangeLogWithResponseMockTests.java @@ -6,44 +6,25 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.Changelog; -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 GlobalRulestacksGetChangeLogWithResponseMockTests { @Test public void testGetChangeLogWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"changes\":[\"wjedmurrxxgew\"],\"lastCommitted\":\"2021-06-22T20:24:57Z\",\"lastModified\":\"2021-05-29T11:10:18Z\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksGetWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksGetWithResponseMockTests.java index ef4f67c7df389..ab61d55894bd6 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksGetWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksGetWithResponseMockTests.java @@ -6,47 +6,28 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.DefaultMode; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.GlobalRulestackResource; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ManagedIdentityType; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ScopeType; -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 GlobalRulestacksGetWithResponseMockTests { @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\":{\"panEtag\":\"hsphaivmxyas\",\"panLocation\":\"vgsgzwywakoihkn\",\"scope\":\"GLOBAL\",\"associatedSubscriptions\":[\"mlj\",\"lnymzotqy\",\"yuzcbmqqvxmvw\",\"gtayxonsupeujlz\"],\"description\":\"hcvsqltnzoi\",\"defaultMode\":\"IPS\",\"minAppIdVersion\":\"gnxf\",\"provisioningState\":\"Canceled\",\"securityServices\":{\"vulnerabilityProfile\":\"p\",\"antiSpywareProfile\":\"xwdofdb\",\"antiVirusProfile\":\"qxeiiqbimhtmwwi\",\"urlFilteringProfile\":\"ehfqpofvwbc\",\"fileBlockingProfile\":\"embnkbw\",\"dnsSubscription\":\"vxkdivqihebwtswb\",\"outboundUnTrustCertificate\":\"wfmdurage\",\"outboundTrustCertificate\":\"zvcjfelisdjubggb\"}},\"location\":\"igkxkbsazga\",\"identity\":{\"tenantId\":\"cyrcmjdmspo\",\"principalId\":\"pv\",\"type\":\"None\",\"userAssignedIdentities\":{\"bzjedmstk\":{\"clientId\":\"ni\",\"principalId\":\"rz\"},\"ktwfa\":{\"clientId\":\"l\",\"principalId\":\"bcuiiz\"}}},\"id\":\"nv\",\"name\":\"dibmikostbzbkiwb\",\"type\":\"qnyophzfyls\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListAdvancedSecurityObjectsWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListAdvancedSecurityObjectsWithResponseMockTests.java index 6e8e0c51d4bf0..e6fe5c368ae0c 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListAdvancedSecurityObjectsWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListAdvancedSecurityObjectsWithResponseMockTests.java @@ -6,45 +6,26 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.AdvSecurityObjectListResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.AdvSecurityObjectTypeEnum; -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 GlobalRulestacksListAdvancedSecurityObjectsWithResponseMockTests { @Test public void testListAdvancedSecurityObjectsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":{\"type\":\"xoe\",\"entry\":[{\"name\":\"injipnwjf\",\"description\":\"qlafcbahhpzpofoi\"},{\"name\":\"jwpfilkm\",\"description\":\"holvdn\"},{\"name\":\"viauogphua\",\"description\":\"vtiukyef\"}]},\"nextLink\":\"nmnahmnx\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListAppIdsWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListAppIdsWithResponseMockTests.java index 66bfcf571cdab..ed10f30b07dbb 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListAppIdsWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListAppIdsWithResponseMockTests.java @@ -6,43 +6,24 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ListAppIdResponse; -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 GlobalRulestacksListAppIdsWithResponseMockTests { @Test public void testListAppIdsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[\"wrsnewmozqvbu\",\"qmamhsycxhxzga\"],\"nextLink\":\"taboidvmf\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListFirewallsWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListFirewallsWithResponseMockTests.java index f432fe49d2ee7..821bc6b73eb0d 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListFirewallsWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListFirewallsWithResponseMockTests.java @@ -6,44 +6,25 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ListFirewallsResponse; -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 GlobalRulestacksListFirewallsWithResponseMockTests { @Test public void testListFirewallsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[\"hwpnulaiywzejywh\",\"lwkojpllndnpdw\",\"pqafgfugsnnfhy\",\"tefypococtfjgti\"],\"nextLink\":\"jvzuy\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListMockTests.java index 716038da9b19f..824c4cbe47830 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListMockTests.java @@ -6,48 +6,29 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.DefaultMode; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.GlobalRulestackResource; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ManagedIdentityType; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ScopeType; -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 GlobalRulestacksListMockTests { @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\":{\"panEtag\":\"yfu\",\"panLocation\":\"zsvtuikzhajqgl\",\"scope\":\"LOCAL\",\"associatedSubscriptions\":[\"rqryxynqn\"],\"description\":\"dpsovwxznptgo\",\"defaultMode\":\"NONE\",\"minAppIdVersion\":\"b\",\"provisioningState\":\"Deleting\",\"securityServices\":{\"vulnerabilityProfile\":\"vf\",\"antiSpywareProfile\":\"kvntjlrigjkskyri\",\"antiVirusProfile\":\"vzidsxwaab\",\"urlFilteringProfile\":\"ifrygzn\",\"fileBlockingProfile\":\"axri\",\"dnsSubscription\":\"zob\",\"outboundUnTrustCertificate\":\"pxl\",\"outboundTrustCertificate\":\"lnelxieixynl\"}},\"location\":\"xecwcro\",\"identity\":{\"tenantId\":\"slhcawjutifd\",\"principalId\":\"mvi\",\"type\":\"None\",\"userAssignedIdentities\":{\"zvcpopm\":{\"clientId\":\"bttzhraglkafhonq\",\"principalId\":\"jeick\"}}},\"id\":\"lnwcltyjed\",\"name\":\"xxmlfmkqscazua\",\"type\":\"xtzx\"}]}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListPredefinedUrlCategoriesWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListPredefinedUrlCategoriesWithResponseMockTests.java index c078bd05e18ac..b5f2e6b4fb534 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListPredefinedUrlCategoriesWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListPredefinedUrlCategoriesWithResponseMockTests.java @@ -6,44 +6,25 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.PredefinedUrlCategoriesResponse; -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 GlobalRulestacksListPredefinedUrlCategoriesWithResponseMockTests { @Test public void testListPredefinedUrlCategoriesWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[{\"action\":\"szonwpngajinn\",\"name\":\"xjawrt\"},{\"action\":\"jfjmyccxlzh\",\"name\":\"oxovnekhenlusf\"},{\"action\":\"rd\",\"name\":\"jxtxrdc\"}],\"nextLink\":\"jvidttge\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListSecurityServicesWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListSecurityServicesWithResponseMockTests.java index 8a675d3006284..fd71c2b36e914 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListSecurityServicesWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksListSecurityServicesWithResponseMockTests.java @@ -6,45 +6,26 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SecurityServicesResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SecurityServicesTypeEnum; -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 GlobalRulestacksListSecurityServicesWithResponseMockTests { @Test public void testListSecurityServicesWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":{\"type\":\"ecjxe\",\"entry\":[{\"name\":\"tuhxuicb\",\"description\":\"wmrswnjlxuzrh\"},{\"name\":\"pusxjb\",\"description\":\"ehgpdohzjqatu\"},{\"name\":\"o\",\"description\":\"e\"}]},\"nextLink\":\"ncnwfepbnwgf\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksRevertWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksRevertWithResponseMockTests.java index e889ae74a5731..a76b11704ff31 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksRevertWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksRevertWithResponseMockTests.java @@ -6,41 +6,22 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; -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 GlobalRulestacksRevertWithResponseMockTests { @Test public void testRevertWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 204, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksUpdateWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksUpdateWithResponseMockTests.java index a123e39ba1fe4..20cbb844b17c2 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksUpdateWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/GlobalRulestacksUpdateWithResponseMockTests.java @@ -6,11 +6,9 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.AzureResourceManagerManagedIdentityProperties; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.AzureResourceManagerUserAssignedIdentity; @@ -21,7 +19,6 @@ import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ManagedIdentityType; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ScopeType; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SecurityServices; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; @@ -29,32 +26,16 @@ 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 GlobalRulestacksUpdateWithResponseMockTests { @Test public void testUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"properties\":{\"panEtag\":\"voniypfp\",\"panLocation\":\"cpzgpxtiv\",\"scope\":\"LOCAL\",\"associatedSubscriptions\":[\"dibgqjxgpnrhgov\",\"gpikqmh\",\"ao\"],\"description\":\"rmzvupo\",\"defaultMode\":\"IPS\",\"minAppIdVersion\":\"fuyd\",\"provisioningState\":\"Deleting\",\"securityServices\":{\"vulnerabilityProfile\":\"xcnqmxqpswokmvkh\",\"antiSpywareProfile\":\"gdhbe\",\"antiVirusProfile\":\"qkzszuwiwtglxxh\",\"urlFilteringProfile\":\"fpgpicrmnzhrgm\",\"fileBlockingProfile\":\"j\",\"dnsSubscription\":\"vpqcb\",\"outboundUnTrustCertificate\":\"mbodthsqqgvri\",\"outboundTrustCertificate\":\"a\"}},\"location\":\"c\",\"identity\":{\"tenantId\":\"jfrnxousxauzlwv\",\"principalId\":\"mwohqfzizvuxmmkj\",\"type\":\"None\",\"userAssignedIdentities\":{\"zcugswvxwlmzqw\":{\"clientId\":\"wpztekovmribia\",\"principalId\":\"gplucfotangcfhny\"},\"pdkvg\":{\"clientId\":\"tx\",\"principalId\":\"mxmcuqudtcvclxy\"}}},\"id\":\"buiyji\",\"name\":\"uzphdugnei\",\"type\":\"n\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesDeleteMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesDeleteMockTests.java index 7e447a4d730d1..169ef3412de99 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesDeleteMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesDeleteMockTests.java @@ -6,41 +6,22 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; -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 LocalRulesDeleteMockTests { @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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesGetCountersWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesGetCountersWithResponseMockTests.java index 06d25a6c79028..15aa9fffc0003 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesGetCountersWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesGetCountersWithResponseMockTests.java @@ -6,44 +6,25 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.RuleCounter; -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 LocalRulesGetCountersWithResponseMockTests { @Test public void testGetCountersWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"priority\":\"aeukyawohpm\",\"ruleStackName\":\"qnucs\",\"ruleListName\":\"hsidsjtdlpbnin\",\"firewallName\":\"azlsvbzfcpuo\",\"ruleName\":\"e\",\"hitCount\":606826553,\"appSeen\":{\"count\":1093129601,\"appSeenList\":[{\"title\":\"klhsyekrdrenxol\",\"category\":\"i\",\"subCategory\":\"ehqbeivdlhydwbdb\",\"risk\":\"grlpuny\",\"tag\":\"jlkesmmpath\",\"technology\":\"btahdeanii\",\"standardPorts\":\"llbvgwzsfftedous\"},{\"title\":\"ktjtgra\",\"category\":\"aqo\",\"subCategory\":\"fkbebauzl\",\"risk\":\"btxxwpfhnjzud\",\"tag\":\"tpzkgmeboywhcz\",\"technology\":\"qrhm\",\"standardPorts\":\"gqbedygi\"},{\"title\":\"rzwnyk\",\"category\":\"id\",\"subCategory\":\"chl\",\"risk\":\"mpwctoflds\",\"tag\":\"acdhztxkbr\",\"technology\":\"g\",\"standardPorts\":\"rwjiyew\"},{\"title\":\"fj\",\"category\":\"rwq\",\"subCategory\":\"xet\",\"risk\":\"gcwvrrmdqntycna\",\"tag\":\"thvmaxgnuyeamcmh\",\"technology\":\"dfjeceho\",\"standardPorts\":\"wcpqtwl\"}]},\"timestamp\":\"2021-07-12T03:36:44Z\",\"requestTimestamp\":\"2021-10-04T17:18:20Z\",\"lastUpdatedTimestamp\":\"2021-01-29T11:40:24Z\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesRefreshCountersWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesRefreshCountersWithResponseMockTests.java index 2b10118be3aa2..0b00916942369 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesRefreshCountersWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesRefreshCountersWithResponseMockTests.java @@ -6,41 +6,22 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; -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 LocalRulesRefreshCountersWithResponseMockTests { @Test public void testRefreshCountersWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 204, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesResetCountersWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesResetCountersWithResponseMockTests.java index ea2aea12b65e0..e7c38986364c6 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesResetCountersWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulesResetCountersWithResponseMockTests.java @@ -6,44 +6,25 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.RuleCounterReset; -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 LocalRulesResetCountersWithResponseMockTests { @Test public void testResetCountersWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"priority\":\"zuvrzmzqmz\",\"ruleStackName\":\"rb\",\"ruleListName\":\"vnmdyfoeboj\",\"firewallName\":\"pp\",\"ruleName\":\"aohoqkpjtnq\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksCreateOrUpdateMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksCreateOrUpdateMockTests.java index c398c320a02d4..a03933eae0513 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksCreateOrUpdateMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksCreateOrUpdateMockTests.java @@ -6,11 +6,9 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.AzureResourceManagerManagedIdentityProperties; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.AzureResourceManagerUserAssignedIdentity; @@ -19,7 +17,6 @@ import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ManagedIdentityType; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ScopeType; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SecurityServices; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; @@ -27,32 +24,16 @@ 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 LocalRulestacksCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"properties\":{\"panEtag\":\"lqqbtnyjpylxdbfv\",\"panLocation\":\"mvmsxbae\",\"scope\":\"GLOBAL\",\"associatedSubscriptions\":[\"kottlwuhvajmailf\",\"mjjz\",\"kzwjiqullq\"],\"description\":\"dmvr\",\"defaultMode\":\"NONE\",\"minAppIdVersion\":\"erndbrnyeofltfnn\",\"provisioningState\":\"Succeeded\",\"securityServices\":{\"vulnerabilityProfile\":\"jfynnfmuiiirip\",\"antiSpywareProfile\":\"hykfkxbb\",\"antiVirusProfile\":\"r\",\"urlFilteringProfile\":\"iutgnjizbeewoiy\",\"fileBlockingProfile\":\"vzbjuyrsrzi\",\"dnsSubscription\":\"tixgbd\",\"outboundUnTrustCertificate\":\"ifrevk\",\"outboundTrustCertificate\":\"pezkis\"}},\"identity\":{\"tenantId\":\"mdghsyparyb\",\"principalId\":\"fptb\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"qqzlgcndhz\":{\"clientId\":\"ciuiyqvldaswv\",\"principalId\":\"i\"},\"khgsnxuwwkpphefs\":{\"clientId\":\"rfc\",\"principalId\":\"r\"}}},\"location\":\"xlb\",\"tags\":{\"lwzacn\":\"meikj\",\"qbxyxoyfpuqqi\":\"wpfsuqtaaz\"},\"id\":\"ezxlhdjzqdca\",\"name\":\"wvpsoz\",\"type\":\"iihjriybmrzo\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksDeleteMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksDeleteMockTests.java index e20da8ead9e06..ae5b0905fad9e 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksDeleteMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksDeleteMockTests.java @@ -6,41 +6,22 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; -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 LocalRulestacksDeleteMockTests { @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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksGetByResourceGroupWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksGetByResourceGroupWithResponseMockTests.java index dca3cde3c0d10..5f01d67edcedf 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksGetByResourceGroupWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksGetByResourceGroupWithResponseMockTests.java @@ -6,47 +6,28 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.DefaultMode; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.LocalRulestackResource; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ManagedIdentityType; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ScopeType; -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 LocalRulestacksGetByResourceGroupWithResponseMockTests { @Test public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"properties\":{\"panEtag\":\"jiitnspxlzdesygr\",\"panLocation\":\"waiufanra\",\"scope\":\"GLOBAL\",\"associatedSubscriptions\":[\"qfrojsydgrhyd\",\"ygywe\"],\"description\":\"kiecafygzm\",\"defaultMode\":\"NONE\",\"minAppIdVersion\":\"vdsmaklixq\",\"provisioningState\":\"Creating\",\"securityServices\":{\"vulnerabilityProfile\":\"xalybxawoijpo\",\"antiSpywareProfile\":\"blxpkkwjdjodq\",\"antiVirusProfile\":\"kincnremeh\",\"urlFilteringProfile\":\"izhceumoqodkadp\",\"fileBlockingProfile\":\"ibngqladyw\",\"dnsSubscription\":\"whydt\",\"outboundUnTrustCertificate\":\"vvadswzs\",\"outboundTrustCertificate\":\"yemlowuowhlxln\"}},\"identity\":{\"tenantId\":\"mouvbl\",\"principalId\":\"okzkltr\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"dxlwyojbfqz\":{\"clientId\":\"vrfmvlihcvjd\",\"principalId\":\"crjidhftukv\"},\"valqjrhuzgfxo\":{\"clientId\":\"fnjyix\",\"principalId\":\"fratqxmbjroumzz\"}}},\"location\":\"tpusllywp\",\"tags\":{\"pdbollg\":\"otz\",\"owsocnequygdjbo\":\"yfqiuasig\",\"evadrmmwiu\":\"grmtqjk\",\"kxiidisczskoswo\":\"wvcmj\"},\"id\":\"iqazugamxzkr\",\"name\":\"coiisbamnppcce\",\"type\":\"u\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksGetChangeLogWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksGetChangeLogWithResponseMockTests.java index 2f68d3d7ac611..bde940fe91259 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksGetChangeLogWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksGetChangeLogWithResponseMockTests.java @@ -6,44 +6,25 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.Changelog; -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 LocalRulestacksGetChangeLogWithResponseMockTests { @Test public void testGetChangeLogWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"changes\":[\"epkpe\"],\"lastCommitted\":\"2021-06-28T20:48:42Z\",\"lastModified\":\"2021-07-29T17:20:07Z\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksGetSupportInfoWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksGetSupportInfoWithResponseMockTests.java index 2451bef3d4fd2..a94c1b9d04f1e 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksGetSupportInfoWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksGetSupportInfoWithResponseMockTests.java @@ -6,45 +6,26 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SupportInfo; -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 LocalRulestacksGetSupportInfoWithResponseMockTests { @Test public void testGetSupportInfoWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"productSku\":\"blnsntrpcaqk\",\"productSerial\":\"f\",\"accountRegistered\":\"FALSE\",\"accountId\":\"mhklbnl\",\"userDomainSupported\":\"TRUE\",\"userRegistered\":\"TRUE\",\"freeTrial\":\"TRUE\",\"freeTrialDaysLeft\":1033707853,\"freeTrialCreditLeft\":1377010436,\"helpURL\":\"wusqx\",\"supportURL\":\"rp\",\"registerURL\":\"r\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListAdvancedSecurityObjectsWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListAdvancedSecurityObjectsWithResponseMockTests.java index 5d680ec6ce62d..0969626f96745 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListAdvancedSecurityObjectsWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListAdvancedSecurityObjectsWithResponseMockTests.java @@ -6,45 +6,26 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.AdvSecurityObjectListResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.AdvSecurityObjectTypeEnum; -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 LocalRulestacksListAdvancedSecurityObjectsWithResponseMockTests { @Test public void testListAdvancedSecurityObjectsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":{\"type\":\"gxnoqrxtdis\",\"entry\":[{\"name\":\"evhdlmydid\",\"description\":\"epfwwt\"},{\"name\":\"f\",\"description\":\"esxxhmwcdbckyoi\"},{\"name\":\"xkxhnegknjzrbhtm\",\"description\":\"lvukaobrlb\"}]},\"nextLink\":\"snbagnchjhg\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListAppIdsWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListAppIdsWithResponseMockTests.java index 32bfcd68cb2da..862548cea9fc1 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListAppIdsWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListAppIdsWithResponseMockTests.java @@ -6,43 +6,24 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ListAppIdResponse; -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 LocalRulestacksListAppIdsWithResponseMockTests { @Test public void testListAppIdsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[\"iytssikizbc\"],\"nextLink\":\"q\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListByResourceGroupMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListByResourceGroupMockTests.java index 321210016ba5b..3124f28d98299 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListByResourceGroupMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListByResourceGroupMockTests.java @@ -6,48 +6,29 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.DefaultMode; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.LocalRulestackResource; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ManagedIdentityType; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ScopeType; -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 LocalRulestacksListByResourceGroupMockTests { @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\":{\"panEtag\":\"pqsixymmp\",\"panLocation\":\"ivyqlkjuvsmbmsl\",\"scope\":\"GLOBAL\",\"associatedSubscriptions\":[\"wzdbpqvybefgv\",\"x\",\"okcvtlubses\"],\"description\":\"cua\",\"defaultMode\":\"FIREWALL\",\"minAppIdVersion\":\"unlpirykycndz\",\"provisioningState\":\"Failed\",\"securityServices\":{\"vulnerabilityProfile\":\"reuykbbmnwagl\",\"antiSpywareProfile\":\"xoe\",\"antiVirusProfile\":\"nqlnfwmyymvqd\",\"urlFilteringProfile\":\"bhfckdvezcrcssb\",\"fileBlockingProfile\":\"ddubbnqfblhkal\",\"dnsSubscription\":\"pavawugiqjtio\",\"outboundUnTrustCertificate\":\"gdmin\",\"outboundTrustCertificate\":\"tteajohiygs\"}},\"identity\":{\"tenantId\":\"onhpcz\",\"principalId\":\"mktp\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"zulo\":{\"clientId\":\"sehch\",\"principalId\":\"ufmpqumqyjgy\"}}},\"location\":\"aeuzanh\",\"tags\":{\"wphpzfngqj\":\"hse\",\"fwbeqrkuorh\":\"lidftujwjj\",\"tiq\":\"ssruqnmdvhazcvj\",\"ukvlb\":\"wbqerzwxiytxtd\"},\"id\":\"ktg\",\"name\":\"styoua\",\"type\":\"bewreswmowegmmut\"}]}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListFirewallsWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListFirewallsWithResponseMockTests.java index 07bccf4b37a1b..16f3b2e8eb45c 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListFirewallsWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListFirewallsWithResponseMockTests.java @@ -6,43 +6,24 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ListFirewallsResponse; -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 LocalRulestacksListFirewallsWithResponseMockTests { @Test public void testListFirewallsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[\"ygtvxbyjanepub\",\"pkxyqvgxi\"],\"nextLink\":\"detv\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListMockTests.java index e4327b851971c..4c3b9da0c8df8 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListMockTests.java @@ -6,48 +6,29 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.DefaultMode; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.LocalRulestackResource; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ManagedIdentityType; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ScopeType; -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 LocalRulestacksListMockTests { @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\":{\"panEtag\":\"fayorpravkjoges\",\"panLocation\":\"bnsmjkwynqxaek\",\"scope\":\"GLOBAL\",\"associatedSubscriptions\":[\"wjtq\",\"kev\",\"yltjcrspxklu\",\"cclfgxannn\"],\"description\":\"t\",\"defaultMode\":\"NONE\",\"minAppIdVersion\":\"ewxigpxvk\",\"provisioningState\":\"Failed\",\"securityServices\":{\"vulnerabilityProfile\":\"xvpif\",\"antiSpywareProfile\":\"aifyzyzeyuubeids\",\"antiVirusProfile\":\"fytoi\",\"urlFilteringProfile\":\"gygvfltgvdiho\",\"fileBlockingProfile\":\"krxwet\",\"dnsSubscription\":\"drcyrucpcun\",\"outboundUnTrustCertificate\":\"zdqumoe\",\"outboundTrustCertificate\":\"dnaienhqhskndnel\"}},\"identity\":{\"tenantId\":\"adlknwfoanni\",\"principalId\":\"petxivcnrlyxnu\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"zqymtuowogtgits\":{\"clientId\":\"blkwqpatvbqs\",\"principalId\":\"cjbctviv\"}}},\"location\":\"zvbrzcdbanfzndsc\",\"tags\":{\"ibqbnaomhjrm\":\"eatkdbmwnrdj\",\"maxljalfihcj\":\"u\"},\"id\":\"obcancdexxqcw\",\"name\":\"a\",\"type\":\"fgvaknokzwj\"}]}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListPredefinedUrlCategoriesWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListPredefinedUrlCategoriesWithResponseMockTests.java index 8cedf0b601af2..2043778b26b1c 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListPredefinedUrlCategoriesWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListPredefinedUrlCategoriesWithResponseMockTests.java @@ -6,43 +6,24 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.PredefinedUrlCategoriesResponse; -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 LocalRulestacksListPredefinedUrlCategoriesWithResponseMockTests { @Test public void testListPredefinedUrlCategoriesWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[{\"action\":\"y\",\"name\":\"xpvelszerqzevxo\"}],\"nextLink\":\"intxwa\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListSecurityServicesWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListSecurityServicesWithResponseMockTests.java index e3542ff9f873f..7765ed803e291 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListSecurityServicesWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksListSecurityServicesWithResponseMockTests.java @@ -6,45 +6,26 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SecurityServicesResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SecurityServicesTypeEnum; -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 LocalRulestacksListSecurityServicesWithResponseMockTests { @Test public void testListSecurityServicesWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":{\"type\":\"afjrqpjiyrqjcrg\",\"entry\":[{\"name\":\"wmzwdfkbnrzorpdl\",\"description\":\"qctqjfg\"},{\"name\":\"xsaetg\",\"description\":\"gvpyigdaqqilzdc\"},{\"name\":\"uwjoedxnguca\",\"description\":\"pa\"}]},\"nextLink\":\"wwgilfjqqacdm\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksRevertWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksRevertWithResponseMockTests.java index c9c4d4d509109..935ea90b9fc30 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksRevertWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/LocalRulestacksRevertWithResponseMockTests.java @@ -6,41 +6,22 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; -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 LocalRulestacksRevertWithResponseMockTests { @Test public void testRevertWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 204, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/OperationsListMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/OperationsListMockTests.java index fa11fedf550ec..c96580828962b 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/OperationsListMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/OperationsListMockTests.java @@ -6,44 +6,25 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.Operation; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class OperationsListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[{\"name\":\"pkxkdtxfk\",\"isDataAction\":false,\"display\":{\"provider\":\"twknvgm\",\"resource\":\"ugtywatmqaqkue\",\"operation\":\"groeshoyg\",\"description\":\"byfqxkfaoy\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PostRulesDeleteMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PostRulesDeleteMockTests.java index 5aa90e2640b59..b5edd66e867d0 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PostRulesDeleteMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PostRulesDeleteMockTests.java @@ -6,41 +6,22 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; -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 PostRulesDeleteMockTests { @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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PostRulesGetCountersWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PostRulesGetCountersWithResponseMockTests.java index b87e9dae0c3f9..a539a72772234 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PostRulesGetCountersWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PostRulesGetCountersWithResponseMockTests.java @@ -6,44 +6,25 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.RuleCounter; -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 PostRulesGetCountersWithResponseMockTests { @Test public void testGetCountersWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"priority\":\"vuhx\",\"ruleStackName\":\"mrutznabaobnsluj\",\"ruleListName\":\"ltymkmvguihywart\",\"firewallName\":\"phkixkykxdssjpe\",\"ruleName\":\"mucfxhikkf\",\"hitCount\":820394546,\"appSeen\":{\"count\":1139765013,\"appSeenList\":[{\"title\":\"incqlhriswsl\",\"category\":\"iiiovgqcgxuugq\",\"subCategory\":\"ctotiowlx\",\"risk\":\"e\",\"tag\":\"dptjgwdtgukranb\",\"technology\":\"wphqlkccuzgygqw\",\"standardPorts\":\"hoi\"},{\"title\":\"lwgniiprglvawu\",\"category\":\"z\",\"subCategory\":\"ufypiv\",\"risk\":\"sbbjpmcu\",\"tag\":\"kmifoxxkub\",\"technology\":\"phavpmhbrb\",\"standardPorts\":\"gvgovpbbttefjo\"}]},\"timestamp\":\"2021-09-11T19:23:39Z\",\"requestTimestamp\":\"2021-09-09T22:16:26Z\",\"lastUpdatedTimestamp\":\"2021-11-25T13:17:50Z\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PostRulesRefreshCountersWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PostRulesRefreshCountersWithResponseMockTests.java index 0188ec28e3cdc..1e468d32fe84c 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PostRulesRefreshCountersWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PostRulesRefreshCountersWithResponseMockTests.java @@ -6,41 +6,22 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; -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 PostRulesRefreshCountersWithResponseMockTests { @Test public void testRefreshCountersWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 204, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PostRulesResetCountersWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PostRulesResetCountersWithResponseMockTests.java index 4d46fceb89f37..5b7d7bc64500e 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PostRulesResetCountersWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PostRulesResetCountersWithResponseMockTests.java @@ -6,44 +6,25 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.RuleCounterReset; -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 PostRulesResetCountersWithResponseMockTests { @Test public void testResetCountersWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"priority\":\"ui\",\"ruleStackName\":\"ey\",\"ruleListName\":\"wlpaugmrmfjlrxwt\",\"firewallName\":\"ukhfkvc\",\"ruleName\":\"izmoaeds\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PreRulesDeleteMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PreRulesDeleteMockTests.java index 9291235486241..69ce5d6daa4fc 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PreRulesDeleteMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PreRulesDeleteMockTests.java @@ -6,41 +6,22 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; -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 PreRulesDeleteMockTests { @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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PreRulesGetCountersWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PreRulesGetCountersWithResponseMockTests.java index 7165851356c1b..508509cd76a17 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PreRulesGetCountersWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PreRulesGetCountersWithResponseMockTests.java @@ -6,44 +6,25 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.RuleCounter; -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 PreRulesGetCountersWithResponseMockTests { @Test public void testGetCountersWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"priority\":\"jenkyh\",\"ruleStackName\":\"zv\",\"ruleListName\":\"xfxjelgcmpzqj\",\"firewallName\":\"hqxu\",\"ruleName\":\"yvca\",\"hitCount\":422708965,\"appSeen\":{\"count\":154545602,\"appSeenList\":[{\"title\":\"bsizus\",\"category\":\"szlbscm\",\"subCategory\":\"lzijiufehgmvflnw\",\"risk\":\"v\",\"tag\":\"kxrerlniylylyfwx\",\"technology\":\"utgqztwh\",\"standardPorts\":\"hmupgxyjtcdxabbu\"},{\"title\":\"ftabenbbklqp\",\"category\":\"zucafeddww\",\"subCategory\":\"lzafwxu\",\"risk\":\"gnhgook\",\"tag\":\"talvnbwgp\",\"technology\":\"emeluclv\",\"standardPorts\":\"jjukyrdnqodxah\"},{\"title\":\"xhqf\",\"category\":\"qnvzoqgyipemch\",\"subCategory\":\"avsczuejdtxp\",\"risk\":\"lghwzhome\",\"tag\":\"jjstliuhqawmo\",\"technology\":\"ia\",\"standardPorts\":\"cz\"},{\"title\":\"vodrrslblxydkxr\",\"category\":\"vvbxiwkgfbqljnq\",\"subCategory\":\"hychocokuleh\",\"risk\":\"rqlrqffawe\",\"tag\":\"urkphyjdxravju\",\"technology\":\"dbrxmrgc\",\"standardPorts\":\"bapxkiyfjjkb\"}]},\"timestamp\":\"2021-06-24T10:14:07Z\",\"requestTimestamp\":\"2021-04-28T23:33:04Z\",\"lastUpdatedTimestamp\":\"2021-07-08T05:49:52Z\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PreRulesRefreshCountersWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PreRulesRefreshCountersWithResponseMockTests.java index 0013a6764113f..9e597e3b472a6 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PreRulesRefreshCountersWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PreRulesRefreshCountersWithResponseMockTests.java @@ -6,41 +6,22 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; -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 PreRulesRefreshCountersWithResponseMockTests { @Test public void testRefreshCountersWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 204, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PreRulesResetCountersWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PreRulesResetCountersWithResponseMockTests.java index 5275b03b51ea3..97d59c7ae4e05 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PreRulesResetCountersWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PreRulesResetCountersWithResponseMockTests.java @@ -6,44 +6,25 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.RuleCounterReset; -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 PreRulesResetCountersWithResponseMockTests { @Test public void testResetCountersWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"priority\":\"owftptnuwjtks\",\"ruleStackName\":\"gcgqyhleseyqrhvy\",\"ruleListName\":\"dotjvdk\",\"firewallName\":\"swskuk\",\"ruleName\":\"asbvw\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListGlobalRulestacksCreateOrUpdateMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListGlobalRulestacksCreateOrUpdateMockTests.java index 42dcc00555620..231196e354801 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListGlobalRulestacksCreateOrUpdateMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListGlobalRulestacksCreateOrUpdateMockTests.java @@ -6,46 +6,27 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.PrefixListGlobalRulestackResourceInner; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.PrefixListGlobalRulestackResource; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class PrefixListGlobalRulestacksCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"properties\":{\"description\":\"qagnepzwakl\",\"prefixList\":[\"sbq\",\"qagwwrxaomz\"],\"etag\":\"glrrczez\",\"auditComment\":\"hltnjadhqoawjq\",\"provisioningState\":\"Succeeded\"},\"id\":\"ayfbpcm\",\"name\":\"plby\",\"type\":\"rueqthwm\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListGlobalRulestacksDeleteMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListGlobalRulestacksDeleteMockTests.java index e1433c3154a63..71368f418710f 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListGlobalRulestacksDeleteMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListGlobalRulestacksDeleteMockTests.java @@ -6,41 +6,22 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; -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 PrefixListGlobalRulestacksDeleteMockTests { @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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListGlobalRulestacksGetWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListGlobalRulestacksGetWithResponseMockTests.java index 5d04155221481..6cc8c25889f9b 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListGlobalRulestacksGetWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListGlobalRulestacksGetWithResponseMockTests.java @@ -6,44 +6,25 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.PrefixListGlobalRulestackResource; -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 PrefixListGlobalRulestacksGetWithResponseMockTests { @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\":{\"description\":\"c\",\"prefixList\":[\"zvxnqmhrp\"],\"etag\":\"df\",\"auditComment\":\"kois\",\"provisioningState\":\"Failed\"},\"id\":\"f\",\"name\":\"xuifmcsypobkdqz\",\"type\":\"dzsylollgtrczz\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListGlobalRulestacksListMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListGlobalRulestacksListMockTests.java index 282cdbe9e96e1..dffb6e8cd31ea 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListGlobalRulestacksListMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListGlobalRulestacksListMockTests.java @@ -6,45 +6,26 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.PrefixListGlobalRulestackResource; -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 PrefixListGlobalRulestacksListMockTests { @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\":{\"description\":\"cgyee\",\"prefixList\":[\"ei\",\"bp\",\"mgomg\"],\"etag\":\"mljdlrgmsplzga\",\"auditComment\":\"cshhv\",\"provisioningState\":\"Deleting\"},\"id\":\"nxkympqanxrjk\",\"name\":\"xtwbta\",\"type\":\"ypnyghshxc\"}]}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestacksCreateOrUpdateMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestacksCreateOrUpdateMockTests.java index 4bef165d3ff9b..6a636ff1d24ba 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestacksCreateOrUpdateMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestacksCreateOrUpdateMockTests.java @@ -6,45 +6,26 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.PrefixListResource; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class PrefixListLocalRulestacksCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"properties\":{\"description\":\"dmskxknpdgzigjsu\",\"prefixList\":[\"whgsaodkww\",\"bafo\",\"to\"],\"etag\":\"haquvwsxbgnvk\",\"auditComment\":\"vqchoadhrs\",\"provisioningState\":\"Succeeded\"},\"id\":\"vspabdsrgfajgl\",\"name\":\"rsubklrxhjnl\",\"type\":\"cetjdvq\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestacksDeleteMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestacksDeleteMockTests.java index 6979375777452..2567d84555787 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestacksDeleteMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestacksDeleteMockTests.java @@ -6,41 +6,22 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; -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 PrefixListLocalRulestacksDeleteMockTests { @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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestacksGetWithResponseMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestacksGetWithResponseMockTests.java index a09a0f1723d57..f4396d6d1a432 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestacksGetWithResponseMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestacksGetWithResponseMockTests.java @@ -6,44 +6,25 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.PrefixListResource; -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 PrefixListLocalRulestacksGetWithResponseMockTests { @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\":{\"description\":\"kdveksb\",\"prefixList\":[\"oduchvlscr\",\"pibfdy\",\"dusspyszekbhwlka\"],\"etag\":\"gkrehbf\",\"auditComment\":\"uybffljfiim\",\"provisioningState\":\"NotSpecified\"},\"id\":\"g\",\"name\":\"qtaadusrexxfavsq\",\"type\":\"udo\"}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestacksListByLocalRulestacksMockTests.java b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestacksListByLocalRulestacksMockTests.java index 0438baec67b82..fb6a6e8e98a06 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestacksListByLocalRulestacksMockTests.java +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/src/test/java/com/azure/resourcemanager/paloaltonetworks/ngfw/generated/PrefixListLocalRulestacksListByLocalRulestacksMockTests.java @@ -6,45 +6,26 @@ 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.core.test.http.MockHttpResponse; import com.azure.resourcemanager.paloaltonetworks.ngfw.PaloAltoNetworksNgfwManager; import com.azure.resourcemanager.paloaltonetworks.ngfw.models.PrefixListResource; -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 PrefixListLocalRulestacksListByLocalRulestacksMockTests { @Test public void testListByLocalRulestacks() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[{\"properties\":{\"description\":\"kwaaesk\",\"prefixList\":[\"jlpzeqtoyrp\",\"ixlajmllpquevham\"],\"etag\":\"wg\",\"auditComment\":\"tmk\",\"provisioningState\":\"Succeeded\"},\"id\":\"kzwaqxofq\",\"name\":\"vchiqbpl\",\"type\":\"fidusztekxbyjgm\"}]}"; - 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); - })); - + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); PaloAltoNetworksNgfwManager manager = PaloAltoNetworksNgfwManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)),