diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/CHANGELOG.md b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/CHANGELOG.md
index af0bc1bb31fb..18d39d8f6d3e 100644
--- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/CHANGELOG.md
+++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/CHANGELOG.md
@@ -1,6 +1,8 @@
# Release History
-## 1.0.0-beta.3 (Unreleased)
+## 1.0.0-beta.1 (2022-06-14)
+
+- Azure Resource Manager MobileNetwork client library for Java. This package contains Microsoft Azure SDK for MobileNetwork Management SDK. The resources in this swagger specification will be used to manage attached data network resources in mobile network attached to a particular packet core instance. Package tag package-2022-03-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
### Features Added
diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/README.md b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/README.md
index d321fa15b25f..caa5be4bb9bc 100644
--- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/README.md
+++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/README.md
@@ -32,7 +32,7 @@ Various documentation is available to help you get started
com.azure.resourcemanagerazure-resourcemanager-mobilenetwork
- 1.0.0-beta.2
+ 1.0.0-beta.3
```
[//]: # ({x-version-update-end})
diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/MobileNetworkManager.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/MobileNetworkManager.java
index 435ab6bee488..82b7301dc5b7 100644
--- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/MobileNetworkManager.java
+++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/MobileNetworkManager.java
@@ -10,11 +10,13 @@
import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
+import com.azure.core.http.policy.AddHeadersFromContextPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.core.http.policy.HttpPolicyProviders;
import com.azure.core.http.policy.RequestIdPolicy;
+import com.azure.core.http.policy.RetryOptions;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
@@ -106,6 +108,19 @@ public static MobileNetworkManager authenticate(TokenCredential credential, Azur
return configure().authenticate(credential, profile);
}
+ /**
+ * Creates an instance of MobileNetwork service API entry point.
+ *
+ * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
+ * @param profile the Azure profile for client.
+ * @return the MobileNetwork service API instance.
+ */
+ public static MobileNetworkManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) {
+ Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+ return new MobileNetworkManager(httpPipeline, profile, null);
+ }
+
/**
* Gets a Configurable instance that can be used to create MobileNetworkManager with optional configuration.
*
@@ -124,6 +139,7 @@ public static final class Configurable {
private final List policies = new ArrayList<>();
private final List scopes = new ArrayList<>();
private RetryPolicy retryPolicy;
+ private RetryOptions retryOptions;
private Duration defaultPollInterval;
private Configurable() {
@@ -184,6 +200,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
return this;
}
+ /**
+ * Sets the retry options for the HTTP pipeline retry policy.
+ *
+ *
This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
+ *
+ * @param retryOptions the retry options for the HTTP pipeline retry policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withRetryOptions(RetryOptions retryOptions) {
+ this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
+ return this;
+ }
+
/**
* Sets the default poll interval, used when service does not provide "Retry-After" header.
*
@@ -217,7 +246,7 @@ public MobileNetworkManager authenticate(TokenCredential credential, AzureProfil
.append("-")
.append("com.azure.resourcemanager.mobilenetwork")
.append("/")
- .append("1.0.0-beta.2");
+ .append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
@@ -235,10 +264,15 @@ public MobileNetworkManager authenticate(TokenCredential credential, AzureProfil
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
}
if (retryPolicy == null) {
- retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
+ if (retryOptions != null) {
+ retryPolicy = new RetryPolicy(retryOptions);
+ } else {
+ retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
+ }
}
List policies = new ArrayList<>();
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
+ policies.add(new AddHeadersFromContextPolicy());
policies.add(new RequestIdPolicy());
policies
.addAll(
@@ -269,7 +303,11 @@ public MobileNetworkManager authenticate(TokenCredential credential, AzureProfil
}
}
- /** @return Resource collection API of AttachedDataNetworks. */
+ /**
+ * Gets the resource collection API of AttachedDataNetworks. It manages AttachedDataNetwork.
+ *
+ * @return Resource collection API of AttachedDataNetworks.
+ */
public AttachedDataNetworks attachedDataNetworks() {
if (this.attachedDataNetworks == null) {
this.attachedDataNetworks = new AttachedDataNetworksImpl(clientObject.getAttachedDataNetworks(), this);
@@ -277,7 +315,11 @@ public AttachedDataNetworks attachedDataNetworks() {
return attachedDataNetworks;
}
- /** @return Resource collection API of DataNetworks. */
+ /**
+ * Gets the resource collection API of DataNetworks. It manages DataNetwork.
+ *
+ * @return Resource collection API of DataNetworks.
+ */
public DataNetworks dataNetworks() {
if (this.dataNetworks == null) {
this.dataNetworks = new DataNetworksImpl(clientObject.getDataNetworks(), this);
@@ -285,7 +327,11 @@ public DataNetworks dataNetworks() {
return dataNetworks;
}
- /** @return Resource collection API of MobileNetworks. */
+ /**
+ * Gets the resource collection API of MobileNetworks. It manages MobileNetwork.
+ *
+ * @return Resource collection API of MobileNetworks.
+ */
public MobileNetworks mobileNetworks() {
if (this.mobileNetworks == null) {
this.mobileNetworks = new MobileNetworksImpl(clientObject.getMobileNetworks(), this);
@@ -293,7 +339,11 @@ public MobileNetworks mobileNetworks() {
return mobileNetworks;
}
- /** @return Resource collection API of Sites. */
+ /**
+ * Gets the resource collection API of Sites. It manages Site.
+ *
+ * @return Resource collection API of Sites.
+ */
public Sites sites() {
if (this.sites == null) {
this.sites = new SitesImpl(clientObject.getSites(), this);
@@ -301,7 +351,11 @@ public Sites sites() {
return sites;
}
- /** @return Resource collection API of Sims. */
+ /**
+ * Gets the resource collection API of Sims. It manages Sim.
+ *
+ * @return Resource collection API of Sims.
+ */
public Sims sims() {
if (this.sims == null) {
this.sims = new SimsImpl(clientObject.getSims(), this);
@@ -309,7 +363,11 @@ public Sims sims() {
return sims;
}
- /** @return Resource collection API of Operations. */
+ /**
+ * Gets the resource collection API of Operations.
+ *
+ * @return Resource collection API of Operations.
+ */
public Operations operations() {
if (this.operations == null) {
this.operations = new OperationsImpl(clientObject.getOperations(), this);
@@ -317,7 +375,11 @@ public Operations operations() {
return operations;
}
- /** @return Resource collection API of PacketCoreControlPlanes. */
+ /**
+ * Gets the resource collection API of PacketCoreControlPlanes. It manages PacketCoreControlPlane.
+ *
+ * @return Resource collection API of PacketCoreControlPlanes.
+ */
public PacketCoreControlPlanes packetCoreControlPlanes() {
if (this.packetCoreControlPlanes == null) {
this.packetCoreControlPlanes =
@@ -326,7 +388,11 @@ public PacketCoreControlPlanes packetCoreControlPlanes() {
return packetCoreControlPlanes;
}
- /** @return Resource collection API of PacketCoreDataPlanes. */
+ /**
+ * Gets the resource collection API of PacketCoreDataPlanes. It manages PacketCoreDataPlane.
+ *
+ * @return Resource collection API of PacketCoreDataPlanes.
+ */
public PacketCoreDataPlanes packetCoreDataPlanes() {
if (this.packetCoreDataPlanes == null) {
this.packetCoreDataPlanes = new PacketCoreDataPlanesImpl(clientObject.getPacketCoreDataPlanes(), this);
@@ -334,7 +400,11 @@ public PacketCoreDataPlanes packetCoreDataPlanes() {
return packetCoreDataPlanes;
}
- /** @return Resource collection API of Services. */
+ /**
+ * Gets the resource collection API of Services. It manages Service.
+ *
+ * @return Resource collection API of Services.
+ */
public Services services() {
if (this.services == null) {
this.services = new ServicesImpl(clientObject.getServices(), this);
@@ -342,7 +412,11 @@ public Services services() {
return services;
}
- /** @return Resource collection API of SimPolicies. */
+ /**
+ * Gets the resource collection API of SimPolicies. It manages SimPolicy.
+ *
+ * @return Resource collection API of SimPolicies.
+ */
public SimPolicies simPolicies() {
if (this.simPolicies == null) {
this.simPolicies = new SimPoliciesImpl(clientObject.getSimPolicies(), this);
@@ -350,7 +424,11 @@ public SimPolicies simPolicies() {
return simPolicies;
}
- /** @return Resource collection API of Slices. */
+ /**
+ * Gets the resource collection API of Slices. It manages Slice.
+ *
+ * @return Resource collection API of Slices.
+ */
public Slices slices() {
if (this.slices == null) {
this.slices = new SlicesImpl(clientObject.getSlices(), this);
diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/AttachedDataNetworkImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/AttachedDataNetworkImpl.java
index b84c5a055d5b..f36f163f09d9 100644
--- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/AttachedDataNetworkImpl.java
+++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/AttachedDataNetworkImpl.java
@@ -85,6 +85,10 @@ public String regionName() {
return this.location();
}
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
public AttachedDataNetworkInner innerModel() {
return this.innerObject;
}
diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/AttachedDataNetworksClientImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/AttachedDataNetworksClientImpl.java
index 6f092a1a871b..3334cfa6bb03 100644
--- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/AttachedDataNetworksClientImpl.java
+++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/AttachedDataNetworksClientImpl.java
@@ -676,14 +676,7 @@ private Mono getAsync(
String attachedDataNetworkName) {
return getWithResponseAsync(
resourceGroupName, packetCoreControlPlaneName, packetCoreDataPlaneName, attachedDataNetworkName)
- .flatMap(
- (Response res) -> {
- if (res.getValue() != null) {
- return Mono.just(res.getValue());
- } else {
- return Mono.empty();
- }
- });
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
@@ -1328,14 +1321,7 @@ private Mono updateTagsAsync(
packetCoreDataPlaneName,
attachedDataNetworkName,
parameters)
- .flatMap(
- (Response res) -> {
- if (res.getValue() != null) {
- return Mono.just(res.getValue());
- } else {
- return Mono.empty();
- }
- });
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/DataNetworkImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/DataNetworkImpl.java
index dff4f5f80d2b..74f931a56923 100644
--- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/DataNetworkImpl.java
+++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/DataNetworkImpl.java
@@ -64,6 +64,10 @@ public String regionName() {
return this.location();
}
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
public DataNetworkInner innerModel() {
return this.innerObject;
}
diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/DataNetworksClientImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/DataNetworksClientImpl.java
index d00d8ccc15c0..b2eebf074fa2 100644
--- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/DataNetworksClientImpl.java
+++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/DataNetworksClientImpl.java
@@ -540,14 +540,7 @@ private Mono> getWithResponseAsync(
private Mono getAsync(
String resourceGroupName, String mobileNetworkName, String dataNetworkName) {
return getWithResponseAsync(resourceGroupName, mobileNetworkName, dataNetworkName)
- .flatMap(
- (Response res) -> {
- if (res.getValue() != null) {
- return Mono.just(res.getValue());
- } else {
- return Mono.empty();
- }
- });
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
@@ -1037,14 +1030,7 @@ private Mono> updateTagsWithResponseAsync(
private Mono updateTagsAsync(
String resourceGroupName, String mobileNetworkName, String dataNetworkName, TagsObject parameters) {
return updateTagsWithResponseAsync(resourceGroupName, mobileNetworkName, dataNetworkName, parameters)
- .flatMap(
- (Response res) -> {
- if (res.getValue() != null) {
- return Mono.just(res.getValue());
- } else {
- return Mono.empty();
- }
- });
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworkImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworkImpl.java
index 3c61cc52b828..972783a47148 100644
--- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworkImpl.java
+++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworkImpl.java
@@ -70,6 +70,10 @@ public String regionName() {
return this.location();
}
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
public MobileNetworkInner innerModel() {
return this.innerObject;
}
diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworkManagementClientBuilder.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworkManagementClientBuilder.java
index 18f4656d5545..7425038f5243 100644
--- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworkManagementClientBuilder.java
+++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworkManagementClientBuilder.java
@@ -7,7 +7,6 @@
import com.azure.core.annotation.ServiceClientBuilder;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpPipelineBuilder;
-import com.azure.core.http.policy.CookiePolicy;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.AzureEnvironment;
@@ -67,34 +66,34 @@ public MobileNetworkManagementClientBuilder environment(AzureEnvironment environ
}
/*
- * The default poll interval for long-running operation
+ * The HTTP pipeline to send requests through
*/
- private Duration defaultPollInterval;
+ private HttpPipeline pipeline;
/**
- * Sets The default poll interval for long-running operation.
+ * Sets The HTTP pipeline to send requests through.
*
- * @param defaultPollInterval the defaultPollInterval value.
+ * @param pipeline the pipeline value.
* @return the MobileNetworkManagementClientBuilder.
*/
- public MobileNetworkManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) {
- this.defaultPollInterval = defaultPollInterval;
+ public MobileNetworkManagementClientBuilder pipeline(HttpPipeline pipeline) {
+ this.pipeline = pipeline;
return this;
}
/*
- * The HTTP pipeline to send requests through
+ * The default poll interval for long-running operation
*/
- private HttpPipeline pipeline;
+ private Duration defaultPollInterval;
/**
- * Sets The HTTP pipeline to send requests through.
+ * Sets The default poll interval for long-running operation.
*
- * @param pipeline the pipeline value.
+ * @param defaultPollInterval the defaultPollInterval value.
* @return the MobileNetworkManagementClientBuilder.
*/
- public MobileNetworkManagementClientBuilder pipeline(HttpPipeline pipeline) {
- this.pipeline = pipeline;
+ public MobileNetworkManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval = defaultPollInterval;
return this;
}
@@ -126,15 +125,12 @@ public MobileNetworkManagementClientImpl buildClient() {
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 (pipeline == null) {
- this.pipeline =
- new HttpPipelineBuilder()
- .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy())
- .build();
- }
if (serializerAdapter == null) {
this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter();
}
diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworkManagementClientImpl.java b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworkManagementClientImpl.java
index 4092b8cf8aa7..8d6ef0bf2b75 100644
--- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworkManagementClientImpl.java
+++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/src/main/java/com/azure/resourcemanager/mobilenetwork/implementation/MobileNetworkManagementClientImpl.java
@@ -15,6 +15,7 @@
import com.azure.core.management.polling.PollResult;
import com.azure.core.management.polling.PollerFactory;
import com.azure.core.util.Context;
+import com.azure.core.util.CoreUtils;
import com.azure.core.util.logging.ClientLogger;
import com.azure.core.util.polling.AsyncPollResponse;
import com.azure.core.util.polling.LongRunningOperationStatus;
@@ -39,7 +40,6 @@
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
-import java.util.Map;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
@@ -302,10 +302,7 @@ public Context getContext() {
* @return the merged context.
*/
public Context mergeContext(Context context) {
- for (Map.Entry