From 345b9f161d9e3b6f846f05bdd902cd1829753525 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 30 Sep 2022 16:30:16 +0000 Subject: [PATCH] CodeGen from PR 20942 in Azure/azure-rest-api-specs Merge 08364119d684b938c28c69ce54420d80cf3c007c into 812592d05854e761c71f3ba67227e66175d6e7a9 --- .../CHANGELOG.md | 4 +- .../README.md | 4 +- .../SAMPLE.md | 64 ++++- .../pom.xml | 2 +- .../fluent/AzureTrafficCollectorsClient.java | 26 +- .../fluent/CollectorPoliciesClient.java | 50 +++- .../models/AzureTrafficCollectorInner.java | 20 +- ...AzureTrafficCollectorPropertiesFormat.java | 21 +- .../fluent/models/CollectorPolicyInner.java | 23 +- .../CollectorPolicyPropertiesFormat.java | 4 + .../fluent/models/OperationInner.java | 4 + .../AzureTrafficCollectorImpl.java | 19 +- ...afficCollectorManagementClientBuilder.java | 34 +-- ...eTrafficCollectorManagementClientImpl.java | 2 +- ...cCollectorsByResourceGroupsClientImpl.java | 6 +- ...icCollectorsBySubscriptionsClientImpl.java | 6 +- .../AzureTrafficCollectorsClientImpl.java | 35 +-- .../AzureTrafficCollectorsImpl.java | 20 +- .../CollectorPoliciesClientImpl.java | 239 +++++++++++++++++- .../implementation/CollectorPoliciesImpl.java | 20 +- .../implementation/CollectorPolicyImpl.java | 61 ++++- .../models/AzureTrafficCollector.java | 16 +- .../AzureTrafficCollectorListResult.java | 4 + .../models/AzureTrafficCollectors.java | 12 +- .../models/CollectorPolicies.java | 12 +- .../models/CollectorPolicy.java | 92 +++++-- .../models/CollectorPolicyListResult.java | 4 + .../models/DestinationType.java | 2 +- .../EmissionPoliciesPropertiesFormat.java | 4 + .../models/EmissionPolicyDestination.java | 4 + .../networkfunction/models/EmissionType.java | 2 +- .../IngestionPolicyPropertiesFormat.java | 4 + .../IngestionSourcesPropertiesFormat.java | 4 + .../networkfunction/models/IngestionType.java | 2 +- .../models/OperationDisplay.java | 4 + .../models/OperationListResult.java | 7 +- .../models/ProvisioningState.java | 2 +- .../models/ResourceReference.java | 4 + .../networkfunction/models/SourceType.java | 2 +- .../networkfunction/models/TagsObject.java | 4 + ...sourceGroupListByResourceGroupSamples.java | 2 +- ...icCollectorsBySubscriptionListSamples.java | 2 +- ...rafficCollectorsCreateOrUpdateSamples.java | 4 +- .../AzureTrafficCollectorsDeleteSamples.java | 2 +- ...icCollectorsGetByResourceGroupSamples.java | 2 +- ...ureTrafficCollectorsUpdateTagsSamples.java | 2 +- ...ollectorPoliciesCreateOrUpdateSamples.java | 3 +- .../CollectorPoliciesDeleteSamples.java | 2 +- .../CollectorPoliciesGetSamples.java | 2 +- .../CollectorPoliciesListSamples.java | 2 +- .../CollectorPoliciesUpdateTagsSamples.java | 39 +++ .../NetworkFunctionListOperationsSamples.java | 2 +- 52 files changed, 692 insertions(+), 221 deletions(-) create mode 100644 sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/CollectorPoliciesUpdateTagsSamples.java diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/CHANGELOG.md b/sdk/networkfunction/azure-resourcemanager-networkfunction/CHANGELOG.md index 7073b6a64900..e42d9e9a9f34 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/CHANGELOG.md +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2022-09-30) + +- Azure Resource Manager AzureTrafficCollector client library for Java. This package contains Microsoft Azure SDK for AzureTrafficCollector Management SDK. Azure Traffic Collector service. Package tag package-2022-11-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/README.md b/sdk/networkfunction/azure-resourcemanager-networkfunction/README.md index 02e98ca14974..2dc65486f325 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/README.md +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/README.md @@ -2,7 +2,7 @@ Azure Resource Manager AzureTrafficCollector client library for Java. -This package contains Microsoft Azure SDK for AzureTrafficCollector Management SDK. Azure Traffic Collector service. Package tag package-2022-05-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for AzureTrafficCollector Management SDK. Azure Traffic Collector service. Package tag package-2022-11-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-networkfunction - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/SAMPLE.md b/sdk/networkfunction/azure-resourcemanager-networkfunction/SAMPLE.md index 876d357a4890..d08cdd7407c0 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/SAMPLE.md +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/SAMPLE.md @@ -22,6 +22,7 @@ - [Delete](#collectorpolicies_delete) - [Get](#collectorpolicies_get) - [List](#collectorpolicies_list) +- [UpdateTags](#collectorpolicies_updatetags) ## NetworkFunction @@ -29,14 +30,13 @@ ### AzureTrafficCollectors_CreateOrUpdate ```java -import java.util.Arrays; import java.util.HashMap; import java.util.Map; /** Samples for AzureTrafficCollectors CreateOrUpdate. */ public final class AzureTrafficCollectorsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/AzureTrafficCollectorCreate.json + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorCreate.json */ /** * Sample code: Create a traffic collector. @@ -51,7 +51,6 @@ public final class AzureTrafficCollectorsCreateOrUpdateSamples { .withRegion("West US") .withExistingResourceGroup("rg1") .withTags(mapOf("key1", "value1")) - .withCollectorPolicies(Arrays.asList()) .create(); } @@ -76,7 +75,7 @@ import com.azure.core.util.Context; /** Samples for AzureTrafficCollectors Delete. */ public final class AzureTrafficCollectorsDeleteSamples { /* - * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/AzureTrafficCollectorDelete.json + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorDelete.json */ /** * Sample code: Delete Traffic Collector. @@ -98,7 +97,7 @@ import com.azure.core.util.Context; /** Samples for AzureTrafficCollectors GetByResourceGroup. */ public final class AzureTrafficCollectorsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/AzureTrafficCollectorGet.json + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorGet.json */ /** * Sample code: Get Traffic Collector. @@ -123,7 +122,7 @@ import java.util.Map; /** Samples for AzureTrafficCollectors UpdateTags. */ public final class AzureTrafficCollectorsUpdateTagsSamples { /* - * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/AzureTrafficCollectorUpdateTags.json + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorUpdateTags.json */ /** * Sample code: Update Traffic Collector tags. @@ -158,7 +157,7 @@ import com.azure.core.util.Context; /** Samples for AzureTrafficCollectorsByResourceGroup ListByResourceGroup. */ public final class AzureTrafficCollectorsByResourceGroupListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/AzureTrafficCollectorsByResourceGroupList.json + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorsByResourceGroupList.json */ /** * Sample code: List of Traffic Collectors by ResourceGroup. @@ -180,7 +179,7 @@ import com.azure.core.util.Context; /** Samples for AzureTrafficCollectorsBySubscription List. */ public final class AzureTrafficCollectorsBySubscriptionListSamples { /* - * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/AzureTrafficCollectorsBySubscriptionList.json + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorsBySubscriptionList.json */ /** * Sample code: List of Traffic Collectors by Subscription. @@ -210,7 +209,7 @@ import java.util.Arrays; /** Samples for CollectorPolicies CreateOrUpdate. */ public final class CollectorPoliciesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/CollectorPolicyCreate.json + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPolicyCreate.json */ /** * Sample code: Create a collection policy. @@ -222,6 +221,7 @@ public final class CollectorPoliciesCreateOrUpdateSamples { manager .collectorPolicies() .define("cp1") + .withRegion("West US") .withExistingAzureTrafficCollector("rg1", "atc") .withIngestionPolicy( new IngestionPolicyPropertiesFormat() @@ -256,7 +256,7 @@ import com.azure.core.util.Context; /** Samples for CollectorPolicies Delete. */ public final class CollectorPoliciesDeleteSamples { /* - * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/CollectorPolicyDelete.json + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPolicyDelete.json */ /** * Sample code: Delete Collection Policy. @@ -278,7 +278,7 @@ import com.azure.core.util.Context; /** Samples for CollectorPolicies Get. */ public final class CollectorPoliciesGetSamples { /* - * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/CollectorPolicyGet.json + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPolicyGet.json */ /** * Sample code: Get Collection Policy. @@ -300,7 +300,7 @@ import com.azure.core.util.Context; /** Samples for CollectorPolicies List. */ public final class CollectorPoliciesListSamples { /* - * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/CollectorPoliciesList.json + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPoliciesList.json */ /** * Sample code: List of Collection Policies. @@ -314,6 +314,44 @@ public final class CollectorPoliciesListSamples { } ``` +### CollectorPolicies_UpdateTags + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkfunction.models.CollectorPolicy; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CollectorPolicies UpdateTags. */ +public final class CollectorPoliciesUpdateTagsSamples { + /* + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPolicyUpdateTags.json + */ + /** + * Sample code: Update Collector Policy tags. + * + * @param manager Entry point to AzureTrafficCollectorManager. + */ + public static void updateCollectorPolicyTags( + com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager manager) { + CollectorPolicy resource = + manager.collectorPolicies().getWithResponse("rg1", "atc", "cp1", Context.NONE).getValue(); + resource.update().withTags(mapOf("key1", "value1", "key2", "value2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + ### NetworkFunction_ListOperations ```java @@ -322,7 +360,7 @@ import com.azure.core.util.Context; /** Samples for NetworkFunction ListOperations. */ public final class NetworkFunctionListOperationsSamples { /* - * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/OperationsList.json + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/OperationsList.json */ /** * Sample code: OperationsList. diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/pom.xml b/sdk/networkfunction/azure-resourcemanager-networkfunction/pom.xml index bb2f551abe6e..37e247c6b3f1 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/pom.xml +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/pom.xml @@ -13,7 +13,7 @@ jar Microsoft Azure SDK for AzureTrafficCollector Management - This package contains Microsoft Azure SDK for AzureTrafficCollector Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Traffic Collector service. Package tag package-2022-05-01. + This package contains Microsoft Azure SDK for AzureTrafficCollector Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Traffic Collector service. Package tag package-2022-11-01. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/AzureTrafficCollectorsClient.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/AzureTrafficCollectorsClient.java index 6604511f0ce4..2408b69c156e 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/AzureTrafficCollectorsClient.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/AzureTrafficCollectorsClient.java @@ -20,28 +20,28 @@ public interface AzureTrafficCollectorsClient { * * @param resourceGroupName The name of the resource group. * @param azureTrafficCollectorName Azure Traffic Collector name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure Traffic Collector in a specified resource group. + * @return the specified Azure Traffic Collector in a specified resource group along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AzureTrafficCollectorInner getByResourceGroup(String resourceGroupName, String azureTrafficCollectorName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String azureTrafficCollectorName, Context context); /** * Gets the specified Azure Traffic Collector in a specified resource group. * * @param resourceGroupName The name of the resource group. * @param azureTrafficCollectorName Azure Traffic Collector name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure Traffic Collector in a specified resource group along with {@link Response}. + * @return the specified Azure Traffic Collector in a specified resource group. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String azureTrafficCollectorName, Context context); + AzureTrafficCollectorInner getByResourceGroup(String resourceGroupName, String azureTrafficCollectorName); /** * Creates or updates a Azure Traffic Collector resource. @@ -170,14 +170,15 @@ SyncPoller, Void> beginDelete( * @param resourceGroupName The name of the resource group. * @param azureTrafficCollectorName Azure Traffic Collector name. * @param parameters Parameters supplied to update Azure Traffic Collector tags. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Traffic Collector resource. + * @return azure Traffic Collector resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AzureTrafficCollectorInner updateTags( - String resourceGroupName, String azureTrafficCollectorName, TagsObject parameters); + Response updateTagsWithResponse( + String resourceGroupName, String azureTrafficCollectorName, TagsObject parameters, Context context); /** * Updates the specified Azure Traffic Collector tags. @@ -185,13 +186,12 @@ AzureTrafficCollectorInner updateTags( * @param resourceGroupName The name of the resource group. * @param azureTrafficCollectorName Azure Traffic Collector name. * @param parameters Parameters supplied to update Azure Traffic Collector tags. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Traffic Collector resource along with {@link Response}. + * @return azure Traffic Collector resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateTagsWithResponse( - String resourceGroupName, String azureTrafficCollectorName, TagsObject parameters, Context context); + AzureTrafficCollectorInner updateTags( + String resourceGroupName, String azureTrafficCollectorName, TagsObject parameters); } diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/CollectorPoliciesClient.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/CollectorPoliciesClient.java index 4535f6267c6d..35f981c70660 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/CollectorPoliciesClient.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/CollectorPoliciesClient.java @@ -12,6 +12,7 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.networkfunction.fluent.models.CollectorPolicyInner; +import com.azure.resourcemanager.networkfunction.models.TagsObject; /** An instance of this class provides access to all the operations defined in CollectorPoliciesClient. */ public interface CollectorPoliciesClient { @@ -49,13 +50,15 @@ PagedIterable list( * @param resourceGroupName The name of the resource group. * @param azureTrafficCollectorName Azure Traffic Collector name. * @param collectorPolicyName Collector Policy Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collector policy in a specified Traffic Collector. + * @return the collector policy in a specified Traffic Collector along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - CollectorPolicyInner get(String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName); + Response getWithResponse( + String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName, Context context); /** * Gets the collector policy in a specified Traffic Collector. @@ -63,15 +66,13 @@ PagedIterable list( * @param resourceGroupName The name of the resource group. * @param azureTrafficCollectorName Azure Traffic Collector name. * @param collectorPolicyName Collector Policy Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collector policy in a specified Traffic Collector along with {@link Response}. + * @return the collector policy in a specified Traffic Collector. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName, Context context); + CollectorPolicyInner get(String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName); /** * Creates or updates a Collector Policy resource. @@ -211,4 +212,41 @@ SyncPoller, Void> beginDelete( @ServiceMethod(returns = ReturnType.SINGLE) void delete( String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName, Context context); + + /** + * Updates the specified Collector Policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param azureTrafficCollectorName Azure Traffic Collector name. + * @param collectorPolicyName Collector Policy Name. + * @param parameters Parameters supplied to update Collector Policy tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collector policy resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, + String azureTrafficCollectorName, + String collectorPolicyName, + TagsObject parameters, + Context context); + + /** + * Updates the specified Collector Policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param azureTrafficCollectorName Azure Traffic Collector name. + * @param collectorPolicyName Collector Policy Name. + * @param parameters Parameters supplied to update Collector Policy tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collector policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CollectorPolicyInner updateTags( + String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName, TagsObject parameters); } diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/AzureTrafficCollectorInner.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/AzureTrafficCollectorInner.java index a4e9f9f30cbc..3ff1a1e4bf2d 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/AzureTrafficCollectorInner.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/AzureTrafficCollectorInner.java @@ -34,6 +34,10 @@ public final class AzureTrafficCollectorInner extends Resource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** Creates an instance of AzureTrafficCollectorInner class. */ + public AzureTrafficCollectorInner() { + } + /** * Get the innerProperties property: Properties of the Azure Traffic Collector. * @@ -80,24 +84,10 @@ public AzureTrafficCollectorInner withTags(Map tags) { * * @return the collectorPolicies value. */ - public List collectorPolicies() { + public List collectorPolicies() { return this.innerProperties() == null ? null : this.innerProperties().collectorPolicies(); } - /** - * Set the collectorPolicies property: Collector Policies for Azure Traffic Collector. - * - * @param collectorPolicies the collectorPolicies value to set. - * @return the AzureTrafficCollectorInner object itself. - */ - public AzureTrafficCollectorInner withCollectorPolicies(List collectorPolicies) { - if (this.innerProperties() == null) { - this.innerProperties = new AzureTrafficCollectorPropertiesFormat(); - } - this.innerProperties().withCollectorPolicies(collectorPolicies); - return this; - } - /** * Get the virtualHub property: The virtualHub to which the Azure Traffic Collector belongs. * diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/AzureTrafficCollectorPropertiesFormat.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/AzureTrafficCollectorPropertiesFormat.java index 9c6aec5694db..abee74d7ef98 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/AzureTrafficCollectorPropertiesFormat.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/AzureTrafficCollectorPropertiesFormat.java @@ -16,8 +16,8 @@ public final class AzureTrafficCollectorPropertiesFormat { /* * Collector Policies for Azure Traffic Collector. */ - @JsonProperty(value = "collectorPolicies") - private List collectorPolicies; + @JsonProperty(value = "collectorPolicies", access = JsonProperty.Access.WRITE_ONLY) + private List collectorPolicies; /* * The virtualHub to which the Azure Traffic Collector belongs. @@ -31,26 +31,19 @@ public final class AzureTrafficCollectorPropertiesFormat { @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; + /** Creates an instance of AzureTrafficCollectorPropertiesFormat class. */ + public AzureTrafficCollectorPropertiesFormat() { + } + /** * Get the collectorPolicies property: Collector Policies for Azure Traffic Collector. * * @return the collectorPolicies value. */ - public List collectorPolicies() { + public List collectorPolicies() { return this.collectorPolicies; } - /** - * Set the collectorPolicies property: Collector Policies for Azure Traffic Collector. - * - * @param collectorPolicies the collectorPolicies value to set. - * @return the AzureTrafficCollectorPropertiesFormat object itself. - */ - public AzureTrafficCollectorPropertiesFormat withCollectorPolicies(List collectorPolicies) { - this.collectorPolicies = collectorPolicies; - return this; - } - /** * Get the virtualHub property: The virtualHub to which the Azure Traffic Collector belongs. * diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/CollectorPolicyInner.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/CollectorPolicyInner.java index a4bfc646ae6f..e36c433a15b7 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/CollectorPolicyInner.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/CollectorPolicyInner.java @@ -5,17 +5,18 @@ package com.azure.resourcemanager.networkfunction.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; +import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.resourcemanager.networkfunction.models.EmissionPoliciesPropertiesFormat; import com.azure.resourcemanager.networkfunction.models.IngestionPolicyPropertiesFormat; import com.azure.resourcemanager.networkfunction.models.ProvisioningState; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +import java.util.Map; /** Collector policy resource. */ @Fluent -public final class CollectorPolicyInner extends ProxyResource { +public final class CollectorPolicyInner extends Resource { /* * Properties of the Collector Policy. */ @@ -34,6 +35,10 @@ public final class CollectorPolicyInner extends ProxyResource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** Creates an instance of CollectorPolicyInner class. */ + public CollectorPolicyInner() { + } + /** * Get the innerProperties property: Properties of the Collector Policy. * @@ -61,6 +66,20 @@ public SystemData systemData() { return this.systemData; } + /** {@inheritDoc} */ + @Override + public CollectorPolicyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public CollectorPolicyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + /** * Get the ingestionPolicy property: Ingestion policies. * diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/CollectorPolicyPropertiesFormat.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/CollectorPolicyPropertiesFormat.java index c96568da5fe0..64d3de7c9212 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/CollectorPolicyPropertiesFormat.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/CollectorPolicyPropertiesFormat.java @@ -32,6 +32,10 @@ public final class CollectorPolicyPropertiesFormat { @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; + /** Creates an instance of CollectorPolicyPropertiesFormat class. */ + public CollectorPolicyPropertiesFormat() { + } + /** * Get the ingestionPolicy property: Ingestion policies. * diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/OperationInner.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/OperationInner.java index 4ad869d1fcf0..98c894fbd1a8 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/OperationInner.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/OperationInner.java @@ -35,6 +35,10 @@ public final class OperationInner { @JsonProperty(value = "origin") private String origin; + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + /** * Get the name property: Operation name: {provider}/{resource}/{operation}. * diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorImpl.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorImpl.java index a1d31b878e40..f06d2e89d781 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorImpl.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorImpl.java @@ -8,16 +8,13 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.networkfunction.fluent.models.AzureTrafficCollectorInner; -import com.azure.resourcemanager.networkfunction.fluent.models.CollectorPolicyInner; import com.azure.resourcemanager.networkfunction.models.AzureTrafficCollector; -import com.azure.resourcemanager.networkfunction.models.CollectorPolicy; import com.azure.resourcemanager.networkfunction.models.ProvisioningState; import com.azure.resourcemanager.networkfunction.models.ResourceReference; import com.azure.resourcemanager.networkfunction.models.TagsObject; import java.util.Collections; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; public final class AzureTrafficCollectorImpl implements AzureTrafficCollector, AzureTrafficCollector.Definition, AzureTrafficCollector.Update { @@ -58,15 +55,10 @@ public SystemData systemData() { return this.innerModel().systemData(); } - public List collectorPolicies() { - List inner = this.innerModel().collectorPolicies(); + public List collectorPolicies() { + List inner = this.innerModel().collectorPolicies(); if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new CollectorPolicyImpl(inner1, this.manager())) - .collect(Collectors.toList())); + return Collections.unmodifiableList(inner); } else { return Collections.emptyList(); } @@ -210,11 +202,6 @@ public AzureTrafficCollectorImpl withTags(Map tags) { } } - public AzureTrafficCollectorImpl withCollectorPolicies(List collectorPolicies) { - this.innerModel().withCollectorPolicies(collectorPolicies); - return this; - } - public AzureTrafficCollectorImpl withVirtualHub(ResourceReference virtualHub) { this.innerModel().withVirtualHub(virtualHub); return this; diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorManagementClientBuilder.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorManagementClientBuilder.java index f2427264f6f2..15df1fa99ecd 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorManagementClientBuilder.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorManagementClientBuilder.java @@ -119,24 +119,26 @@ public AzureTrafficCollectorManagementClientBuilder serializerAdapter(Serializer * @return an instance of AzureTrafficCollectorManagementClientImpl. */ public AzureTrafficCollectorManagementClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (pipeline == null) { - this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); AzureTrafficCollectorManagementClientImpl client = new AzureTrafficCollectorManagementClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); return client; } } diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorManagementClientImpl.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorManagementClientImpl.java index 4861aa897980..8c0cb347a3cd 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorManagementClientImpl.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorManagementClientImpl.java @@ -194,7 +194,7 @@ public CollectorPoliciesClient getCollectorPolicies() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2022-05-01"; + this.apiVersion = "2022-11-01"; this.networkFunctions = new NetworkFunctionsClientImpl(this); this.azureTrafficCollectorsBySubscriptions = new AzureTrafficCollectorsBySubscriptionsClientImpl(this); this.azureTrafficCollectorsByResourceGroups = new AzureTrafficCollectorsByResourceGroupsClientImpl(this); diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsByResourceGroupsClientImpl.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsByResourceGroupsClientImpl.java index aa603c83ba53..c7fa248e313c 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsByResourceGroupsClientImpl.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsByResourceGroupsClientImpl.java @@ -258,7 +258,8 @@ public PagedIterable listByResourceGroup(String reso /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -294,7 +295,8 @@ private Mono> listNextSinglePageAsync( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsBySubscriptionsClientImpl.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsBySubscriptionsClientImpl.java index e12276bc371d..8310f5c83483 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsBySubscriptionsClientImpl.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsBySubscriptionsClientImpl.java @@ -232,7 +232,8 @@ public PagedIterable list(Context context) { /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -268,7 +269,8 @@ private Mono> listNextSinglePageAsync( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsClientImpl.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsClientImpl.java index 6330e3b26127..85f17b290acc 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsClientImpl.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsClientImpl.java @@ -250,14 +250,16 @@ private Mono getByResourceGroupAsync( * * @param resourceGroupName The name of the resource group. * @param azureTrafficCollectorName Azure Traffic Collector name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure Traffic Collector in a specified resource group. + * @return the specified Azure Traffic Collector in a specified resource group along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AzureTrafficCollectorInner getByResourceGroup(String resourceGroupName, String azureTrafficCollectorName) { - return getByResourceGroupAsync(resourceGroupName, azureTrafficCollectorName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String azureTrafficCollectorName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, azureTrafficCollectorName, context).block(); } /** @@ -265,16 +267,14 @@ public AzureTrafficCollectorInner getByResourceGroup(String resourceGroupName, S * * @param resourceGroupName The name of the resource group. * @param azureTrafficCollectorName Azure Traffic Collector name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure Traffic Collector in a specified resource group along with {@link Response}. + * @return the specified Azure Traffic Collector in a specified resource group. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String azureTrafficCollectorName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, azureTrafficCollectorName, context).block(); + public AzureTrafficCollectorInner getByResourceGroup(String resourceGroupName, String azureTrafficCollectorName) { + return getByResourceGroupWithResponse(resourceGroupName, azureTrafficCollectorName, Context.NONE).getValue(); } /** @@ -946,15 +946,16 @@ private Mono updateTagsAsync( * @param resourceGroupName The name of the resource group. * @param azureTrafficCollectorName Azure Traffic Collector name. * @param parameters Parameters supplied to update Azure Traffic Collector tags. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Traffic Collector resource. + * @return azure Traffic Collector resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AzureTrafficCollectorInner updateTags( - String resourceGroupName, String azureTrafficCollectorName, TagsObject parameters) { - return updateTagsAsync(resourceGroupName, azureTrafficCollectorName, parameters).block(); + public Response updateTagsWithResponse( + String resourceGroupName, String azureTrafficCollectorName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, azureTrafficCollectorName, parameters, context).block(); } /** @@ -963,15 +964,15 @@ public AzureTrafficCollectorInner updateTags( * @param resourceGroupName The name of the resource group. * @param azureTrafficCollectorName Azure Traffic Collector name. * @param parameters Parameters supplied to update Azure Traffic Collector tags. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Traffic Collector resource along with {@link Response}. + * @return azure Traffic Collector resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateTagsWithResponse( - String resourceGroupName, String azureTrafficCollectorName, TagsObject parameters, Context context) { - return updateTagsWithResponseAsync(resourceGroupName, azureTrafficCollectorName, parameters, context).block(); + public AzureTrafficCollectorInner updateTags( + String resourceGroupName, String azureTrafficCollectorName, TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, azureTrafficCollectorName, parameters, Context.NONE) + .getValue(); } } diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsImpl.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsImpl.java index 8443f8ca76d1..45908d516384 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsImpl.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsImpl.java @@ -27,16 +27,6 @@ public AzureTrafficCollectorsImpl( this.serviceManager = serviceManager; } - public AzureTrafficCollector getByResourceGroup(String resourceGroupName, String azureTrafficCollectorName) { - AzureTrafficCollectorInner inner = - this.serviceClient().getByResourceGroup(resourceGroupName, azureTrafficCollectorName); - if (inner != null) { - return new AzureTrafficCollectorImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String azureTrafficCollectorName, Context context) { Response inner = @@ -52,6 +42,16 @@ public Response getByResourceGroupWithResponse( } } + public AzureTrafficCollector getByResourceGroup(String resourceGroupName, String azureTrafficCollectorName) { + AzureTrafficCollectorInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, azureTrafficCollectorName); + if (inner != null) { + return new AzureTrafficCollectorImpl(inner, this.manager()); + } else { + return null; + } + } + public void deleteByResourceGroup(String resourceGroupName, String azureTrafficCollectorName) { this.serviceClient().delete(resourceGroupName, azureTrafficCollectorName); } diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/CollectorPoliciesClientImpl.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/CollectorPoliciesClientImpl.java index b8696e6fd185..c4dd4313afdf 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/CollectorPoliciesClientImpl.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/CollectorPoliciesClientImpl.java @@ -12,6 +12,7 @@ import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; @@ -34,6 +35,7 @@ import com.azure.resourcemanager.networkfunction.fluent.CollectorPoliciesClient; import com.azure.resourcemanager.networkfunction.fluent.models.CollectorPolicyInner; import com.azure.resourcemanager.networkfunction.models.CollectorPolicyListResult; +import com.azure.resourcemanager.networkfunction.models.TagsObject; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -128,6 +130,23 @@ Mono>> delete( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction" + + "/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("azureTrafficCollectorName") String azureTrafficCollectorName, + @PathParam("collectorPolicyName") String collectorPolicyName, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -465,15 +484,16 @@ private Mono getAsync( * @param resourceGroupName The name of the resource group. * @param azureTrafficCollectorName Azure Traffic Collector name. * @param collectorPolicyName Collector Policy Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collector policy in a specified Traffic Collector. + * @return the collector policy in a specified Traffic Collector along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CollectorPolicyInner get( - String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName) { - return getAsync(resourceGroupName, azureTrafficCollectorName, collectorPolicyName).block(); + public Response getWithResponse( + String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName, Context context) { + return getWithResponseAsync(resourceGroupName, azureTrafficCollectorName, collectorPolicyName, context).block(); } /** @@ -482,16 +502,16 @@ public CollectorPolicyInner get( * @param resourceGroupName The name of the resource group. * @param azureTrafficCollectorName Azure Traffic Collector name. * @param collectorPolicyName Collector Policy Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collector policy in a specified Traffic Collector along with {@link Response}. + * @return the collector policy in a specified Traffic Collector. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName, Context context) { - return getWithResponseAsync(resourceGroupName, azureTrafficCollectorName, collectorPolicyName, context).block(); + public CollectorPolicyInner get( + String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName) { + return getWithResponse(resourceGroupName, azureTrafficCollectorName, collectorPolicyName, Context.NONE) + .getValue(); } /** @@ -1095,10 +1115,206 @@ public void delete( deleteAsync(resourceGroupName, azureTrafficCollectorName, collectorPolicyName, context).block(); } + /** + * Updates the specified Collector Policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param azureTrafficCollectorName Azure Traffic Collector name. + * @param collectorPolicyName Collector Policy Name. + * @param parameters Parameters supplied to update Collector Policy tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collector policy resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName, TagsObject parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (azureTrafficCollectorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter azureTrafficCollectorName is required and cannot be null.")); + } + if (collectorPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter collectorPolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + azureTrafficCollectorName, + collectorPolicyName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the specified Collector Policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param azureTrafficCollectorName Azure Traffic Collector name. + * @param collectorPolicyName Collector Policy Name. + * @param parameters Parameters supplied to update Collector Policy tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collector policy resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, + String azureTrafficCollectorName, + String collectorPolicyName, + TagsObject parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (azureTrafficCollectorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter azureTrafficCollectorName is required and cannot be null.")); + } + if (collectorPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter collectorPolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + azureTrafficCollectorName, + collectorPolicyName, + parameters, + accept, + context); + } + + /** + * Updates the specified Collector Policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param azureTrafficCollectorName Azure Traffic Collector name. + * @param collectorPolicyName Collector Policy Name. + * @param parameters Parameters supplied to update Collector Policy tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collector policy resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName, TagsObject parameters) { + return updateTagsWithResponseAsync( + resourceGroupName, azureTrafficCollectorName, collectorPolicyName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates the specified Collector Policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param azureTrafficCollectorName Azure Traffic Collector name. + * @param collectorPolicyName Collector Policy Name. + * @param parameters Parameters supplied to update Collector Policy tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collector policy resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, + String azureTrafficCollectorName, + String collectorPolicyName, + TagsObject parameters, + Context context) { + return updateTagsWithResponseAsync( + resourceGroupName, azureTrafficCollectorName, collectorPolicyName, parameters, context) + .block(); + } + + /** + * Updates the specified Collector Policy tags. + * + * @param resourceGroupName The name of the resource group. + * @param azureTrafficCollectorName Azure Traffic Collector name. + * @param collectorPolicyName Collector Policy Name. + * @param parameters Parameters supplied to update Collector Policy tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collector policy resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CollectorPolicyInner updateTags( + String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName, TagsObject parameters) { + return updateTagsWithResponse( + resourceGroupName, azureTrafficCollectorName, collectorPolicyName, parameters, Context.NONE) + .getValue(); + } + /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1134,7 +1350,8 @@ private Mono> listNextSinglePageAsync(String /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/CollectorPoliciesImpl.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/CollectorPoliciesImpl.java index 003aed806f27..510c5ab6c347 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/CollectorPoliciesImpl.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/CollectorPoliciesImpl.java @@ -41,16 +41,6 @@ public PagedIterable list( return Utils.mapPage(inner, inner1 -> new CollectorPolicyImpl(inner1, this.manager())); } - public CollectorPolicy get(String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName) { - CollectorPolicyInner inner = - this.serviceClient().get(resourceGroupName, azureTrafficCollectorName, collectorPolicyName); - if (inner != null) { - return new CollectorPolicyImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName, Context context) { Response inner = @@ -68,6 +58,16 @@ public Response getWithResponse( } } + public CollectorPolicy get(String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName) { + CollectorPolicyInner inner = + this.serviceClient().get(resourceGroupName, azureTrafficCollectorName, collectorPolicyName); + if (inner != null) { + return new CollectorPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + public void delete(String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName) { this.serviceClient().delete(resourceGroupName, azureTrafficCollectorName, collectorPolicyName); } diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/CollectorPolicyImpl.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/CollectorPolicyImpl.java index c0bc6829efc4..c8bf2c29d2c9 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/CollectorPolicyImpl.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/CollectorPolicyImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.networkfunction.implementation; +import com.azure.core.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.networkfunction.fluent.models.CollectorPolicyInner; @@ -11,8 +12,10 @@ import com.azure.resourcemanager.networkfunction.models.EmissionPoliciesPropertiesFormat; import com.azure.resourcemanager.networkfunction.models.IngestionPolicyPropertiesFormat; import com.azure.resourcemanager.networkfunction.models.ProvisioningState; +import com.azure.resourcemanager.networkfunction.models.TagsObject; import java.util.Collections; import java.util.List; +import java.util.Map; public final class CollectorPolicyImpl implements CollectorPolicy, CollectorPolicy.Definition, CollectorPolicy.Update { private CollectorPolicyInner innerObject; @@ -31,6 +34,19 @@ public String type() { return this.innerModel().type(); } + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + public String etag() { return this.innerModel().etag(); } @@ -56,6 +72,14 @@ public ProvisioningState provisioningState() { return this.innerModel().provisioningState(); } + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + public String resourceGroupName() { return resourceGroupName; } @@ -74,6 +98,8 @@ private com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager m private String collectorPolicyName; + private TagsObject updateParameters; + public CollectorPolicyImpl withExistingAzureTrafficCollector( String resourceGroupName, String azureTrafficCollectorName) { this.resourceGroupName = resourceGroupName; @@ -109,6 +135,7 @@ public CollectorPolicy create(Context context) { } public CollectorPolicyImpl update() { + this.updateParameters = new TagsObject(); return this; } @@ -117,8 +144,9 @@ public CollectorPolicy apply() { serviceManager .serviceClient() .getCollectorPolicies() - .createOrUpdate( - resourceGroupName, azureTrafficCollectorName, collectorPolicyName, this.innerModel(), Context.NONE); + .updateTagsWithResponse( + resourceGroupName, azureTrafficCollectorName, collectorPolicyName, updateParameters, Context.NONE) + .getValue(); return this; } @@ -127,8 +155,9 @@ public CollectorPolicy apply(Context context) { serviceManager .serviceClient() .getCollectorPolicies() - .createOrUpdate( - resourceGroupName, azureTrafficCollectorName, collectorPolicyName, this.innerModel(), context); + .updateTagsWithResponse( + resourceGroupName, azureTrafficCollectorName, collectorPolicyName, updateParameters, context) + .getValue(); return this; } @@ -162,6 +191,26 @@ public CollectorPolicy refresh(Context context) { return this; } + public CollectorPolicyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CollectorPolicyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CollectorPolicyImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + public CollectorPolicyImpl withIngestionPolicy(IngestionPolicyPropertiesFormat ingestionPolicy) { this.innerModel().withIngestionPolicy(ingestionPolicy); return this; @@ -171,4 +220,8 @@ public CollectorPolicyImpl withEmissionPolicies(List collectorPolicies(); + List collectorPolicies(); /** * Gets the virtualHub property: The virtualHub to which the Azure Traffic Collector belongs. @@ -156,8 +155,7 @@ interface WithResourceGroup { * The stage of the AzureTrafficCollector definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithTags, DefinitionStages.WithCollectorPolicies, DefinitionStages.WithVirtualHub { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithVirtualHub { /** * Executes the create request. * @@ -183,16 +181,6 @@ interface WithTags { */ WithCreate withTags(Map tags); } - /** The stage of the AzureTrafficCollector definition allowing to specify collectorPolicies. */ - interface WithCollectorPolicies { - /** - * Specifies the collectorPolicies property: Collector Policies for Azure Traffic Collector.. - * - * @param collectorPolicies Collector Policies for Azure Traffic Collector. - * @return the next definition stage. - */ - WithCreate withCollectorPolicies(List collectorPolicies); - } /** The stage of the AzureTrafficCollector definition allowing to specify virtualHub. */ interface WithVirtualHub { /** diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/AzureTrafficCollectorListResult.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/AzureTrafficCollectorListResult.java index b7f7cfcbd3f9..b58a32ccae77 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/AzureTrafficCollectorListResult.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/AzureTrafficCollectorListResult.java @@ -24,6 +24,10 @@ public final class AzureTrafficCollectorListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of AzureTrafficCollectorListResult class. */ + public AzureTrafficCollectorListResult() { + } + /** * Get the value property: A list of Traffic Collector resources. * diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/AzureTrafficCollectors.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/AzureTrafficCollectors.java index 83db78da94ad..8ec1a107f9fa 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/AzureTrafficCollectors.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/AzureTrafficCollectors.java @@ -14,26 +14,26 @@ public interface AzureTrafficCollectors { * * @param resourceGroupName The name of the resource group. * @param azureTrafficCollectorName Azure Traffic Collector name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure Traffic Collector in a specified resource group. + * @return the specified Azure Traffic Collector in a specified resource group along with {@link Response}. */ - AzureTrafficCollector getByResourceGroup(String resourceGroupName, String azureTrafficCollectorName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String azureTrafficCollectorName, Context context); /** * Gets the specified Azure Traffic Collector in a specified resource group. * * @param resourceGroupName The name of the resource group. * @param azureTrafficCollectorName Azure Traffic Collector name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Azure Traffic Collector in a specified resource group along with {@link Response}. + * @return the specified Azure Traffic Collector in a specified resource group. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String azureTrafficCollectorName, Context context); + AzureTrafficCollector getByResourceGroup(String resourceGroupName, String azureTrafficCollectorName); /** * Deletes a specified Azure Traffic Collector resource. diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/CollectorPolicies.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/CollectorPolicies.java index 43df4379a745..8f55d70bb43b 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/CollectorPolicies.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/CollectorPolicies.java @@ -41,12 +41,14 @@ public interface CollectorPolicies { * @param resourceGroupName The name of the resource group. * @param azureTrafficCollectorName Azure Traffic Collector name. * @param collectorPolicyName Collector Policy Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collector policy in a specified Traffic Collector. + * @return the collector policy in a specified Traffic Collector along with {@link Response}. */ - CollectorPolicy get(String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName); + Response getWithResponse( + String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName, Context context); /** * Gets the collector policy in a specified Traffic Collector. @@ -54,14 +56,12 @@ public interface CollectorPolicies { * @param resourceGroupName The name of the resource group. * @param azureTrafficCollectorName Azure Traffic Collector name. * @param collectorPolicyName Collector Policy Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collector policy in a specified Traffic Collector along with {@link Response}. + * @return the collector policy in a specified Traffic Collector. */ - Response getWithResponse( - String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName, Context context); + CollectorPolicy get(String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName); /** * Deletes a specified Collector Policy resource. diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/CollectorPolicy.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/CollectorPolicy.java index edba51d5f09c..1cdb00046f27 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/CollectorPolicy.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/CollectorPolicy.java @@ -4,10 +4,12 @@ package com.azure.resourcemanager.networkfunction.models; +import com.azure.core.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.networkfunction.fluent.models.CollectorPolicyInner; import java.util.List; +import java.util.Map; /** An immutable client-side representation of CollectorPolicy. */ public interface CollectorPolicy { @@ -32,6 +34,20 @@ public interface CollectorPolicy { */ String type(); + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the etag property: A unique read-only string that changes whenever the resource is updated. * @@ -67,6 +83,20 @@ public interface CollectorPolicy { */ ProvisioningState provisioningState(); + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + /** * Gets the name of the resource group. * @@ -83,12 +113,33 @@ public interface CollectorPolicy { /** The entirety of the CollectorPolicy definition. */ interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { } /** The CollectorPolicy definition stages. */ interface DefinitionStages { /** The first stage of the CollectorPolicy definition. */ - interface Blank extends WithParentResource { + interface Blank extends WithLocation { + } + /** The stage of the CollectorPolicy definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); } /** The stage of the CollectorPolicy definition allowing to specify parent resource. */ interface WithParentResource { @@ -105,7 +156,10 @@ interface WithParentResource { * The stage of the CollectorPolicy definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithIngestionPolicy, DefinitionStages.WithEmissionPolicies { + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIngestionPolicy, + DefinitionStages.WithEmissionPolicies { /** * Executes the create request. * @@ -121,6 +175,16 @@ interface WithCreate extends DefinitionStages.WithIngestionPolicy, DefinitionSta */ CollectorPolicy create(Context context); } + /** The stage of the CollectorPolicy definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } /** The stage of the CollectorPolicy definition allowing to specify ingestionPolicy. */ interface WithIngestionPolicy { /** @@ -150,7 +214,7 @@ interface WithEmissionPolicies { CollectorPolicy.Update update(); /** The template for CollectorPolicy update. */ - interface Update extends UpdateStages.WithIngestionPolicy, UpdateStages.WithEmissionPolicies { + interface Update extends UpdateStages.WithTags { /** * Executes the update request. * @@ -168,25 +232,15 @@ interface Update extends UpdateStages.WithIngestionPolicy, UpdateStages.WithEmis } /** The CollectorPolicy update stages. */ interface UpdateStages { - /** The stage of the CollectorPolicy update allowing to specify ingestionPolicy. */ - interface WithIngestionPolicy { + /** The stage of the CollectorPolicy update allowing to specify tags. */ + interface WithTags { /** - * Specifies the ingestionPolicy property: Ingestion policies.. - * - * @param ingestionPolicy Ingestion policies. - * @return the next definition stage. - */ - Update withIngestionPolicy(IngestionPolicyPropertiesFormat ingestionPolicy); - } - /** The stage of the CollectorPolicy update allowing to specify emissionPolicies. */ - interface WithEmissionPolicies { - /** - * Specifies the emissionPolicies property: Emission policies.. + * Specifies the tags property: Resource tags.. * - * @param emissionPolicies Emission policies. + * @param tags Resource tags. * @return the next definition stage. */ - Update withEmissionPolicies(List emissionPolicies); + Update withTags(Map tags); } } /** diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/CollectorPolicyListResult.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/CollectorPolicyListResult.java index e172754cce45..78a47d15e47c 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/CollectorPolicyListResult.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/CollectorPolicyListResult.java @@ -24,6 +24,10 @@ public final class CollectorPolicyListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of CollectorPolicyListResult class. */ + public CollectorPolicyListResult() { + } + /** * Get the value property: A list of collection policies. * diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/DestinationType.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/DestinationType.java index 5b05d2afb323..88deda4d744e 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/DestinationType.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/DestinationType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for DestinationType. */ +/** Emission destination type. */ public final class DestinationType extends ExpandableStringEnum { /** Static value AzureMonitor for DestinationType. */ public static final DestinationType AZURE_MONITOR = fromString("AzureMonitor"); diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/EmissionPoliciesPropertiesFormat.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/EmissionPoliciesPropertiesFormat.java index 8d79d2407ef6..ed1f5ac6c75f 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/EmissionPoliciesPropertiesFormat.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/EmissionPoliciesPropertiesFormat.java @@ -23,6 +23,10 @@ public final class EmissionPoliciesPropertiesFormat { @JsonProperty(value = "emissionDestinations") private List emissionDestinations; + /** Creates an instance of EmissionPoliciesPropertiesFormat class. */ + public EmissionPoliciesPropertiesFormat() { + } + /** * Get the emissionType property: Emission format type. * diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/EmissionPolicyDestination.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/EmissionPolicyDestination.java index 3da75a7838fc..bb81cad1e90a 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/EmissionPolicyDestination.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/EmissionPolicyDestination.java @@ -16,6 +16,10 @@ public final class EmissionPolicyDestination { @JsonProperty(value = "destinationType") private DestinationType destinationType; + /** Creates an instance of EmissionPolicyDestination class. */ + public EmissionPolicyDestination() { + } + /** * Get the destinationType property: Emission destination type. * diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/EmissionType.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/EmissionType.java index e447c41d24b8..f625fba582d7 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/EmissionType.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/EmissionType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for EmissionType. */ +/** Emission format type. */ public final class EmissionType extends ExpandableStringEnum { /** Static value IPFIX for EmissionType. */ public static final EmissionType IPFIX = fromString("IPFIX"); diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/IngestionPolicyPropertiesFormat.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/IngestionPolicyPropertiesFormat.java index 04e8758c75cc..774e30614203 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/IngestionPolicyPropertiesFormat.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/IngestionPolicyPropertiesFormat.java @@ -23,6 +23,10 @@ public final class IngestionPolicyPropertiesFormat { @JsonProperty(value = "ingestionSources") private List ingestionSources; + /** Creates an instance of IngestionPolicyPropertiesFormat class. */ + public IngestionPolicyPropertiesFormat() { + } + /** * Get the ingestionType property: The ingestion type. * diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/IngestionSourcesPropertiesFormat.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/IngestionSourcesPropertiesFormat.java index fe78cf32135f..ebc2edaf63c6 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/IngestionSourcesPropertiesFormat.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/IngestionSourcesPropertiesFormat.java @@ -22,6 +22,10 @@ public final class IngestionSourcesPropertiesFormat { @JsonProperty(value = "resourceId") private String resourceId; + /** Creates an instance of IngestionSourcesPropertiesFormat class. */ + public IngestionSourcesPropertiesFormat() { + } + /** * Get the sourceType property: Ingestion source type. * diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/IngestionType.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/IngestionType.java index 904adde5c738..ecffcf470865 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/IngestionType.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/IngestionType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for IngestionType. */ +/** The ingestion type. */ public final class IngestionType extends ExpandableStringEnum { /** Static value IPFIX for IngestionType. */ public static final IngestionType IPFIX = fromString("IPFIX"); diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/OperationDisplay.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/OperationDisplay.java index 28cf58f8c6be..30f139ae5c54 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/OperationDisplay.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/OperationDisplay.java @@ -34,6 +34,10 @@ public final class OperationDisplay { @JsonProperty(value = "description") private String description; + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + /** * Get the provider property: Service provider: Microsoft NetworkFunction. * diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/OperationListResult.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/OperationListResult.java index 034bffee3f5e..d4bf30021564 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/OperationListResult.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/OperationListResult.java @@ -16,8 +16,7 @@ @Fluent public final class OperationListResult { /* - * List of operations supported by the Azure Traffic Collector resource - * provider. + * List of operations supported by the Azure Traffic Collector resource provider. */ @JsonProperty(value = "value") private List value; @@ -28,6 +27,10 @@ public final class OperationListResult { @JsonProperty(value = "nextLink") private String nextLink; + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + /** * Get the value property: List of operations supported by the Azure Traffic Collector resource provider. * diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/ProvisioningState.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/ProvisioningState.java index 4c2880303825..2e2d7034127c 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/ProvisioningState.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/ProvisioningState.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ProvisioningState. */ +/** The current provisioning state. */ public final class ProvisioningState extends ExpandableStringEnum { /** Static value Succeeded for ProvisioningState. */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/ResourceReference.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/ResourceReference.java index 7cb7edb4221e..7fec19f54e37 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/ResourceReference.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/ResourceReference.java @@ -16,6 +16,10 @@ public final class ResourceReference { @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; + /** Creates an instance of ResourceReference class. */ + public ResourceReference() { + } + /** * Get the id property: Resource ID. * diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/SourceType.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/SourceType.java index 99b730664438..75d129bab1b6 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/SourceType.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/SourceType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for SourceType. */ +/** Ingestion source type. */ public final class SourceType extends ExpandableStringEnum { /** Static value Resource for SourceType. */ public static final SourceType RESOURCE = fromString("Resource"); diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/TagsObject.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/TagsObject.java index 31a0ee2c41db..7f759c64a8e3 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/TagsObject.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/TagsObject.java @@ -19,6 +19,10 @@ public final class TagsObject { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /** Creates an instance of TagsObject class. */ + public TagsObject() { + } + /** * Get the tags property: Resource tags. * diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsByResourceGroupListByResourceGroupSamples.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsByResourceGroupListByResourceGroupSamples.java index a6a38c070c94..c761de296753 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsByResourceGroupListByResourceGroupSamples.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsByResourceGroupListByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for AzureTrafficCollectorsByResourceGroup ListByResourceGroup. */ public final class AzureTrafficCollectorsByResourceGroupListByResourceGroupSamples { /* - * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/AzureTrafficCollectorsByResourceGroupList.json + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorsByResourceGroupList.json */ /** * Sample code: List of Traffic Collectors by ResourceGroup. diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsBySubscriptionListSamples.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsBySubscriptionListSamples.java index 42b35a567938..5210a6fed09f 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsBySubscriptionListSamples.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsBySubscriptionListSamples.java @@ -9,7 +9,7 @@ /** Samples for AzureTrafficCollectorsBySubscription List. */ public final class AzureTrafficCollectorsBySubscriptionListSamples { /* - * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/AzureTrafficCollectorsBySubscriptionList.json + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorsBySubscriptionList.json */ /** * Sample code: List of Traffic Collectors by Subscription. diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsCreateOrUpdateSamples.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsCreateOrUpdateSamples.java index dc0dcff0d82e..80604e258411 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsCreateOrUpdateSamples.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsCreateOrUpdateSamples.java @@ -4,14 +4,13 @@ package com.azure.resourcemanager.networkfunction.generated; -import java.util.Arrays; import java.util.HashMap; import java.util.Map; /** Samples for AzureTrafficCollectors CreateOrUpdate. */ public final class AzureTrafficCollectorsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/AzureTrafficCollectorCreate.json + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorCreate.json */ /** * Sample code: Create a traffic collector. @@ -26,7 +25,6 @@ public static void createATrafficCollector( .withRegion("West US") .withExistingResourceGroup("rg1") .withTags(mapOf("key1", "value1")) - .withCollectorPolicies(Arrays.asList()) .create(); } diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsDeleteSamples.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsDeleteSamples.java index 42f06e34f344..9bdea3527d4b 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsDeleteSamples.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for AzureTrafficCollectors Delete. */ public final class AzureTrafficCollectorsDeleteSamples { /* - * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/AzureTrafficCollectorDelete.json + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorDelete.json */ /** * Sample code: Delete Traffic Collector. diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsGetByResourceGroupSamples.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsGetByResourceGroupSamples.java index c9246189c9e0..b4cf7fceff26 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsGetByResourceGroupSamples.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsGetByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for AzureTrafficCollectors GetByResourceGroup. */ public final class AzureTrafficCollectorsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/AzureTrafficCollectorGet.json + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorGet.json */ /** * Sample code: Get Traffic Collector. diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsUpdateTagsSamples.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsUpdateTagsSamples.java index 57052a47460d..dc03972c0e80 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsUpdateTagsSamples.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/AzureTrafficCollectorsUpdateTagsSamples.java @@ -12,7 +12,7 @@ /** Samples for AzureTrafficCollectors UpdateTags. */ public final class AzureTrafficCollectorsUpdateTagsSamples { /* - * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/AzureTrafficCollectorUpdateTags.json + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorUpdateTags.json */ /** * Sample code: Update Traffic Collector tags. diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/CollectorPoliciesCreateOrUpdateSamples.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/CollectorPoliciesCreateOrUpdateSamples.java index 9bbb75a421e9..08054f217c96 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/CollectorPoliciesCreateOrUpdateSamples.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/CollectorPoliciesCreateOrUpdateSamples.java @@ -17,7 +17,7 @@ /** Samples for CollectorPolicies CreateOrUpdate. */ public final class CollectorPoliciesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/CollectorPolicyCreate.json + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPolicyCreate.json */ /** * Sample code: Create a collection policy. @@ -29,6 +29,7 @@ public static void createACollectionPolicy( manager .collectorPolicies() .define("cp1") + .withRegion("West US") .withExistingAzureTrafficCollector("rg1", "atc") .withIngestionPolicy( new IngestionPolicyPropertiesFormat() diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/CollectorPoliciesDeleteSamples.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/CollectorPoliciesDeleteSamples.java index c9c27bbd46e5..f3e75f22621b 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/CollectorPoliciesDeleteSamples.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/CollectorPoliciesDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for CollectorPolicies Delete. */ public final class CollectorPoliciesDeleteSamples { /* - * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/CollectorPolicyDelete.json + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPolicyDelete.json */ /** * Sample code: Delete Collection Policy. diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/CollectorPoliciesGetSamples.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/CollectorPoliciesGetSamples.java index 3490267b9a1f..a4fbba5e49f8 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/CollectorPoliciesGetSamples.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/CollectorPoliciesGetSamples.java @@ -9,7 +9,7 @@ /** Samples for CollectorPolicies Get. */ public final class CollectorPoliciesGetSamples { /* - * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/CollectorPolicyGet.json + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPolicyGet.json */ /** * Sample code: Get Collection Policy. diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/CollectorPoliciesListSamples.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/CollectorPoliciesListSamples.java index 25bb0f08bdb2..345ba546fa1f 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/CollectorPoliciesListSamples.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/CollectorPoliciesListSamples.java @@ -9,7 +9,7 @@ /** Samples for CollectorPolicies List. */ public final class CollectorPoliciesListSamples { /* - * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/CollectorPoliciesList.json + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPoliciesList.json */ /** * Sample code: List of Collection Policies. diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/CollectorPoliciesUpdateTagsSamples.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/CollectorPoliciesUpdateTagsSamples.java new file mode 100644 index 000000000000..6c0560aa29b0 --- /dev/null +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/CollectorPoliciesUpdateTagsSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkfunction.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkfunction.models.CollectorPolicy; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CollectorPolicies UpdateTags. */ +public final class CollectorPoliciesUpdateTagsSamples { + /* + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPolicyUpdateTags.json + */ + /** + * Sample code: Update Collector Policy tags. + * + * @param manager Entry point to AzureTrafficCollectorManager. + */ + public static void updateCollectorPolicyTags( + com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager manager) { + CollectorPolicy resource = + manager.collectorPolicies().getWithResponse("rg1", "atc", "cp1", Context.NONE).getValue(); + resource.update().withTags(mapOf("key1", "value1", "key2", "value2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/NetworkFunctionListOperationsSamples.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/NetworkFunctionListOperationsSamples.java index 5cfba2430de7..3b6273a860d9 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/NetworkFunctionListOperationsSamples.java +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/samples/java/com/azure/resourcemanager/networkfunction/generated/NetworkFunctionListOperationsSamples.java @@ -9,7 +9,7 @@ /** Samples for NetworkFunction ListOperations. */ public final class NetworkFunctionListOperationsSamples { /* - * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-05-01/examples/OperationsList.json + * x-ms-original-file: specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/OperationsList.json */ /** * Sample code: OperationsList.