scopes = new ArrayList<>();
+ private RetryPolicy retryPolicy;
+ private RetryOptions retryOptions;
+ private Duration defaultPollInterval;
+
+ private Configurable() {
+ }
+
+ /**
+ * Sets the http client.
+ *
+ * @param httpClient the HTTP client.
+ * @return the configurable object itself.
+ */
+ public Configurable withHttpClient(HttpClient httpClient) {
+ this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the logging options to the HTTP pipeline.
+ *
+ * @param httpLogOptions the HTTP log options.
+ * @return the configurable object itself.
+ */
+ public Configurable withLogOptions(HttpLogOptions httpLogOptions) {
+ this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Adds the pipeline policy to the HTTP pipeline.
+ *
+ * @param policy the HTTP pipeline policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withPolicy(HttpPipelinePolicy policy) {
+ this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null."));
+ return this;
+ }
+
+ /**
+ * Adds the scope to permission sets.
+ *
+ * @param scope the scope.
+ * @return the configurable object itself.
+ */
+ public Configurable withScope(String scope) {
+ this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null."));
+ return this;
+ }
+
+ /**
+ * Sets the retry policy to the HTTP pipeline.
+ *
+ * @param retryPolicy the HTTP pipeline retry policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
+ this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the retry options for the HTTP pipeline retry policy.
+ *
+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
+ *
+ * @param retryOptions the retry options for the HTTP pipeline retry policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withRetryOptions(RetryOptions retryOptions) {
+ this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the default poll interval, used when service does not provide "Retry-After" header.
+ *
+ * @param defaultPollInterval the default poll interval.
+ * @return the configurable object itself.
+ */
+ public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval =
+ Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
+ if (this.defaultPollInterval.isNegative()) {
+ throw LOGGER
+ .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
+ }
+ return this;
+ }
+
+ /**
+ * Creates an instance of AzureTrafficCollector service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the AzureTrafficCollector service API instance.
+ */
+ public AzureTrafficCollectorManager authenticate(TokenCredential credential, AzureProfile profile) {
+ Objects.requireNonNull(credential, "'credential' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+
+ StringBuilder userAgentBuilder = new StringBuilder();
+ userAgentBuilder
+ .append("azsdk-java")
+ .append("-")
+ .append("com.azure.resourcemanager.networkfunction")
+ .append("/")
+ .append("1.0.0-beta.1");
+ if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
+ userAgentBuilder
+ .append(" (")
+ .append(Configuration.getGlobalConfiguration().get("java.version"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.name"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.version"))
+ .append("; auto-generated)");
+ } else {
+ userAgentBuilder.append(" (auto-generated)");
+ }
+
+ if (scopes.isEmpty()) {
+ scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
+ }
+ if (retryPolicy == null) {
+ if (retryOptions != null) {
+ retryPolicy = new RetryPolicy(retryOptions);
+ } else {
+ retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
+ }
+ }
+ List policies = new ArrayList<>();
+ policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
+ policies.add(new AddHeadersFromContextPolicy());
+ policies.add(new RequestIdPolicy());
+ policies
+ .addAll(
+ this
+ .policies
+ .stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+ .collect(Collectors.toList()));
+ HttpPolicyProviders.addBeforeRetryPolicies(policies);
+ policies.add(retryPolicy);
+ policies.add(new AddDatePolicy());
+ policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
+ policies
+ .addAll(
+ this
+ .policies
+ .stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
+ .collect(Collectors.toList()));
+ HttpPolicyProviders.addAfterRetryPolicies(policies);
+ policies.add(new HttpLoggingPolicy(httpLogOptions));
+ HttpPipeline httpPipeline =
+ new HttpPipelineBuilder()
+ .httpClient(httpClient)
+ .policies(policies.toArray(new HttpPipelinePolicy[0]))
+ .build();
+ return new AzureTrafficCollectorManager(httpPipeline, profile, defaultPollInterval);
+ }
+ }
+
+ /**
+ * Gets the resource collection API of NetworkFunctions.
+ *
+ * @return Resource collection API of NetworkFunctions.
+ */
+ public NetworkFunctions networkFunctions() {
+ if (this.networkFunctions == null) {
+ this.networkFunctions = new NetworkFunctionsImpl(clientObject.getNetworkFunctions(), this);
+ }
+ return networkFunctions;
+ }
+
+ /**
+ * Gets the resource collection API of AzureTrafficCollectorsBySubscriptions.
+ *
+ * @return Resource collection API of AzureTrafficCollectorsBySubscriptions.
+ */
+ public AzureTrafficCollectorsBySubscriptions azureTrafficCollectorsBySubscriptions() {
+ if (this.azureTrafficCollectorsBySubscriptions == null) {
+ this.azureTrafficCollectorsBySubscriptions =
+ new AzureTrafficCollectorsBySubscriptionsImpl(
+ clientObject.getAzureTrafficCollectorsBySubscriptions(), this);
+ }
+ return azureTrafficCollectorsBySubscriptions;
+ }
+
+ /**
+ * Gets the resource collection API of AzureTrafficCollectorsByResourceGroups.
+ *
+ * @return Resource collection API of AzureTrafficCollectorsByResourceGroups.
+ */
+ public AzureTrafficCollectorsByResourceGroups azureTrafficCollectorsByResourceGroups() {
+ if (this.azureTrafficCollectorsByResourceGroups == null) {
+ this.azureTrafficCollectorsByResourceGroups =
+ new AzureTrafficCollectorsByResourceGroupsImpl(
+ clientObject.getAzureTrafficCollectorsByResourceGroups(), this);
+ }
+ return azureTrafficCollectorsByResourceGroups;
+ }
+
+ /**
+ * Gets the resource collection API of AzureTrafficCollectors. It manages AzureTrafficCollector.
+ *
+ * @return Resource collection API of AzureTrafficCollectors.
+ */
+ public AzureTrafficCollectors azureTrafficCollectors() {
+ if (this.azureTrafficCollectors == null) {
+ this.azureTrafficCollectors =
+ new AzureTrafficCollectorsImpl(clientObject.getAzureTrafficCollectors(), this);
+ }
+ return azureTrafficCollectors;
+ }
+
+ /**
+ * Gets the resource collection API of CollectorPolicies. It manages CollectorPolicy.
+ *
+ * @return Resource collection API of CollectorPolicies.
+ */
+ public CollectorPolicies collectorPolicies() {
+ if (this.collectorPolicies == null) {
+ this.collectorPolicies = new CollectorPoliciesImpl(clientObject.getCollectorPolicies(), this);
+ }
+ return collectorPolicies;
+ }
+
+ /**
+ * @return Wrapped service client AzureTrafficCollectorManagementClient providing direct access to the underlying
+ * auto-generated API implementation, based on Azure REST API.
+ */
+ public AzureTrafficCollectorManagementClient serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/AzureTrafficCollectorManagementClient.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/AzureTrafficCollectorManagementClient.java
new file mode 100644
index 000000000000..db9216f671fe
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/AzureTrafficCollectorManagementClient.java
@@ -0,0 +1,81 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.networkfunction.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/** The interface for AzureTrafficCollectorManagementClient class. */
+public interface AzureTrafficCollectorManagementClient {
+ /**
+ * Gets Azure Subscription ID.
+ *
+ * @return the subscriptionId value.
+ */
+ String getSubscriptionId();
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ String getEndpoint();
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ String getApiVersion();
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ HttpPipeline getHttpPipeline();
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ Duration getDefaultPollInterval();
+
+ /**
+ * Gets the NetworkFunctionsClient object to access its operations.
+ *
+ * @return the NetworkFunctionsClient object.
+ */
+ NetworkFunctionsClient getNetworkFunctions();
+
+ /**
+ * Gets the AzureTrafficCollectorsBySubscriptionsClient object to access its operations.
+ *
+ * @return the AzureTrafficCollectorsBySubscriptionsClient object.
+ */
+ AzureTrafficCollectorsBySubscriptionsClient getAzureTrafficCollectorsBySubscriptions();
+
+ /**
+ * Gets the AzureTrafficCollectorsByResourceGroupsClient object to access its operations.
+ *
+ * @return the AzureTrafficCollectorsByResourceGroupsClient object.
+ */
+ AzureTrafficCollectorsByResourceGroupsClient getAzureTrafficCollectorsByResourceGroups();
+
+ /**
+ * Gets the AzureTrafficCollectorsClient object to access its operations.
+ *
+ * @return the AzureTrafficCollectorsClient object.
+ */
+ AzureTrafficCollectorsClient getAzureTrafficCollectors();
+
+ /**
+ * Gets the CollectorPoliciesClient object to access its operations.
+ *
+ * @return the CollectorPoliciesClient object.
+ */
+ CollectorPoliciesClient getCollectorPolicies();
+}
diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/AzureTrafficCollectorsByResourceGroupsClient.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/AzureTrafficCollectorsByResourceGroupsClient.java
new file mode 100644
index 000000000000..0ceab4cf6006
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/AzureTrafficCollectorsByResourceGroupsClient.java
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.networkfunction.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.networkfunction.fluent.models.AzureTrafficCollectorInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in
+ * AzureTrafficCollectorsByResourceGroupsClient.
+ */
+public interface AzureTrafficCollectorsByResourceGroupsClient {
+ /**
+ * Return list of Azure Traffic Collectors in a Resource Group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 response for the ListTrafficCollectors API service call as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * Return list of Azure Traffic Collectors in a Resource Group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 response for the ListTrafficCollectors API service call as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+}
diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/AzureTrafficCollectorsBySubscriptionsClient.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/AzureTrafficCollectorsBySubscriptionsClient.java
new file mode 100644
index 000000000000..1d5e4fdc2f46
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/AzureTrafficCollectorsBySubscriptionsClient.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.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.networkfunction.fluent.models.AzureTrafficCollectorInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in
+ * AzureTrafficCollectorsBySubscriptionsClient.
+ */
+public interface AzureTrafficCollectorsBySubscriptionsClient {
+ /**
+ * Return list of Azure Traffic Collectors in a subscription.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the ListTrafficCollectors API service call as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Return list of Azure Traffic Collectors in a subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the ListTrafficCollectors API service call as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+}
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
new file mode 100644
index 000000000000..6604511f0ce4
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/AzureTrafficCollectorsClient.java
@@ -0,0 +1,197 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.networkfunction.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.networkfunction.fluent.models.AzureTrafficCollectorInner;
+import com.azure.resourcemanager.networkfunction.models.TagsObject;
+
+/** An instance of this class provides access to all the operations defined in AzureTrafficCollectorsClient. */
+public interface AzureTrafficCollectorsClient {
+ /**
+ * 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.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AzureTrafficCollectorInner getByResourceGroup(String resourceGroupName, String azureTrafficCollectorName);
+
+ /**
+ * 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}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName, String azureTrafficCollectorName, Context context);
+
+ /**
+ * Creates or updates a Azure Traffic Collector resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param parameters The parameters to provide for the created Azure Traffic Collector.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of azure Traffic Collector resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, AzureTrafficCollectorInner> beginCreateOrUpdate(
+ String resourceGroupName, String azureTrafficCollectorName, AzureTrafficCollectorInner parameters);
+
+ /**
+ * Creates or updates a Azure Traffic Collector resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param parameters The parameters to provide for the created Azure Traffic Collector.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of azure Traffic Collector resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, AzureTrafficCollectorInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String azureTrafficCollectorName,
+ AzureTrafficCollectorInner parameters,
+ Context context);
+
+ /**
+ * Creates or updates a Azure Traffic Collector resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param parameters The parameters to provide for the created Azure Traffic Collector.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AzureTrafficCollectorInner createOrUpdate(
+ String resourceGroupName, String azureTrafficCollectorName, AzureTrafficCollectorInner parameters);
+
+ /**
+ * Creates or updates a Azure Traffic Collector resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param parameters The parameters to provide for the created Azure Traffic Collector.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AzureTrafficCollectorInner createOrUpdate(
+ String resourceGroupName,
+ String azureTrafficCollectorName,
+ AzureTrafficCollectorInner parameters,
+ Context context);
+
+ /**
+ * Deletes a specified Azure Traffic Collector resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String azureTrafficCollectorName);
+
+ /**
+ * Deletes a specified Azure Traffic Collector resource.
+ *
+ * @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 {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String azureTrafficCollectorName, Context context);
+
+ /**
+ * Deletes a specified Azure Traffic Collector resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String azureTrafficCollectorName);
+
+ /**
+ * Deletes a specified Azure Traffic Collector resource.
+ *
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String azureTrafficCollectorName, Context context);
+
+ /**
+ * Updates the specified Azure Traffic Collector tags.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param parameters Parameters supplied to update Azure Traffic Collector 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 azure Traffic Collector resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AzureTrafficCollectorInner updateTags(
+ String resourceGroupName, String azureTrafficCollectorName, TagsObject parameters);
+
+ /**
+ * Updates the specified Azure Traffic Collector tags.
+ *
+ * @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}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response updateTagsWithResponse(
+ String resourceGroupName, String azureTrafficCollectorName, TagsObject parameters, Context context);
+}
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
new file mode 100644
index 000000000000..4535f6267c6d
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/CollectorPoliciesClient.java
@@ -0,0 +1,214 @@
+// 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.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.networkfunction.fluent.models.CollectorPolicyInner;
+
+/** An instance of this class provides access to all the operations defined in CollectorPoliciesClient. */
+public interface CollectorPoliciesClient {
+ /**
+ * Return list of Collector policies in a Azure Traffic Collector.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the ListCollectorPolicies API service call as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String azureTrafficCollectorName);
+
+ /**
+ * Return list of Collector policies in a Azure Traffic Collector.
+ *
+ * @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 response for the ListCollectorPolicies API service call as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(
+ String resourceGroupName, String azureTrafficCollectorName, Context context);
+
+ /**
+ * Gets the collector policy in a specified Traffic Collector.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the collector policy in a specified Traffic Collector.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CollectorPolicyInner get(String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName);
+
+ /**
+ * Gets the collector policy in a specified Traffic Collector.
+ *
+ * @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}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName, Context context);
+
+ /**
+ * Creates or updates a Collector Policy resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @param parameters The parameters to provide for the created Collector Policy.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of collector policy resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, CollectorPolicyInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String azureTrafficCollectorName,
+ String collectorPolicyName,
+ CollectorPolicyInner parameters);
+
+ /**
+ * Creates or updates a Collector Policy resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @param parameters The parameters to provide for the created Collector Policy.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of collector policy resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, CollectorPolicyInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String azureTrafficCollectorName,
+ String collectorPolicyName,
+ CollectorPolicyInner parameters,
+ Context context);
+
+ /**
+ * Creates or updates a Collector Policy resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @param parameters The parameters to provide for the created Collector Policy.
+ * @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 createOrUpdate(
+ String resourceGroupName,
+ String azureTrafficCollectorName,
+ String collectorPolicyName,
+ CollectorPolicyInner parameters);
+
+ /**
+ * Creates or updates a Collector Policy resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @param parameters The parameters to provide for the created Collector Policy.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CollectorPolicyInner createOrUpdate(
+ String resourceGroupName,
+ String azureTrafficCollectorName,
+ String collectorPolicyName,
+ CollectorPolicyInner parameters,
+ Context context);
+
+ /**
+ * Deletes a specified Collector Policy resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName);
+
+ /**
+ * Deletes a specified Collector Policy resource.
+ *
+ * @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 {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName, Context context);
+
+ /**
+ * Deletes a specified Collector Policy resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName);
+
+ /**
+ * Deletes a specified Collector Policy resource.
+ *
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(
+ String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName, Context context);
+}
diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/NetworkFunctionsClient.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/NetworkFunctionsClient.java
new file mode 100644
index 000000000000..d23276d85d57
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/NetworkFunctionsClient.java
@@ -0,0 +1,38 @@
+// 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.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.networkfunction.fluent.models.OperationInner;
+
+/** An instance of this class provides access to all the operations defined in NetworkFunctionsClient. */
+public interface NetworkFunctionsClient {
+ /**
+ * Lists all of the available NetworkFunction Rest API operations.
+ *
+ * @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 result of the request to list Azure Traffic Collector operations as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listOperations();
+
+ /**
+ * Lists all of the available NetworkFunction Rest API operations.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return result of the request to list Azure Traffic Collector operations as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listOperations(Context context);
+}
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
new file mode 100644
index 000000000000..a4e9f9f30cbc
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/AzureTrafficCollectorInner.java
@@ -0,0 +1,143 @@
+// 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.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.Resource;
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.networkfunction.models.ProvisioningState;
+import com.azure.resourcemanager.networkfunction.models.ResourceReference;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+import java.util.Map;
+
+/** Azure Traffic Collector resource. */
+@Fluent
+public final class AzureTrafficCollectorInner extends Resource {
+ /*
+ * Properties of the Azure Traffic Collector.
+ */
+ @JsonProperty(value = "properties")
+ private AzureTrafficCollectorPropertiesFormat innerProperties;
+
+ /*
+ * A unique read-only string that changes whenever the resource is updated.
+ */
+ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY)
+ private String etag;
+
+ /*
+ * Metadata pertaining to creation and last modification of the resource.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /**
+ * Get the innerProperties property: Properties of the Azure Traffic Collector.
+ *
+ * @return the innerProperties value.
+ */
+ private AzureTrafficCollectorPropertiesFormat innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the etag property: A unique read-only string that changes whenever the resource is updated.
+ *
+ * @return the etag value.
+ */
+ public String etag() {
+ return this.etag;
+ }
+
+ /**
+ * Get the systemData property: Metadata pertaining to creation and last modification of the resource.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public AzureTrafficCollectorInner withLocation(String location) {
+ super.withLocation(location);
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public AzureTrafficCollectorInner withTags(Map tags) {
+ super.withTags(tags);
+ return this;
+ }
+
+ /**
+ * Get the collectorPolicies property: Collector Policies for Azure Traffic Collector.
+ *
+ * @return the collectorPolicies value.
+ */
+ 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.
+ *
+ * @return the virtualHub value.
+ */
+ public ResourceReference virtualHub() {
+ return this.innerProperties() == null ? null : this.innerProperties().virtualHub();
+ }
+
+ /**
+ * Set the virtualHub property: The virtualHub to which the Azure Traffic Collector belongs.
+ *
+ * @param virtualHub the virtualHub value to set.
+ * @return the AzureTrafficCollectorInner object itself.
+ */
+ public AzureTrafficCollectorInner withVirtualHub(ResourceReference virtualHub) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new AzureTrafficCollectorPropertiesFormat();
+ }
+ this.innerProperties().withVirtualHub(virtualHub);
+ return this;
+ }
+
+ /**
+ * Get the provisioningState property: The provisioning state of the application rule collection resource.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
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
new file mode 100644
index 000000000000..9c6aec5694db
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/AzureTrafficCollectorPropertiesFormat.java
@@ -0,0 +1,96 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.networkfunction.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.networkfunction.models.ProvisioningState;
+import com.azure.resourcemanager.networkfunction.models.ResourceReference;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** Azure Traffic Collector resource properties. */
+@Fluent
+public final class AzureTrafficCollectorPropertiesFormat {
+ /*
+ * Collector Policies for Azure Traffic Collector.
+ */
+ @JsonProperty(value = "collectorPolicies")
+ private List collectorPolicies;
+
+ /*
+ * The virtualHub to which the Azure Traffic Collector belongs.
+ */
+ @JsonProperty(value = "virtualHub")
+ private ResourceReference virtualHub;
+
+ /*
+ * The provisioning state of the application rule collection resource.
+ */
+ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
+ private ProvisioningState provisioningState;
+
+ /**
+ * Get the collectorPolicies property: Collector Policies for Azure Traffic Collector.
+ *
+ * @return the collectorPolicies value.
+ */
+ 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.
+ *
+ * @return the virtualHub value.
+ */
+ public ResourceReference virtualHub() {
+ return this.virtualHub;
+ }
+
+ /**
+ * Set the virtualHub property: The virtualHub to which the Azure Traffic Collector belongs.
+ *
+ * @param virtualHub the virtualHub value to set.
+ * @return the AzureTrafficCollectorPropertiesFormat object itself.
+ */
+ public AzureTrafficCollectorPropertiesFormat withVirtualHub(ResourceReference virtualHub) {
+ this.virtualHub = virtualHub;
+ return this;
+ }
+
+ /**
+ * Get the provisioningState property: The provisioning state of the application rule collection resource.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (collectorPolicies() != null) {
+ collectorPolicies().forEach(e -> e.validate());
+ }
+ if (virtualHub() != null) {
+ virtualHub().validate();
+ }
+ }
+}
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
new file mode 100644
index 000000000000..a4bfc646ae6f
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/CollectorPolicyInner.java
@@ -0,0 +1,129 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.networkfunction.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+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;
+
+/** Collector policy resource. */
+@Fluent
+public final class CollectorPolicyInner extends ProxyResource {
+ /*
+ * Properties of the Collector Policy.
+ */
+ @JsonProperty(value = "properties")
+ private CollectorPolicyPropertiesFormat innerProperties;
+
+ /*
+ * A unique read-only string that changes whenever the resource is updated.
+ */
+ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY)
+ private String etag;
+
+ /*
+ * Metadata pertaining to creation and last modification of the resource.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /**
+ * Get the innerProperties property: Properties of the Collector Policy.
+ *
+ * @return the innerProperties value.
+ */
+ private CollectorPolicyPropertiesFormat innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the etag property: A unique read-only string that changes whenever the resource is updated.
+ *
+ * @return the etag value.
+ */
+ public String etag() {
+ return this.etag;
+ }
+
+ /**
+ * Get the systemData property: Metadata pertaining to creation and last modification of the resource.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the ingestionPolicy property: Ingestion policies.
+ *
+ * @return the ingestionPolicy value.
+ */
+ public IngestionPolicyPropertiesFormat ingestionPolicy() {
+ return this.innerProperties() == null ? null : this.innerProperties().ingestionPolicy();
+ }
+
+ /**
+ * Set the ingestionPolicy property: Ingestion policies.
+ *
+ * @param ingestionPolicy the ingestionPolicy value to set.
+ * @return the CollectorPolicyInner object itself.
+ */
+ public CollectorPolicyInner withIngestionPolicy(IngestionPolicyPropertiesFormat ingestionPolicy) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new CollectorPolicyPropertiesFormat();
+ }
+ this.innerProperties().withIngestionPolicy(ingestionPolicy);
+ return this;
+ }
+
+ /**
+ * Get the emissionPolicies property: Emission policies.
+ *
+ * @return the emissionPolicies value.
+ */
+ public List emissionPolicies() {
+ return this.innerProperties() == null ? null : this.innerProperties().emissionPolicies();
+ }
+
+ /**
+ * Set the emissionPolicies property: Emission policies.
+ *
+ * @param emissionPolicies the emissionPolicies value to set.
+ * @return the CollectorPolicyInner object itself.
+ */
+ public CollectorPolicyInner withEmissionPolicies(List emissionPolicies) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new CollectorPolicyPropertiesFormat();
+ }
+ this.innerProperties().withEmissionPolicies(emissionPolicies);
+ return this;
+ }
+
+ /**
+ * Get the provisioningState property: The provisioning state.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
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
new file mode 100644
index 000000000000..c96568da5fe0
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/CollectorPolicyPropertiesFormat.java
@@ -0,0 +1,98 @@
+// 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.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+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;
+
+/** Collection policy properties. */
+@Fluent
+public final class CollectorPolicyPropertiesFormat {
+ /*
+ * Ingestion policies.
+ */
+ @JsonProperty(value = "ingestionPolicy")
+ private IngestionPolicyPropertiesFormat ingestionPolicy;
+
+ /*
+ * Emission policies.
+ */
+ @JsonProperty(value = "emissionPolicies")
+ private List emissionPolicies;
+
+ /*
+ * The provisioning state.
+ */
+ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
+ private ProvisioningState provisioningState;
+
+ /**
+ * Get the ingestionPolicy property: Ingestion policies.
+ *
+ * @return the ingestionPolicy value.
+ */
+ public IngestionPolicyPropertiesFormat ingestionPolicy() {
+ return this.ingestionPolicy;
+ }
+
+ /**
+ * Set the ingestionPolicy property: Ingestion policies.
+ *
+ * @param ingestionPolicy the ingestionPolicy value to set.
+ * @return the CollectorPolicyPropertiesFormat object itself.
+ */
+ public CollectorPolicyPropertiesFormat withIngestionPolicy(IngestionPolicyPropertiesFormat ingestionPolicy) {
+ this.ingestionPolicy = ingestionPolicy;
+ return this;
+ }
+
+ /**
+ * Get the emissionPolicies property: Emission policies.
+ *
+ * @return the emissionPolicies value.
+ */
+ public List emissionPolicies() {
+ return this.emissionPolicies;
+ }
+
+ /**
+ * Set the emissionPolicies property: Emission policies.
+ *
+ * @param emissionPolicies the emissionPolicies value to set.
+ * @return the CollectorPolicyPropertiesFormat object itself.
+ */
+ public CollectorPolicyPropertiesFormat withEmissionPolicies(
+ List emissionPolicies) {
+ this.emissionPolicies = emissionPolicies;
+ return this;
+ }
+
+ /**
+ * Get the provisioningState property: The provisioning state.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (ingestionPolicy() != null) {
+ ingestionPolicy().validate();
+ }
+ if (emissionPolicies() != null) {
+ emissionPolicies().forEach(e -> e.validate());
+ }
+ }
+}
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
new file mode 100644
index 000000000000..4ad869d1fcf0
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/OperationInner.java
@@ -0,0 +1,128 @@
+// 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.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.networkfunction.models.OperationDisplay;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Azure Traffic Collector REST API operation definition. */
+@Fluent
+public final class OperationInner {
+ /*
+ * Operation name: {provider}/{resource}/{operation}
+ */
+ @JsonProperty(value = "name")
+ private String name;
+
+ /*
+ * Indicates whether the operation is a data action
+ */
+ @JsonProperty(value = "isDataAction")
+ private Boolean isDataAction;
+
+ /*
+ * Display metadata associated with the operation.
+ */
+ @JsonProperty(value = "display")
+ private OperationDisplay display;
+
+ /*
+ * Origin of the operation
+ */
+ @JsonProperty(value = "origin")
+ private String origin;
+
+ /**
+ * Get the name property: Operation name: {provider}/{resource}/{operation}.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set the name property: Operation name: {provider}/{resource}/{operation}.
+ *
+ * @param name the name value to set.
+ * @return the OperationInner object itself.
+ */
+ public OperationInner withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get the isDataAction property: Indicates whether the operation is a data action.
+ *
+ * @return the isDataAction value.
+ */
+ public Boolean isDataAction() {
+ return this.isDataAction;
+ }
+
+ /**
+ * Set the isDataAction property: Indicates whether the operation is a data action.
+ *
+ * @param isDataAction the isDataAction value to set.
+ * @return the OperationInner object itself.
+ */
+ public OperationInner withIsDataAction(Boolean isDataAction) {
+ this.isDataAction = isDataAction;
+ return this;
+ }
+
+ /**
+ * Get the display property: Display metadata associated with the operation.
+ *
+ * @return the display value.
+ */
+ public OperationDisplay display() {
+ return this.display;
+ }
+
+ /**
+ * Set the display property: Display metadata associated with the operation.
+ *
+ * @param display the display value to set.
+ * @return the OperationInner object itself.
+ */
+ public OperationInner withDisplay(OperationDisplay display) {
+ this.display = display;
+ return this;
+ }
+
+ /**
+ * Get the origin property: Origin of the operation.
+ *
+ * @return the origin value.
+ */
+ public String origin() {
+ return this.origin;
+ }
+
+ /**
+ * Set the origin property: Origin of the operation.
+ *
+ * @param origin the origin value to set.
+ * @return the OperationInner object itself.
+ */
+ public OperationInner withOrigin(String origin) {
+ this.origin = origin;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (display() != null) {
+ display().validate();
+ }
+ }
+}
diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/package-info.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/package-info.java
new file mode 100644
index 000000000000..91965a56eb65
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/models/package-info.java
@@ -0,0 +1,8 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/**
+ * Package containing the inner data models for AzureTrafficCollectorManagementClient. Azure Traffic Collector service.
+ */
+package com.azure.resourcemanager.networkfunction.fluent.models;
diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/package-info.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/package-info.java
new file mode 100644
index 000000000000..9907fa28abd8
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/fluent/package-info.java
@@ -0,0 +1,8 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/**
+ * Package containing the service clients for AzureTrafficCollectorManagementClient. Azure Traffic Collector service.
+ */
+package com.azure.resourcemanager.networkfunction.fluent;
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
new file mode 100644
index 000000000000..a1d31b878e40
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorImpl.java
@@ -0,0 +1,226 @@
+// 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.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.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 {
+ private AzureTrafficCollectorInner innerObject;
+
+ private final com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public String location() {
+ return this.innerModel().location();
+ }
+
+ public Map tags() {
+ Map inner = this.innerModel().tags();
+ if (inner != null) {
+ return Collections.unmodifiableMap(inner);
+ } else {
+ return Collections.emptyMap();
+ }
+ }
+
+ public String etag() {
+ return this.innerModel().etag();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ 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()));
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public ResourceReference virtualHub() {
+ return this.innerModel().virtualHub();
+ }
+
+ 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;
+ }
+
+ public AzureTrafficCollectorInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String azureTrafficCollectorName;
+
+ private TagsObject updateParameters;
+
+ public AzureTrafficCollectorImpl withExistingResourceGroup(String resourceGroupName) {
+ this.resourceGroupName = resourceGroupName;
+ return this;
+ }
+
+ public AzureTrafficCollector create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getAzureTrafficCollectors()
+ .createOrUpdate(resourceGroupName, azureTrafficCollectorName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public AzureTrafficCollector create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getAzureTrafficCollectors()
+ .createOrUpdate(resourceGroupName, azureTrafficCollectorName, this.innerModel(), context);
+ return this;
+ }
+
+ AzureTrafficCollectorImpl(
+ String name, com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager serviceManager) {
+ this.innerObject = new AzureTrafficCollectorInner();
+ this.serviceManager = serviceManager;
+ this.azureTrafficCollectorName = name;
+ }
+
+ public AzureTrafficCollectorImpl update() {
+ this.updateParameters = new TagsObject();
+ return this;
+ }
+
+ public AzureTrafficCollector apply() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getAzureTrafficCollectors()
+ .updateTagsWithResponse(resourceGroupName, azureTrafficCollectorName, updateParameters, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public AzureTrafficCollector apply(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getAzureTrafficCollectors()
+ .updateTagsWithResponse(resourceGroupName, azureTrafficCollectorName, updateParameters, context)
+ .getValue();
+ return this;
+ }
+
+ AzureTrafficCollectorImpl(
+ AzureTrafficCollectorInner innerObject,
+ com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.azureTrafficCollectorName = Utils.getValueFromIdByName(innerObject.id(), "azureTrafficCollectors");
+ }
+
+ public AzureTrafficCollector refresh() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getAzureTrafficCollectors()
+ .getByResourceGroupWithResponse(resourceGroupName, azureTrafficCollectorName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public AzureTrafficCollector refresh(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getAzureTrafficCollectors()
+ .getByResourceGroupWithResponse(resourceGroupName, azureTrafficCollectorName, context)
+ .getValue();
+ return this;
+ }
+
+ public AzureTrafficCollectorImpl withRegion(Region location) {
+ this.innerModel().withLocation(location.toString());
+ return this;
+ }
+
+ public AzureTrafficCollectorImpl withRegion(String location) {
+ this.innerModel().withLocation(location);
+ return this;
+ }
+
+ public AzureTrafficCollectorImpl withTags(Map tags) {
+ if (isInCreateMode()) {
+ this.innerModel().withTags(tags);
+ return this;
+ } else {
+ this.updateParameters.withTags(tags);
+ return this;
+ }
+ }
+
+ public AzureTrafficCollectorImpl withCollectorPolicies(List collectorPolicies) {
+ this.innerModel().withCollectorPolicies(collectorPolicies);
+ return this;
+ }
+
+ public AzureTrafficCollectorImpl withVirtualHub(ResourceReference virtualHub) {
+ this.innerModel().withVirtualHub(virtualHub);
+ return this;
+ }
+
+ private boolean isInCreateMode() {
+ return this.innerModel().id() == null;
+ }
+}
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
new file mode 100644
index 000000000000..f2427264f6f2
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorManagementClientBuilder.java
@@ -0,0 +1,142 @@
+// 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.implementation;
+
+import com.azure.core.annotation.ServiceClientBuilder;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
+import com.azure.core.http.policy.RetryPolicy;
+import com.azure.core.http.policy.UserAgentPolicy;
+import com.azure.core.management.AzureEnvironment;
+import com.azure.core.management.serializer.SerializerFactory;
+import com.azure.core.util.serializer.SerializerAdapter;
+import java.time.Duration;
+
+/** A builder for creating a new instance of the AzureTrafficCollectorManagementClientImpl type. */
+@ServiceClientBuilder(serviceClients = {AzureTrafficCollectorManagementClientImpl.class})
+public final class AzureTrafficCollectorManagementClientBuilder {
+ /*
+ * Azure Subscription ID.
+ */
+ private String subscriptionId;
+
+ /**
+ * Sets Azure Subscription ID.
+ *
+ * @param subscriptionId the subscriptionId value.
+ * @return the AzureTrafficCollectorManagementClientBuilder.
+ */
+ public AzureTrafficCollectorManagementClientBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /*
+ * server parameter
+ */
+ private String endpoint;
+
+ /**
+ * Sets server parameter.
+ *
+ * @param endpoint the endpoint value.
+ * @return the AzureTrafficCollectorManagementClientBuilder.
+ */
+ public AzureTrafficCollectorManagementClientBuilder endpoint(String endpoint) {
+ this.endpoint = endpoint;
+ return this;
+ }
+
+ /*
+ * The environment to connect to
+ */
+ private AzureEnvironment environment;
+
+ /**
+ * Sets The environment to connect to.
+ *
+ * @param environment the environment value.
+ * @return the AzureTrafficCollectorManagementClientBuilder.
+ */
+ public AzureTrafficCollectorManagementClientBuilder environment(AzureEnvironment environment) {
+ this.environment = environment;
+ return this;
+ }
+
+ /*
+ * The HTTP pipeline to send requests through
+ */
+ private HttpPipeline pipeline;
+
+ /**
+ * Sets The HTTP pipeline to send requests through.
+ *
+ * @param pipeline the pipeline value.
+ * @return the AzureTrafficCollectorManagementClientBuilder.
+ */
+ public AzureTrafficCollectorManagementClientBuilder pipeline(HttpPipeline pipeline) {
+ this.pipeline = pipeline;
+ return this;
+ }
+
+ /*
+ * The default poll interval for long-running operation
+ */
+ private Duration defaultPollInterval;
+
+ /**
+ * Sets The default poll interval for long-running operation.
+ *
+ * @param defaultPollInterval the defaultPollInterval value.
+ * @return the AzureTrafficCollectorManagementClientBuilder.
+ */
+ public AzureTrafficCollectorManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval = defaultPollInterval;
+ return this;
+ }
+
+ /*
+ * The serializer to serialize an object into a string
+ */
+ private SerializerAdapter serializerAdapter;
+
+ /**
+ * Sets The serializer to serialize an object into a string.
+ *
+ * @param serializerAdapter the serializerAdapter value.
+ * @return the AzureTrafficCollectorManagementClientBuilder.
+ */
+ public AzureTrafficCollectorManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of AzureTrafficCollectorManagementClientImpl with the provided parameters.
+ *
+ * @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();
+ }
+ AzureTrafficCollectorManagementClientImpl client =
+ new AzureTrafficCollectorManagementClientImpl(
+ pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint);
+ 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
new file mode 100644
index 000000000000..4861aa897980
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorManagementClientImpl.java
@@ -0,0 +1,346 @@
+// 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.implementation;
+
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.http.HttpHeaders;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpResponse;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.AzureEnvironment;
+import com.azure.core.management.exception.ManagementError;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.management.polling.PollerFactory;
+import com.azure.core.util.Context;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.polling.AsyncPollResponse;
+import com.azure.core.util.polling.LongRunningOperationStatus;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.serializer.SerializerAdapter;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.networkfunction.fluent.AzureTrafficCollectorManagementClient;
+import com.azure.resourcemanager.networkfunction.fluent.AzureTrafficCollectorsByResourceGroupsClient;
+import com.azure.resourcemanager.networkfunction.fluent.AzureTrafficCollectorsBySubscriptionsClient;
+import com.azure.resourcemanager.networkfunction.fluent.AzureTrafficCollectorsClient;
+import com.azure.resourcemanager.networkfunction.fluent.CollectorPoliciesClient;
+import com.azure.resourcemanager.networkfunction.fluent.NetworkFunctionsClient;
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.time.Duration;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/** Initializes a new instance of the AzureTrafficCollectorManagementClientImpl type. */
+@ServiceClient(builder = AzureTrafficCollectorManagementClientBuilder.class)
+public final class AzureTrafficCollectorManagementClientImpl implements AzureTrafficCollectorManagementClient {
+ /** Azure Subscription ID. */
+ private final String subscriptionId;
+
+ /**
+ * Gets Azure Subscription ID.
+ *
+ * @return the subscriptionId value.
+ */
+ public String getSubscriptionId() {
+ return this.subscriptionId;
+ }
+
+ /** server parameter. */
+ private final String endpoint;
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ public String getEndpoint() {
+ return this.endpoint;
+ }
+
+ /** Api Version. */
+ private final String apiVersion;
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ public String getApiVersion() {
+ return this.apiVersion;
+ }
+
+ /** The HTTP pipeline to send requests through. */
+ private final HttpPipeline httpPipeline;
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ public HttpPipeline getHttpPipeline() {
+ return this.httpPipeline;
+ }
+
+ /** The serializer to serialize an object into a string. */
+ private final SerializerAdapter serializerAdapter;
+
+ /**
+ * Gets The serializer to serialize an object into a string.
+ *
+ * @return the serializerAdapter value.
+ */
+ SerializerAdapter getSerializerAdapter() {
+ return this.serializerAdapter;
+ }
+
+ /** The default poll interval for long-running operation. */
+ private final Duration defaultPollInterval;
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ public Duration getDefaultPollInterval() {
+ return this.defaultPollInterval;
+ }
+
+ /** The NetworkFunctionsClient object to access its operations. */
+ private final NetworkFunctionsClient networkFunctions;
+
+ /**
+ * Gets the NetworkFunctionsClient object to access its operations.
+ *
+ * @return the NetworkFunctionsClient object.
+ */
+ public NetworkFunctionsClient getNetworkFunctions() {
+ return this.networkFunctions;
+ }
+
+ /** The AzureTrafficCollectorsBySubscriptionsClient object to access its operations. */
+ private final AzureTrafficCollectorsBySubscriptionsClient azureTrafficCollectorsBySubscriptions;
+
+ /**
+ * Gets the AzureTrafficCollectorsBySubscriptionsClient object to access its operations.
+ *
+ * @return the AzureTrafficCollectorsBySubscriptionsClient object.
+ */
+ public AzureTrafficCollectorsBySubscriptionsClient getAzureTrafficCollectorsBySubscriptions() {
+ return this.azureTrafficCollectorsBySubscriptions;
+ }
+
+ /** The AzureTrafficCollectorsByResourceGroupsClient object to access its operations. */
+ private final AzureTrafficCollectorsByResourceGroupsClient azureTrafficCollectorsByResourceGroups;
+
+ /**
+ * Gets the AzureTrafficCollectorsByResourceGroupsClient object to access its operations.
+ *
+ * @return the AzureTrafficCollectorsByResourceGroupsClient object.
+ */
+ public AzureTrafficCollectorsByResourceGroupsClient getAzureTrafficCollectorsByResourceGroups() {
+ return this.azureTrafficCollectorsByResourceGroups;
+ }
+
+ /** The AzureTrafficCollectorsClient object to access its operations. */
+ private final AzureTrafficCollectorsClient azureTrafficCollectors;
+
+ /**
+ * Gets the AzureTrafficCollectorsClient object to access its operations.
+ *
+ * @return the AzureTrafficCollectorsClient object.
+ */
+ public AzureTrafficCollectorsClient getAzureTrafficCollectors() {
+ return this.azureTrafficCollectors;
+ }
+
+ /** The CollectorPoliciesClient object to access its operations. */
+ private final CollectorPoliciesClient collectorPolicies;
+
+ /**
+ * Gets the CollectorPoliciesClient object to access its operations.
+ *
+ * @return the CollectorPoliciesClient object.
+ */
+ public CollectorPoliciesClient getCollectorPolicies() {
+ return this.collectorPolicies;
+ }
+
+ /**
+ * Initializes an instance of AzureTrafficCollectorManagementClient client.
+ *
+ * @param httpPipeline The HTTP pipeline to send requests through.
+ * @param serializerAdapter The serializer to serialize an object into a string.
+ * @param defaultPollInterval The default poll interval for long-running operation.
+ * @param environment The Azure environment.
+ * @param subscriptionId Azure Subscription ID.
+ * @param endpoint server parameter.
+ */
+ AzureTrafficCollectorManagementClientImpl(
+ HttpPipeline httpPipeline,
+ SerializerAdapter serializerAdapter,
+ Duration defaultPollInterval,
+ AzureEnvironment environment,
+ String subscriptionId,
+ String endpoint) {
+ this.httpPipeline = httpPipeline;
+ this.serializerAdapter = serializerAdapter;
+ this.defaultPollInterval = defaultPollInterval;
+ this.subscriptionId = subscriptionId;
+ this.endpoint = endpoint;
+ this.apiVersion = "2022-05-01";
+ this.networkFunctions = new NetworkFunctionsClientImpl(this);
+ this.azureTrafficCollectorsBySubscriptions = new AzureTrafficCollectorsBySubscriptionsClientImpl(this);
+ this.azureTrafficCollectorsByResourceGroups = new AzureTrafficCollectorsByResourceGroupsClientImpl(this);
+ this.azureTrafficCollectors = new AzureTrafficCollectorsClientImpl(this);
+ this.collectorPolicies = new CollectorPoliciesClientImpl(this);
+ }
+
+ /**
+ * Gets default client context.
+ *
+ * @return the default client context.
+ */
+ public Context getContext() {
+ return Context.NONE;
+ }
+
+ /**
+ * Merges default client context with provided context.
+ *
+ * @param context the context to be merged with default client context.
+ * @return the merged context.
+ */
+ public Context mergeContext(Context context) {
+ return CoreUtils.mergeContexts(this.getContext(), context);
+ }
+
+ /**
+ * Gets long running operation result.
+ *
+ * @param activationResponse the response of activation operation.
+ * @param httpPipeline the http pipeline.
+ * @param pollResultType type of poll result.
+ * @param finalResultType type of final result.
+ * @param context the context shared by all requests.
+ * @param type of poll result.
+ * @param type of final result.
+ * @return poller flux for poll result and final result.
+ */
+ public PollerFlux, U> getLroResult(
+ Mono>> activationResponse,
+ HttpPipeline httpPipeline,
+ Type pollResultType,
+ Type finalResultType,
+ Context context) {
+ return PollerFactory
+ .create(
+ serializerAdapter,
+ httpPipeline,
+ pollResultType,
+ finalResultType,
+ defaultPollInterval,
+ activationResponse,
+ context);
+ }
+
+ /**
+ * Gets the final result, or an error, based on last async poll response.
+ *
+ * @param response the last async poll response.
+ * @param type of poll result.
+ * @param type of final result.
+ * @return the final result, or an error.
+ */
+ public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) {
+ if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
+ String errorMessage;
+ ManagementError managementError = null;
+ HttpResponse errorResponse = null;
+ PollResult.Error lroError = response.getValue().getError();
+ if (lroError != null) {
+ errorResponse =
+ new HttpResponseImpl(
+ lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody());
+
+ errorMessage = response.getValue().getError().getMessage();
+ String errorBody = response.getValue().getError().getResponseBody();
+ if (errorBody != null) {
+ // try to deserialize error body to ManagementError
+ try {
+ managementError =
+ this
+ .getSerializerAdapter()
+ .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON);
+ if (managementError.getCode() == null || managementError.getMessage() == null) {
+ managementError = null;
+ }
+ } catch (IOException | RuntimeException ioe) {
+ LOGGER.logThrowableAsWarning(ioe);
+ }
+ }
+ } else {
+ // fallback to default error message
+ errorMessage = "Long running operation failed.";
+ }
+ if (managementError == null) {
+ // fallback to default ManagementError
+ managementError = new ManagementError(response.getStatus().toString(), errorMessage);
+ }
+ return Mono.error(new ManagementException(errorMessage, errorResponse, managementError));
+ } else {
+ return response.getFinalResult();
+ }
+ }
+
+ private static final class HttpResponseImpl extends HttpResponse {
+ private final int statusCode;
+
+ private final byte[] responseBody;
+
+ private final HttpHeaders httpHeaders;
+
+ HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) {
+ super(null);
+ this.statusCode = statusCode;
+ this.httpHeaders = httpHeaders;
+ this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8);
+ }
+
+ public int getStatusCode() {
+ return statusCode;
+ }
+
+ public String getHeaderValue(String s) {
+ return httpHeaders.getValue(s);
+ }
+
+ public HttpHeaders getHeaders() {
+ return httpHeaders;
+ }
+
+ public Flux getBody() {
+ return Flux.just(ByteBuffer.wrap(responseBody));
+ }
+
+ public Mono getBodyAsByteArray() {
+ return Mono.just(responseBody);
+ }
+
+ public Mono getBodyAsString() {
+ return Mono.just(new String(responseBody, StandardCharsets.UTF_8));
+ }
+
+ public Mono getBodyAsString(Charset charset) {
+ return Mono.just(new String(responseBody, charset));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(AzureTrafficCollectorManagementClientImpl.class);
+}
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
new file mode 100644
index 000000000000..aa603c83ba53
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsByResourceGroupsClientImpl.java
@@ -0,0 +1,330 @@
+// 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.implementation;
+
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.networkfunction.fluent.AzureTrafficCollectorsByResourceGroupsClient;
+import com.azure.resourcemanager.networkfunction.fluent.models.AzureTrafficCollectorInner;
+import com.azure.resourcemanager.networkfunction.models.AzureTrafficCollectorListResult;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in
+ * AzureTrafficCollectorsByResourceGroupsClient.
+ */
+public final class AzureTrafficCollectorsByResourceGroupsClientImpl
+ implements AzureTrafficCollectorsByResourceGroupsClient {
+ /** The proxy service used to perform REST calls. */
+ private final AzureTrafficCollectorsByResourceGroupsService service;
+
+ /** The service client containing this operation class. */
+ private final AzureTrafficCollectorManagementClientImpl client;
+
+ /**
+ * Initializes an instance of AzureTrafficCollectorsByResourceGroupsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ AzureTrafficCollectorsByResourceGroupsClientImpl(AzureTrafficCollectorManagementClientImpl client) {
+ this.service =
+ RestProxy
+ .create(
+ AzureTrafficCollectorsByResourceGroupsService.class,
+ client.getHttpPipeline(),
+ client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for
+ * AzureTrafficCollectorManagementClientAzureTrafficCollectorsByResourceGroups to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "AzureTrafficCollecto")
+ private interface AzureTrafficCollectorsByResourceGroupsService {
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction"
+ + "/azureTrafficCollectors")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Return list of Azure Traffic Collectors in a Resource Group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the ListTrafficCollectors API service call along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(
+ String resourceGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (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."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Return list of Azure Traffic Collectors in a Resource Group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 response for the ListTrafficCollectors API service call along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(
+ String resourceGroupName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (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."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Return list of Azure Traffic Collectors in a Resource Group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the ListTrafficCollectors API service call as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Return list of Azure Traffic Collectors in a Resource Group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 response for the ListTrafficCollectors API service call as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
+ nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Return list of Azure Traffic Collectors in a Resource Group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the ListTrafficCollectors API service call as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
+ }
+
+ /**
+ * Return list of Azure Traffic Collectors in a Resource Group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 response for the ListTrafficCollectors API service call as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the ListTrafficCollectors API service call along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the ListTrafficCollectors API service call along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+}
diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsByResourceGroupsImpl.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsByResourceGroupsImpl.java
new file mode 100644
index 000000000000..9c422dee236f
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsByResourceGroupsImpl.java
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.networkfunction.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.networkfunction.fluent.AzureTrafficCollectorsByResourceGroupsClient;
+import com.azure.resourcemanager.networkfunction.fluent.models.AzureTrafficCollectorInner;
+import com.azure.resourcemanager.networkfunction.models.AzureTrafficCollector;
+import com.azure.resourcemanager.networkfunction.models.AzureTrafficCollectorsByResourceGroups;
+
+public final class AzureTrafficCollectorsByResourceGroupsImpl implements AzureTrafficCollectorsByResourceGroups {
+ private static final ClientLogger LOGGER = new ClientLogger(AzureTrafficCollectorsByResourceGroupsImpl.class);
+
+ private final AzureTrafficCollectorsByResourceGroupsClient innerClient;
+
+ private final com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager serviceManager;
+
+ public AzureTrafficCollectorsByResourceGroupsImpl(
+ AzureTrafficCollectorsByResourceGroupsClient innerClient,
+ com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName);
+ return Utils.mapPage(inner, inner1 -> new AzureTrafficCollectorImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ PagedIterable inner =
+ this.serviceClient().listByResourceGroup(resourceGroupName, context);
+ return Utils.mapPage(inner, inner1 -> new AzureTrafficCollectorImpl(inner1, this.manager()));
+ }
+
+ private AzureTrafficCollectorsByResourceGroupsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager manager() {
+ return this.serviceManager;
+ }
+}
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
new file mode 100644
index 000000000000..e12276bc371d
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsBySubscriptionsClientImpl.java
@@ -0,0 +1,304 @@
+// 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.implementation;
+
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.networkfunction.fluent.AzureTrafficCollectorsBySubscriptionsClient;
+import com.azure.resourcemanager.networkfunction.fluent.models.AzureTrafficCollectorInner;
+import com.azure.resourcemanager.networkfunction.models.AzureTrafficCollectorListResult;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in
+ * AzureTrafficCollectorsBySubscriptionsClient.
+ */
+public final class AzureTrafficCollectorsBySubscriptionsClientImpl
+ implements AzureTrafficCollectorsBySubscriptionsClient {
+ /** The proxy service used to perform REST calls. */
+ private final AzureTrafficCollectorsBySubscriptionsService service;
+
+ /** The service client containing this operation class. */
+ private final AzureTrafficCollectorManagementClientImpl client;
+
+ /**
+ * Initializes an instance of AzureTrafficCollectorsBySubscriptionsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ AzureTrafficCollectorsBySubscriptionsClientImpl(AzureTrafficCollectorManagementClientImpl client) {
+ this.service =
+ RestProxy
+ .create(
+ AzureTrafficCollectorsBySubscriptionsService.class,
+ client.getHttpPipeline(),
+ client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for
+ * AzureTrafficCollectorManagementClientAzureTrafficCollectorsBySubscriptions to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "AzureTrafficCollecto")
+ private interface AzureTrafficCollectorsBySubscriptionsService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.NetworkFunction/azureTrafficCollectors")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Return list of Azure Traffic Collectors in a subscription.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the ListTrafficCollectors API service call along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync() {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Return list of Azure Traffic Collectors in a subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the ListTrafficCollectors API service call along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Return list of Azure Traffic Collectors in a subscription.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the ListTrafficCollectors API service call as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Return list of Azure Traffic Collectors in a subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the ListTrafficCollectors API service call as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Return list of Azure Traffic Collectors in a subscription.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the ListTrafficCollectors API service call as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * Return list of Azure Traffic Collectors in a subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the ListTrafficCollectors API service call as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the ListTrafficCollectors API service call along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the ListTrafficCollectors API service call along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+}
diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsBySubscriptionsImpl.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsBySubscriptionsImpl.java
new file mode 100644
index 000000000000..f70489225e6e
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsBySubscriptionsImpl.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.networkfunction.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.networkfunction.fluent.AzureTrafficCollectorsBySubscriptionsClient;
+import com.azure.resourcemanager.networkfunction.fluent.models.AzureTrafficCollectorInner;
+import com.azure.resourcemanager.networkfunction.models.AzureTrafficCollector;
+import com.azure.resourcemanager.networkfunction.models.AzureTrafficCollectorsBySubscriptions;
+
+public final class AzureTrafficCollectorsBySubscriptionsImpl implements AzureTrafficCollectorsBySubscriptions {
+ private static final ClientLogger LOGGER = new ClientLogger(AzureTrafficCollectorsBySubscriptionsImpl.class);
+
+ private final AzureTrafficCollectorsBySubscriptionsClient innerClient;
+
+ private final com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager serviceManager;
+
+ public AzureTrafficCollectorsBySubscriptionsImpl(
+ AzureTrafficCollectorsBySubscriptionsClient innerClient,
+ com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return Utils.mapPage(inner, inner1 -> new AzureTrafficCollectorImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return Utils.mapPage(inner, inner1 -> new AzureTrafficCollectorImpl(inner1, this.manager()));
+ }
+
+ private AzureTrafficCollectorsBySubscriptionsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager manager() {
+ return this.serviceManager;
+ }
+}
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
new file mode 100644
index 000000000000..6330e3b26127
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsClientImpl.java
@@ -0,0 +1,977 @@
+// 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.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.Patch;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.networkfunction.fluent.AzureTrafficCollectorsClient;
+import com.azure.resourcemanager.networkfunction.fluent.models.AzureTrafficCollectorInner;
+import com.azure.resourcemanager.networkfunction.models.TagsObject;
+import java.nio.ByteBuffer;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in AzureTrafficCollectorsClient. */
+public final class AzureTrafficCollectorsClientImpl implements AzureTrafficCollectorsClient {
+ /** The proxy service used to perform REST calls. */
+ private final AzureTrafficCollectorsService service;
+
+ /** The service client containing this operation class. */
+ private final AzureTrafficCollectorManagementClientImpl client;
+
+ /**
+ * Initializes an instance of AzureTrafficCollectorsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ AzureTrafficCollectorsClientImpl(AzureTrafficCollectorManagementClientImpl client) {
+ this.service =
+ RestProxy
+ .create(AzureTrafficCollectorsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for AzureTrafficCollectorManagementClientAzureTrafficCollectors to be
+ * used by the proxy service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "AzureTrafficCollecto")
+ private interface AzureTrafficCollectorsService {
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction"
+ + "/azureTrafficCollectors/{azureTrafficCollectorName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("azureTrafficCollectorName") String azureTrafficCollectorName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction"
+ + "/azureTrafficCollectors/{azureTrafficCollectorName}")
+ @ExpectedResponses({200, 201})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> createOrUpdate(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("azureTrafficCollectorName") String azureTrafficCollectorName,
+ @BodyParam("application/json") AzureTrafficCollectorInner parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction"
+ + "/azureTrafficCollectors/{azureTrafficCollectorName}")
+ @ExpectedResponses({200, 202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("azureTrafficCollectorName") String azureTrafficCollectorName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Patch(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction"
+ + "/azureTrafficCollectors/{azureTrafficCollectorName}")
+ @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,
+ @BodyParam("application/json") TagsObject parameters,
+ @HeaderParam("Accept") String accept,
+ 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ String resourceGroupName, String azureTrafficCollectorName) {
+ 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."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .getByResourceGroup(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ azureTrafficCollectorName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * 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 ManagementException 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} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ String resourceGroupName, String azureTrafficCollectorName, 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."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .getByResourceGroup(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ azureTrafficCollectorName,
+ accept,
+ 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getByResourceGroupAsync(
+ String resourceGroupName, String azureTrafficCollectorName) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, azureTrafficCollectorName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AzureTrafficCollectorInner getByResourceGroup(String resourceGroupName, String azureTrafficCollectorName) {
+ return getByResourceGroupAsync(resourceGroupName, azureTrafficCollectorName).block();
+ }
+
+ /**
+ * 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 ManagementException 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}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getByResourceGroupWithResponse(
+ String resourceGroupName, String azureTrafficCollectorName, Context context) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, azureTrafficCollectorName, context).block();
+ }
+
+ /**
+ * Creates or updates a Azure Traffic Collector resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param parameters The parameters to provide for the created Azure Traffic Collector.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String resourceGroupName, String azureTrafficCollectorName, AzureTrafficCollectorInner 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 (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
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ azureTrafficCollectorName,
+ parameters,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Creates or updates a Azure Traffic Collector resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param parameters The parameters to provide for the created Azure Traffic Collector.
+ * @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} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String resourceGroupName,
+ String azureTrafficCollectorName,
+ AzureTrafficCollectorInner 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 (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
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ azureTrafficCollectorName,
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * Creates or updates a Azure Traffic Collector resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param parameters The parameters to provide for the created Azure Traffic Collector.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of azure Traffic Collector resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, AzureTrafficCollectorInner> beginCreateOrUpdateAsync(
+ String resourceGroupName, String azureTrafficCollectorName, AzureTrafficCollectorInner parameters) {
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(resourceGroupName, azureTrafficCollectorName, parameters);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ AzureTrafficCollectorInner.class,
+ AzureTrafficCollectorInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Creates or updates a Azure Traffic Collector resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param parameters The parameters to provide for the created Azure Traffic Collector.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of azure Traffic Collector resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, AzureTrafficCollectorInner> beginCreateOrUpdateAsync(
+ String resourceGroupName,
+ String azureTrafficCollectorName,
+ AzureTrafficCollectorInner parameters,
+ Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(resourceGroupName, azureTrafficCollectorName, parameters, context);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ AzureTrafficCollectorInner.class,
+ AzureTrafficCollectorInner.class,
+ context);
+ }
+
+ /**
+ * Creates or updates a Azure Traffic Collector resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param parameters The parameters to provide for the created Azure Traffic Collector.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of azure Traffic Collector resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, AzureTrafficCollectorInner> beginCreateOrUpdate(
+ String resourceGroupName, String azureTrafficCollectorName, AzureTrafficCollectorInner parameters) {
+ return beginCreateOrUpdateAsync(resourceGroupName, azureTrafficCollectorName, parameters).getSyncPoller();
+ }
+
+ /**
+ * Creates or updates a Azure Traffic Collector resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param parameters The parameters to provide for the created Azure Traffic Collector.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of azure Traffic Collector resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, AzureTrafficCollectorInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String azureTrafficCollectorName,
+ AzureTrafficCollectorInner parameters,
+ Context context) {
+ return beginCreateOrUpdateAsync(resourceGroupName, azureTrafficCollectorName, parameters, context)
+ .getSyncPoller();
+ }
+
+ /**
+ * Creates or updates a Azure Traffic Collector resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param parameters The parameters to provide for the created Azure Traffic Collector.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName, String azureTrafficCollectorName, AzureTrafficCollectorInner parameters) {
+ return beginCreateOrUpdateAsync(resourceGroupName, azureTrafficCollectorName, parameters)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Creates or updates a Azure Traffic Collector resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param parameters The parameters to provide for the created Azure Traffic Collector.
+ * @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 on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName,
+ String azureTrafficCollectorName,
+ AzureTrafficCollectorInner parameters,
+ Context context) {
+ return beginCreateOrUpdateAsync(resourceGroupName, azureTrafficCollectorName, parameters, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Creates or updates a Azure Traffic Collector resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param parameters The parameters to provide for the created Azure Traffic Collector.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AzureTrafficCollectorInner createOrUpdate(
+ String resourceGroupName, String azureTrafficCollectorName, AzureTrafficCollectorInner parameters) {
+ return createOrUpdateAsync(resourceGroupName, azureTrafficCollectorName, parameters).block();
+ }
+
+ /**
+ * Creates or updates a Azure Traffic Collector resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param parameters The parameters to provide for the created Azure Traffic Collector.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AzureTrafficCollectorInner createOrUpdate(
+ String resourceGroupName,
+ String azureTrafficCollectorName,
+ AzureTrafficCollectorInner parameters,
+ Context context) {
+ return createOrUpdateAsync(resourceGroupName, azureTrafficCollectorName, parameters, context).block();
+ }
+
+ /**
+ * Deletes a specified Azure Traffic Collector resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(
+ String resourceGroupName, String azureTrafficCollectorName) {
+ 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."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ azureTrafficCollectorName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Deletes a specified Azure Traffic Collector resource.
+ *
+ * @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 {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(
+ String resourceGroupName, String azureTrafficCollectorName, 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."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .delete(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ azureTrafficCollectorName,
+ accept,
+ context);
+ }
+
+ /**
+ * Deletes a specified Azure Traffic Collector resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(
+ String resourceGroupName, String azureTrafficCollectorName) {
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, azureTrafficCollectorName);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
+ }
+
+ /**
+ * Deletes a specified Azure Traffic Collector resource.
+ *
+ * @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 {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(
+ String resourceGroupName, String azureTrafficCollectorName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ deleteWithResponseAsync(resourceGroupName, azureTrafficCollectorName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Deletes a specified Azure Traffic Collector resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(String resourceGroupName, String azureTrafficCollectorName) {
+ return beginDeleteAsync(resourceGroupName, azureTrafficCollectorName).getSyncPoller();
+ }
+
+ /**
+ * Deletes a specified Azure Traffic Collector resource.
+ *
+ * @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 {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(
+ String resourceGroupName, String azureTrafficCollectorName, Context context) {
+ return beginDeleteAsync(resourceGroupName, azureTrafficCollectorName, context).getSyncPoller();
+ }
+
+ /**
+ * Deletes a specified Azure Traffic Collector resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String azureTrafficCollectorName) {
+ return beginDeleteAsync(resourceGroupName, azureTrafficCollectorName)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Deletes a specified Azure Traffic Collector resource.
+ *
+ * @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 A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String azureTrafficCollectorName, Context context) {
+ return beginDeleteAsync(resourceGroupName, azureTrafficCollectorName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Deletes a specified Azure Traffic Collector resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceGroupName, String azureTrafficCollectorName) {
+ deleteAsync(resourceGroupName, azureTrafficCollectorName).block();
+ }
+
+ /**
+ * Deletes a specified Azure Traffic Collector resource.
+ *
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceGroupName, String azureTrafficCollectorName, Context context) {
+ deleteAsync(resourceGroupName, azureTrafficCollectorName, context).block();
+ }
+
+ /**
+ * Updates the specified Azure Traffic Collector tags.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param parameters Parameters supplied to update Azure Traffic Collector 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 azure Traffic Collector resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> updateTagsWithResponseAsync(
+ String resourceGroupName, String azureTrafficCollectorName, 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 (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,
+ parameters,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Updates the specified Azure Traffic Collector tags.
+ *
+ * @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} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> updateTagsWithResponseAsync(
+ String resourceGroupName, String azureTrafficCollectorName, 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 (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,
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * Updates the specified Azure Traffic Collector tags.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param parameters Parameters supplied to update Azure Traffic Collector 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 azure Traffic Collector resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateTagsAsync(
+ String resourceGroupName, String azureTrafficCollectorName, TagsObject parameters) {
+ return updateTagsWithResponseAsync(resourceGroupName, azureTrafficCollectorName, parameters)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Updates the specified Azure Traffic Collector tags.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param parameters Parameters supplied to update Azure Traffic Collector 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 azure Traffic Collector resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AzureTrafficCollectorInner updateTags(
+ String resourceGroupName, String azureTrafficCollectorName, TagsObject parameters) {
+ return updateTagsAsync(resourceGroupName, azureTrafficCollectorName, parameters).block();
+ }
+
+ /**
+ * Updates the specified Azure Traffic Collector tags.
+ *
+ * @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}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response updateTagsWithResponse(
+ String resourceGroupName, String azureTrafficCollectorName, TagsObject parameters, Context context) {
+ return updateTagsWithResponseAsync(resourceGroupName, azureTrafficCollectorName, parameters, context).block();
+ }
+}
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
new file mode 100644
index 000000000000..8443f8ca76d1
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/AzureTrafficCollectorsImpl.java
@@ -0,0 +1,164 @@
+// 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.implementation;
+
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.networkfunction.fluent.AzureTrafficCollectorsClient;
+import com.azure.resourcemanager.networkfunction.fluent.models.AzureTrafficCollectorInner;
+import com.azure.resourcemanager.networkfunction.models.AzureTrafficCollector;
+import com.azure.resourcemanager.networkfunction.models.AzureTrafficCollectors;
+
+public final class AzureTrafficCollectorsImpl implements AzureTrafficCollectors {
+ private static final ClientLogger LOGGER = new ClientLogger(AzureTrafficCollectorsImpl.class);
+
+ private final AzureTrafficCollectorsClient innerClient;
+
+ private final com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager serviceManager;
+
+ public AzureTrafficCollectorsImpl(
+ AzureTrafficCollectorsClient innerClient,
+ com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager serviceManager) {
+ this.innerClient = innerClient;
+ 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 =
+ this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, azureTrafficCollectorName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new AzureTrafficCollectorImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public void deleteByResourceGroup(String resourceGroupName, String azureTrafficCollectorName) {
+ this.serviceClient().delete(resourceGroupName, azureTrafficCollectorName);
+ }
+
+ public void delete(String resourceGroupName, String azureTrafficCollectorName, Context context) {
+ this.serviceClient().delete(resourceGroupName, azureTrafficCollectorName, context);
+ }
+
+ public AzureTrafficCollector getById(String id) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String azureTrafficCollectorName = Utils.getValueFromIdByName(id, "azureTrafficCollectors");
+ if (azureTrafficCollectorName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'azureTrafficCollectors'.",
+ id)));
+ }
+ return this
+ .getByResourceGroupWithResponse(resourceGroupName, azureTrafficCollectorName, Context.NONE)
+ .getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String azureTrafficCollectorName = Utils.getValueFromIdByName(id, "azureTrafficCollectors");
+ if (azureTrafficCollectorName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'azureTrafficCollectors'.",
+ id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, azureTrafficCollectorName, context);
+ }
+
+ public void deleteById(String id) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String azureTrafficCollectorName = Utils.getValueFromIdByName(id, "azureTrafficCollectors");
+ if (azureTrafficCollectorName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'azureTrafficCollectors'.",
+ id)));
+ }
+ this.delete(resourceGroupName, azureTrafficCollectorName, Context.NONE);
+ }
+
+ public void deleteByIdWithResponse(String id, Context context) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String azureTrafficCollectorName = Utils.getValueFromIdByName(id, "azureTrafficCollectors");
+ if (azureTrafficCollectorName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'azureTrafficCollectors'.",
+ id)));
+ }
+ this.delete(resourceGroupName, azureTrafficCollectorName, context);
+ }
+
+ private AzureTrafficCollectorsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager manager() {
+ return this.serviceManager;
+ }
+
+ public AzureTrafficCollectorImpl define(String name) {
+ return new AzureTrafficCollectorImpl(name, this.manager());
+ }
+}
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
new file mode 100644
index 000000000000..b8696e6fd185
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/CollectorPoliciesClientImpl.java
@@ -0,0 +1,1170 @@
+// 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.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.networkfunction.fluent.CollectorPoliciesClient;
+import com.azure.resourcemanager.networkfunction.fluent.models.CollectorPolicyInner;
+import com.azure.resourcemanager.networkfunction.models.CollectorPolicyListResult;
+import java.nio.ByteBuffer;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in CollectorPoliciesClient. */
+public final class CollectorPoliciesClientImpl implements CollectorPoliciesClient {
+ /** The proxy service used to perform REST calls. */
+ private final CollectorPoliciesService service;
+
+ /** The service client containing this operation class. */
+ private final AzureTrafficCollectorManagementClientImpl client;
+
+ /**
+ * Initializes an instance of CollectorPoliciesClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ CollectorPoliciesClientImpl(AzureTrafficCollectorManagementClientImpl client) {
+ this.service =
+ RestProxy.create(CollectorPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for AzureTrafficCollectorManagementClientCollectorPolicies to be used by
+ * the proxy service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "AzureTrafficCollecto")
+ private interface CollectorPoliciesService {
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction"
+ + "/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("azureTrafficCollectorName") String azureTrafficCollectorName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction"
+ + "/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(
+ @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,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction"
+ + "/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}")
+ @ExpectedResponses({200, 201})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> createOrUpdate(
+ @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") CollectorPolicyInner parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction"
+ + "/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}")
+ @ExpectedResponses({200, 202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(
+ @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,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Return list of Collector policies in a Azure Traffic Collector.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the ListCollectorPolicies API service call along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(
+ String resourceGroupName, String azureTrafficCollectorName) {
+ 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."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .list(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ azureTrafficCollectorName,
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Return list of Collector policies in a Azure Traffic Collector.
+ *
+ * @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 response for the ListCollectorPolicies API service call along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(
+ String resourceGroupName, String azureTrafficCollectorName, 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."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ azureTrafficCollectorName,
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Return list of Collector policies in a Azure Traffic Collector.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the ListCollectorPolicies API service call as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String resourceGroupName, String azureTrafficCollectorName) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, azureTrafficCollectorName),
+ nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Return list of Collector policies in a Azure Traffic Collector.
+ *
+ * @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 response for the ListCollectorPolicies API service call as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(
+ String resourceGroupName, String azureTrafficCollectorName, Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, azureTrafficCollectorName, context),
+ nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Return list of Collector policies in a Azure Traffic Collector.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the ListCollectorPolicies API service call as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String resourceGroupName, String azureTrafficCollectorName) {
+ return new PagedIterable<>(listAsync(resourceGroupName, azureTrafficCollectorName));
+ }
+
+ /**
+ * Return list of Collector policies in a Azure Traffic Collector.
+ *
+ * @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 response for the ListCollectorPolicies API service call as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(
+ String resourceGroupName, String azureTrafficCollectorName, Context context) {
+ return new PagedIterable<>(listAsync(resourceGroupName, azureTrafficCollectorName, context));
+ }
+
+ /**
+ * Gets the collector policy in a specified Traffic Collector.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the collector policy in a specified Traffic Collector along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName) {
+ 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."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .get(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ azureTrafficCollectorName,
+ collectorPolicyName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets the collector policy in a specified Traffic Collector.
+ *
+ * @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} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName, 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."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .get(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ azureTrafficCollectorName,
+ collectorPolicyName,
+ accept,
+ context);
+ }
+
+ /**
+ * Gets the collector policy in a specified Traffic Collector.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the collector policy in a specified Traffic Collector on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(
+ String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName) {
+ return getWithResponseAsync(resourceGroupName, azureTrafficCollectorName, collectorPolicyName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Gets the collector policy in a specified Traffic Collector.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the collector policy in a specified Traffic Collector.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public CollectorPolicyInner get(
+ String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName) {
+ return getAsync(resourceGroupName, azureTrafficCollectorName, collectorPolicyName).block();
+ }
+
+ /**
+ * Gets the collector policy in a specified Traffic Collector.
+ *
+ * @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}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(
+ String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName, Context context) {
+ return getWithResponseAsync(resourceGroupName, azureTrafficCollectorName, collectorPolicyName, context).block();
+ }
+
+ /**
+ * Creates or updates a Collector Policy resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @param parameters The parameters to provide for the created Collector Policy.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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>> createOrUpdateWithResponseAsync(
+ String resourceGroupName,
+ String azureTrafficCollectorName,
+ String collectorPolicyName,
+ CollectorPolicyInner 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
+ .createOrUpdate(
+ 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()));
+ }
+
+ /**
+ * Creates or updates a Collector Policy resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @param parameters The parameters to provide for the created Collector Policy.
+ * @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>> createOrUpdateWithResponseAsync(
+ String resourceGroupName,
+ String azureTrafficCollectorName,
+ String collectorPolicyName,
+ CollectorPolicyInner 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
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ azureTrafficCollectorName,
+ collectorPolicyName,
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * Creates or updates a Collector Policy resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @param parameters The parameters to provide for the created Collector Policy.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of collector policy resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, CollectorPolicyInner> beginCreateOrUpdateAsync(
+ String resourceGroupName,
+ String azureTrafficCollectorName,
+ String collectorPolicyName,
+ CollectorPolicyInner parameters) {
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(
+ resourceGroupName, azureTrafficCollectorName, collectorPolicyName, parameters);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ CollectorPolicyInner.class,
+ CollectorPolicyInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Creates or updates a Collector Policy resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @param parameters The parameters to provide for the created Collector Policy.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of collector policy resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, CollectorPolicyInner> beginCreateOrUpdateAsync(
+ String resourceGroupName,
+ String azureTrafficCollectorName,
+ String collectorPolicyName,
+ CollectorPolicyInner parameters,
+ Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(
+ resourceGroupName, azureTrafficCollectorName, collectorPolicyName, parameters, context);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), CollectorPolicyInner.class, CollectorPolicyInner.class, context);
+ }
+
+ /**
+ * Creates or updates a Collector Policy resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @param parameters The parameters to provide for the created Collector Policy.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of collector policy resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, CollectorPolicyInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String azureTrafficCollectorName,
+ String collectorPolicyName,
+ CollectorPolicyInner parameters) {
+ return beginCreateOrUpdateAsync(resourceGroupName, azureTrafficCollectorName, collectorPolicyName, parameters)
+ .getSyncPoller();
+ }
+
+ /**
+ * Creates or updates a Collector Policy resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @param parameters The parameters to provide for the created Collector Policy.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of collector policy resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, CollectorPolicyInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String azureTrafficCollectorName,
+ String collectorPolicyName,
+ CollectorPolicyInner parameters,
+ Context context) {
+ return beginCreateOrUpdateAsync(
+ resourceGroupName, azureTrafficCollectorName, collectorPolicyName, parameters, context)
+ .getSyncPoller();
+ }
+
+ /**
+ * Creates or updates a Collector Policy resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @param parameters The parameters to provide for the created Collector Policy.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 createOrUpdateAsync(
+ String resourceGroupName,
+ String azureTrafficCollectorName,
+ String collectorPolicyName,
+ CollectorPolicyInner parameters) {
+ return beginCreateOrUpdateAsync(resourceGroupName, azureTrafficCollectorName, collectorPolicyName, parameters)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Creates or updates a Collector Policy resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @param parameters The parameters to provide for the created Collector Policy.
+ * @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 on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName,
+ String azureTrafficCollectorName,
+ String collectorPolicyName,
+ CollectorPolicyInner parameters,
+ Context context) {
+ return beginCreateOrUpdateAsync(
+ resourceGroupName, azureTrafficCollectorName, collectorPolicyName, parameters, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Creates or updates a Collector Policy resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @param parameters The parameters to provide for the created Collector Policy.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 createOrUpdate(
+ String resourceGroupName,
+ String azureTrafficCollectorName,
+ String collectorPolicyName,
+ CollectorPolicyInner parameters) {
+ return createOrUpdateAsync(resourceGroupName, azureTrafficCollectorName, collectorPolicyName, parameters)
+ .block();
+ }
+
+ /**
+ * Creates or updates a Collector Policy resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @param parameters The parameters to provide for the created Collector Policy.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public CollectorPolicyInner createOrUpdate(
+ String resourceGroupName,
+ String azureTrafficCollectorName,
+ String collectorPolicyName,
+ CollectorPolicyInner parameters,
+ Context context) {
+ return createOrUpdateAsync(
+ resourceGroupName, azureTrafficCollectorName, collectorPolicyName, parameters, context)
+ .block();
+ }
+
+ /**
+ * Deletes a specified Collector Policy resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(
+ String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName) {
+ 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."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ azureTrafficCollectorName,
+ collectorPolicyName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Deletes a specified Collector Policy resource.
+ *
+ * @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 {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(
+ String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName, 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."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .delete(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ azureTrafficCollectorName,
+ collectorPolicyName,
+ accept,
+ context);
+ }
+
+ /**
+ * Deletes a specified Collector Policy resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(
+ String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName) {
+ Mono>> mono =
+ deleteWithResponseAsync(resourceGroupName, azureTrafficCollectorName, collectorPolicyName);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
+ }
+
+ /**
+ * Deletes a specified Collector Policy resource.
+ *
+ * @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 {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(
+ String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ deleteWithResponseAsync(resourceGroupName, azureTrafficCollectorName, collectorPolicyName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Deletes a specified Collector Policy resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(
+ String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName) {
+ return beginDeleteAsync(resourceGroupName, azureTrafficCollectorName, collectorPolicyName).getSyncPoller();
+ }
+
+ /**
+ * Deletes a specified Collector Policy resource.
+ *
+ * @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 {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(
+ String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName, Context context) {
+ return beginDeleteAsync(resourceGroupName, azureTrafficCollectorName, collectorPolicyName, context)
+ .getSyncPoller();
+ }
+
+ /**
+ * Deletes a specified Collector Policy resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(
+ String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName) {
+ return beginDeleteAsync(resourceGroupName, azureTrafficCollectorName, collectorPolicyName)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Deletes a specified Collector Policy resource.
+ *
+ * @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 A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(
+ String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName, Context context) {
+ return beginDeleteAsync(resourceGroupName, azureTrafficCollectorName, collectorPolicyName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Deletes a specified Collector Policy resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param azureTrafficCollectorName Azure Traffic Collector name.
+ * @param collectorPolicyName Collector Policy Name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName) {
+ deleteAsync(resourceGroupName, azureTrafficCollectorName, collectorPolicyName).block();
+ }
+
+ /**
+ * Deletes a specified Collector Policy resource.
+ *
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(
+ String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName, Context context) {
+ deleteAsync(resourceGroupName, azureTrafficCollectorName, collectorPolicyName, context).block();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the ListCollectorPolicies API service call along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for the ListCollectorPolicies API service call along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+}
diff --git a/sdk/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
new file mode 100644
index 000000000000..003aed806f27
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/CollectorPoliciesImpl.java
@@ -0,0 +1,217 @@
+// 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.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.networkfunction.fluent.CollectorPoliciesClient;
+import com.azure.resourcemanager.networkfunction.fluent.models.CollectorPolicyInner;
+import com.azure.resourcemanager.networkfunction.models.CollectorPolicies;
+import com.azure.resourcemanager.networkfunction.models.CollectorPolicy;
+
+public final class CollectorPoliciesImpl implements CollectorPolicies {
+ private static final ClientLogger LOGGER = new ClientLogger(CollectorPoliciesImpl.class);
+
+ private final CollectorPoliciesClient innerClient;
+
+ private final com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager serviceManager;
+
+ public CollectorPoliciesImpl(
+ CollectorPoliciesClient innerClient,
+ com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list(String resourceGroupName, String azureTrafficCollectorName) {
+ PagedIterable inner =
+ this.serviceClient().list(resourceGroupName, azureTrafficCollectorName);
+ return Utils.mapPage(inner, inner1 -> new CollectorPolicyImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(
+ String resourceGroupName, String azureTrafficCollectorName, Context context) {
+ PagedIterable inner =
+ this.serviceClient().list(resourceGroupName, azureTrafficCollectorName, context);
+ 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 =
+ this
+ .serviceClient()
+ .getWithResponse(resourceGroupName, azureTrafficCollectorName, collectorPolicyName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new CollectorPolicyImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public void delete(String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName) {
+ this.serviceClient().delete(resourceGroupName, azureTrafficCollectorName, collectorPolicyName);
+ }
+
+ public void delete(
+ String resourceGroupName, String azureTrafficCollectorName, String collectorPolicyName, Context context) {
+ this.serviceClient().delete(resourceGroupName, azureTrafficCollectorName, collectorPolicyName, context);
+ }
+
+ public CollectorPolicy getById(String id) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String azureTrafficCollectorName = Utils.getValueFromIdByName(id, "azureTrafficCollectors");
+ if (azureTrafficCollectorName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'azureTrafficCollectors'.",
+ id)));
+ }
+ String collectorPolicyName = Utils.getValueFromIdByName(id, "collectorPolicies");
+ if (collectorPolicyName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'collectorPolicies'.", id)));
+ }
+ return this
+ .getWithResponse(resourceGroupName, azureTrafficCollectorName, collectorPolicyName, Context.NONE)
+ .getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String azureTrafficCollectorName = Utils.getValueFromIdByName(id, "azureTrafficCollectors");
+ if (azureTrafficCollectorName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'azureTrafficCollectors'.",
+ id)));
+ }
+ String collectorPolicyName = Utils.getValueFromIdByName(id, "collectorPolicies");
+ if (collectorPolicyName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'collectorPolicies'.", id)));
+ }
+ return this.getWithResponse(resourceGroupName, azureTrafficCollectorName, collectorPolicyName, context);
+ }
+
+ public void deleteById(String id) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String azureTrafficCollectorName = Utils.getValueFromIdByName(id, "azureTrafficCollectors");
+ if (azureTrafficCollectorName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'azureTrafficCollectors'.",
+ id)));
+ }
+ String collectorPolicyName = Utils.getValueFromIdByName(id, "collectorPolicies");
+ if (collectorPolicyName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'collectorPolicies'.", id)));
+ }
+ this.delete(resourceGroupName, azureTrafficCollectorName, collectorPolicyName, Context.NONE);
+ }
+
+ public void deleteByIdWithResponse(String id, Context context) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String azureTrafficCollectorName = Utils.getValueFromIdByName(id, "azureTrafficCollectors");
+ if (azureTrafficCollectorName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'azureTrafficCollectors'.",
+ id)));
+ }
+ String collectorPolicyName = Utils.getValueFromIdByName(id, "collectorPolicies");
+ if (collectorPolicyName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'collectorPolicies'.", id)));
+ }
+ this.delete(resourceGroupName, azureTrafficCollectorName, collectorPolicyName, context);
+ }
+
+ private CollectorPoliciesClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager manager() {
+ return this.serviceManager;
+ }
+
+ public CollectorPolicyImpl define(String name) {
+ return new CollectorPolicyImpl(name, this.manager());
+ }
+}
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
new file mode 100644
index 000000000000..c0bc6829efc4
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/CollectorPolicyImpl.java
@@ -0,0 +1,174 @@
+// 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.implementation;
+
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.networkfunction.fluent.models.CollectorPolicyInner;
+import com.azure.resourcemanager.networkfunction.models.CollectorPolicy;
+import com.azure.resourcemanager.networkfunction.models.EmissionPoliciesPropertiesFormat;
+import com.azure.resourcemanager.networkfunction.models.IngestionPolicyPropertiesFormat;
+import com.azure.resourcemanager.networkfunction.models.ProvisioningState;
+import java.util.Collections;
+import java.util.List;
+
+public final class CollectorPolicyImpl implements CollectorPolicy, CollectorPolicy.Definition, CollectorPolicy.Update {
+ private CollectorPolicyInner innerObject;
+
+ private final com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public String etag() {
+ return this.innerModel().etag();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public IngestionPolicyPropertiesFormat ingestionPolicy() {
+ return this.innerModel().ingestionPolicy();
+ }
+
+ public List emissionPolicies() {
+ List inner = this.innerModel().emissionPolicies();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public ProvisioningState provisioningState() {
+ return this.innerModel().provisioningState();
+ }
+
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
+ public CollectorPolicyInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String azureTrafficCollectorName;
+
+ private String collectorPolicyName;
+
+ public CollectorPolicyImpl withExistingAzureTrafficCollector(
+ String resourceGroupName, String azureTrafficCollectorName) {
+ this.resourceGroupName = resourceGroupName;
+ this.azureTrafficCollectorName = azureTrafficCollectorName;
+ return this;
+ }
+
+ public CollectorPolicy create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getCollectorPolicies()
+ .createOrUpdate(
+ resourceGroupName, azureTrafficCollectorName, collectorPolicyName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public CollectorPolicy create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getCollectorPolicies()
+ .createOrUpdate(
+ resourceGroupName, azureTrafficCollectorName, collectorPolicyName, this.innerModel(), context);
+ return this;
+ }
+
+ CollectorPolicyImpl(
+ String name, com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager serviceManager) {
+ this.innerObject = new CollectorPolicyInner();
+ this.serviceManager = serviceManager;
+ this.collectorPolicyName = name;
+ }
+
+ public CollectorPolicyImpl update() {
+ return this;
+ }
+
+ public CollectorPolicy apply() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getCollectorPolicies()
+ .createOrUpdate(
+ resourceGroupName, azureTrafficCollectorName, collectorPolicyName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public CollectorPolicy apply(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getCollectorPolicies()
+ .createOrUpdate(
+ resourceGroupName, azureTrafficCollectorName, collectorPolicyName, this.innerModel(), context);
+ return this;
+ }
+
+ CollectorPolicyImpl(
+ CollectorPolicyInner innerObject,
+ com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.azureTrafficCollectorName = Utils.getValueFromIdByName(innerObject.id(), "azureTrafficCollectors");
+ this.collectorPolicyName = Utils.getValueFromIdByName(innerObject.id(), "collectorPolicies");
+ }
+
+ public CollectorPolicy refresh() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getCollectorPolicies()
+ .getWithResponse(resourceGroupName, azureTrafficCollectorName, collectorPolicyName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public CollectorPolicy refresh(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getCollectorPolicies()
+ .getWithResponse(resourceGroupName, azureTrafficCollectorName, collectorPolicyName, context)
+ .getValue();
+ return this;
+ }
+
+ public CollectorPolicyImpl withIngestionPolicy(IngestionPolicyPropertiesFormat ingestionPolicy) {
+ this.innerModel().withIngestionPolicy(ingestionPolicy);
+ return this;
+ }
+
+ public CollectorPolicyImpl withEmissionPolicies(List emissionPolicies) {
+ this.innerModel().withEmissionPolicies(emissionPolicies);
+ return this;
+ }
+}
diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/NetworkFunctionsClientImpl.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/NetworkFunctionsClientImpl.java
new file mode 100644
index 000000000000..9fb54979539f
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/NetworkFunctionsClientImpl.java
@@ -0,0 +1,180 @@
+// 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.implementation;
+
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.networkfunction.fluent.NetworkFunctionsClient;
+import com.azure.resourcemanager.networkfunction.fluent.models.OperationInner;
+import com.azure.resourcemanager.networkfunction.models.OperationListResult;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in NetworkFunctionsClient. */
+public final class NetworkFunctionsClientImpl implements NetworkFunctionsClient {
+ /** The proxy service used to perform REST calls. */
+ private final NetworkFunctionsService service;
+
+ /** The service client containing this operation class. */
+ private final AzureTrafficCollectorManagementClientImpl client;
+
+ /**
+ * Initializes an instance of NetworkFunctionsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ NetworkFunctionsClientImpl(AzureTrafficCollectorManagementClientImpl client) {
+ this.service =
+ RestProxy.create(NetworkFunctionsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for AzureTrafficCollectorManagementClientNetworkFunctions to be used by
+ * the proxy service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "AzureTrafficCollecto")
+ private interface NetworkFunctionsService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/providers/Microsoft.NetworkFunction/operations")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listOperations(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Lists all of the available NetworkFunction Rest API operations.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return result of the request to list Azure Traffic Collector operations along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listOperationsSinglePageAsync() {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service.listOperations(this.client.getEndpoint(), this.client.getApiVersion(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Lists all of the available NetworkFunction Rest API operations.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return result of the request to list Azure Traffic Collector operations along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listOperationsSinglePageAsync(Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listOperations(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null));
+ }
+
+ /**
+ * Lists all of the available NetworkFunction Rest API operations.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return result of the request to list Azure Traffic Collector operations as paginated response with {@link
+ * PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listOperationsAsync() {
+ return new PagedFlux<>(() -> listOperationsSinglePageAsync());
+ }
+
+ /**
+ * Lists all of the available NetworkFunction Rest API operations.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return result of the request to list Azure Traffic Collector operations as paginated response with {@link
+ * PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listOperationsAsync(Context context) {
+ return new PagedFlux<>(() -> listOperationsSinglePageAsync(context));
+ }
+
+ /**
+ * Lists all of the available NetworkFunction Rest API operations.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return result of the request to list Azure Traffic Collector operations as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listOperations() {
+ return new PagedIterable<>(listOperationsAsync());
+ }
+
+ /**
+ * Lists all of the available NetworkFunction Rest API operations.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return result of the request to list Azure Traffic Collector operations as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listOperations(Context context) {
+ return new PagedIterable<>(listOperationsAsync(context));
+ }
+}
diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/NetworkFunctionsImpl.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/NetworkFunctionsImpl.java
new file mode 100644
index 000000000000..977ff8ef9488
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/NetworkFunctionsImpl.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.networkfunction.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.networkfunction.fluent.NetworkFunctionsClient;
+import com.azure.resourcemanager.networkfunction.fluent.models.OperationInner;
+import com.azure.resourcemanager.networkfunction.models.NetworkFunctions;
+import com.azure.resourcemanager.networkfunction.models.Operation;
+
+public final class NetworkFunctionsImpl implements NetworkFunctions {
+ private static final ClientLogger LOGGER = new ClientLogger(NetworkFunctionsImpl.class);
+
+ private final NetworkFunctionsClient innerClient;
+
+ private final com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager serviceManager;
+
+ public NetworkFunctionsImpl(
+ NetworkFunctionsClient innerClient,
+ com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable listOperations() {
+ PagedIterable inner = this.serviceClient().listOperations();
+ return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listOperations(Context context) {
+ PagedIterable inner = this.serviceClient().listOperations(context);
+ return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager()));
+ }
+
+ private NetworkFunctionsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/OperationImpl.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/OperationImpl.java
new file mode 100644
index 000000000000..6f7e1b68b390
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/OperationImpl.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.networkfunction.implementation;
+
+import com.azure.resourcemanager.networkfunction.fluent.models.OperationInner;
+import com.azure.resourcemanager.networkfunction.models.Operation;
+import com.azure.resourcemanager.networkfunction.models.OperationDisplay;
+
+public final class OperationImpl implements Operation {
+ private OperationInner innerObject;
+
+ private final com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager serviceManager;
+
+ OperationImpl(
+ OperationInner innerObject,
+ com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public Boolean isDataAction() {
+ return this.innerModel().isDataAction();
+ }
+
+ public OperationDisplay display() {
+ return this.innerModel().display();
+ }
+
+ public String origin() {
+ return this.innerModel().origin();
+ }
+
+ public OperationInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/Utils.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/Utils.java
new file mode 100644
index 000000000000..7f76784e29f0
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/Utils.java
@@ -0,0 +1,204 @@
+// 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.implementation;
+
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.util.CoreUtils;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import reactor.core.publisher.Flux;
+
+final class Utils {
+ static String getValueFromIdByName(String id, String name) {
+ if (id == null) {
+ return null;
+ }
+ Iterator itr = Arrays.stream(id.split("/")).iterator();
+ while (itr.hasNext()) {
+ String part = itr.next();
+ if (part != null && !part.trim().isEmpty()) {
+ if (part.equalsIgnoreCase(name)) {
+ if (itr.hasNext()) {
+ return itr.next();
+ } else {
+ return null;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) {
+ if (id == null || pathTemplate == null) {
+ return null;
+ }
+ String parameterNameParentheses = "{" + parameterName + "}";
+ List idSegmentsReverted = Arrays.asList(id.split("/"));
+ List pathSegments = Arrays.asList(pathTemplate.split("/"));
+ Collections.reverse(idSegmentsReverted);
+ Iterator idItrReverted = idSegmentsReverted.iterator();
+ int pathIndex = pathSegments.size();
+ while (idItrReverted.hasNext() && pathIndex > 0) {
+ String idSegment = idItrReverted.next();
+ String pathSegment = pathSegments.get(--pathIndex);
+ if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) {
+ if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) {
+ if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) {
+ List segments = new ArrayList<>();
+ segments.add(idSegment);
+ idItrReverted.forEachRemaining(segments::add);
+ Collections.reverse(segments);
+ if (segments.size() > 0 && segments.get(0).isEmpty()) {
+ segments.remove(0);
+ }
+ return String.join("/", segments);
+ } else {
+ return idSegment;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) {
+ return new PagedIterableImpl(pageIterable, mapper);
+ }
+
+ private static final class PagedIterableImpl extends PagedIterable {
+
+ private final PagedIterable pagedIterable;
+ private final Function mapper;
+ private final Function, PagedResponse> pageMapper;
+
+ private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) {
+ super(
+ PagedFlux
+ .create(
+ () ->
+ (continuationToken, pageSize) ->
+ Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper)))));
+ this.pagedIterable = pagedIterable;
+ this.mapper = mapper;
+ this.pageMapper = getPageMapper(mapper);
+ }
+
+ private static Function, PagedResponse> getPageMapper(Function mapper) {
+ return page ->
+ new PagedResponseBase(
+ page.getRequest(),
+ page.getStatusCode(),
+ page.getHeaders(),
+ page.getElements().stream().map(mapper).collect(Collectors.toList()),
+ page.getContinuationToken(),
+ null);
+ }
+
+ @Override
+ public Stream stream() {
+ return pagedIterable.stream().map(mapper);
+ }
+
+ @Override
+ public Stream> streamByPage() {
+ return pagedIterable.streamByPage().map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(String continuationToken) {
+ return pagedIterable.streamByPage(continuationToken).map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(int preferredPageSize) {
+ return pagedIterable.streamByPage(preferredPageSize).map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(String continuationToken, int preferredPageSize) {
+ return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper);
+ }
+
+ @Override
+ public Iterator iterator() {
+ return new IteratorImpl(pagedIterable.iterator(), mapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage() {
+ return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken) {
+ return new IterableImpl, PagedResponse>(
+ pagedIterable.iterableByPage(continuationToken), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(int preferredPageSize) {
+ return new IterableImpl, PagedResponse>(
+ pagedIterable.iterableByPage(preferredPageSize), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken, int preferredPageSize) {
+ return new IterableImpl, PagedResponse>(
+ pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper);
+ }
+ }
+
+ private static final class IteratorImpl implements Iterator {
+
+ private final Iterator iterator;
+ private final Function mapper;
+
+ private IteratorImpl(Iterator iterator, Function mapper) {
+ this.iterator = iterator;
+ this.mapper = mapper;
+ }
+
+ @Override
+ public boolean hasNext() {
+ return iterator.hasNext();
+ }
+
+ @Override
+ public S next() {
+ return mapper.apply(iterator.next());
+ }
+
+ @Override
+ public void remove() {
+ iterator.remove();
+ }
+ }
+
+ private static final class IterableImpl implements Iterable {
+
+ private final Iterable iterable;
+ private final Function mapper;
+
+ private IterableImpl(Iterable iterable, Function mapper) {
+ this.iterable = iterable;
+ this.mapper = mapper;
+ }
+
+ @Override
+ public Iterator iterator() {
+ return new IteratorImpl(iterable.iterator(), mapper);
+ }
+ }
+}
diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/package-info.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/package-info.java
new file mode 100644
index 000000000000..363e0900cd77
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/implementation/package-info.java
@@ -0,0 +1,8 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/**
+ * Package containing the implementations for AzureTrafficCollectorManagementClient. Azure Traffic Collector service.
+ */
+package com.azure.resourcemanager.networkfunction.implementation;
diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/AzureTrafficCollector.java b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/AzureTrafficCollector.java
new file mode 100644
index 000000000000..2883558b36a9
--- /dev/null
+++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/src/main/java/com/azure/resourcemanager/networkfunction/models/AzureTrafficCollector.java
@@ -0,0 +1,258 @@
+// 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.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.AzureTrafficCollectorInner;
+import com.azure.resourcemanager.networkfunction.fluent.models.CollectorPolicyInner;
+import java.util.List;
+import java.util.Map;
+
+/** An immutable client-side representation of AzureTrafficCollector. */
+public interface AzureTrafficCollector {
+ /**
+ * Gets the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ String id();
+
+ /**
+ * Gets the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ String name();
+
+ /**
+ * Gets the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ String type();
+
+ /**
+ * Gets the location property: The geo-location where the resource lives.
+ *
+ * @return the location value.
+ */
+ String location();
+
+ /**
+ * Gets the tags property: Resource tags.
+ *
+ * @return the tags value.
+ */
+ Map tags();
+
+ /**
+ * Gets the etag property: A unique read-only string that changes whenever the resource is updated.
+ *
+ * @return the etag value.
+ */
+ String etag();
+
+ /**
+ * Gets the systemData property: Metadata pertaining to creation and last modification of the resource.
+ *
+ * @return the systemData value.
+ */
+ SystemData systemData();
+
+ /**
+ * Gets the collectorPolicies property: Collector Policies for Azure Traffic Collector.
+ *
+ * @return the collectorPolicies value.
+ */
+ List collectorPolicies();
+
+ /**
+ * Gets the virtualHub property: The virtualHub to which the Azure Traffic Collector belongs.
+ *
+ * @return the virtualHub value.
+ */
+ ResourceReference virtualHub();
+
+ /**
+ * Gets the provisioningState property: The provisioning state of the application rule collection resource.
+ *
+ * @return the provisioningState value.
+ */
+ 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.
+ *
+ * @return the name of the resource group.
+ */
+ String resourceGroupName();
+
+ /**
+ * Gets the inner com.azure.resourcemanager.networkfunction.fluent.models.AzureTrafficCollectorInner object.
+ *
+ * @return the inner object.
+ */
+ AzureTrafficCollectorInner innerModel();
+
+ /** The entirety of the AzureTrafficCollector definition. */
+ interface Definition
+ extends DefinitionStages.Blank,
+ DefinitionStages.WithLocation,
+ DefinitionStages.WithResourceGroup,
+ DefinitionStages.WithCreate {
+ }
+ /** The AzureTrafficCollector definition stages. */
+ interface DefinitionStages {
+ /** The first stage of the AzureTrafficCollector definition. */
+ interface Blank extends WithLocation {
+ }
+ /** The stage of the AzureTrafficCollector definition allowing to specify location. */
+ interface WithLocation {
+ /**
+ * Specifies the region for the resource.
+ *
+ * @param location The geo-location where the resource lives.
+ * @return the next definition stage.
+ */
+ WithResourceGroup withRegion(Region location);
+
+ /**
+ * Specifies the region for the resource.
+ *
+ * @param location The geo-location where the resource lives.
+ * @return the next definition stage.
+ */
+ WithResourceGroup withRegion(String location);
+ }
+ /** The stage of the AzureTrafficCollector definition allowing to specify parent resource. */
+ interface WithResourceGroup {
+ /**
+ * Specifies resourceGroupName.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @return the next definition stage.
+ */
+ WithCreate withExistingResourceGroup(String resourceGroupName);
+ }
+ /**
+ * 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 {
+ /**
+ * Executes the create request.
+ *
+ * @return the created resource.
+ */
+ AzureTrafficCollector create();
+
+ /**
+ * Executes the create request.
+ *
+ * @param context The context to associate with this operation.
+ * @return the created resource.
+ */
+ AzureTrafficCollector create(Context context);
+ }
+ /** The stage of the AzureTrafficCollector 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