Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.0.0-beta.3 (Unreleased)
## 1.0.0-beta.1 (2022-10-31)

- Azure Resource Manager LoadTest client library for Java. This package contains Microsoft Azure SDK for LoadTest Management SDK. LoadTest client provides access to LoadTest Resource and it's status operations. Package tag package-2022-12-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

### Features Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-loadtestservice</artifactId>
<version>1.0.0-beta.2</version>
<version>1.0.0-beta.3</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,14 @@ public final class LoadTestsListOutboundNetworkDependenciesEndpointsSamples {
### LoadTests_Update

```java
import com.azure.core.management.serializer.SerializerFactory;
import com.azure.core.util.Context;
import com.azure.core.util.serializer.SerializerEncoding;
import com.azure.resourcemanager.loadtestservice.models.EncryptionProperties;
import com.azure.resourcemanager.loadtestservice.models.EncryptionPropertiesIdentity;
import com.azure.resourcemanager.loadtestservice.models.LoadTestResource;
import com.azure.resourcemanager.loadtestservice.models.ManagedServiceIdentity;
import com.azure.resourcemanager.loadtestservice.models.ManagedServiceIdentityType;
import com.azure.resourcemanager.loadtestservice.models.Type;
import com.azure.resourcemanager.loadtestservice.models.UserAssignedIdentity;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

Expand All @@ -217,16 +214,12 @@ public final class LoadTestsUpdateSamples {
*
* @param manager Entry point to LoadTestManager.
*/
public static void loadTestsUpdate(com.azure.resourcemanager.loadtestservice.LoadTestManager manager)
throws IOException {
public static void loadTestsUpdate(com.azure.resourcemanager.loadtestservice.LoadTestManager manager) {
LoadTestResource resource =
manager.loadTests().getByResourceGroupWithResponse("dummyrg", "myLoadTest", Context.NONE).getValue();
resource
.update()
.withTags(
SerializerFactory
.createDefaultManagementSerializerAdapter()
.deserialize("{\"Division\":\"LT\",\"Team\":\"Dev Exp\"}", Object.class, SerializerEncoding.JSON))
.withTags(mapOf("Division", "LT", "Team", "Dev Exp"))
.withIdentity(
new ManagedServiceIdentity()
.withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public LoadTestManager authenticate(TokenCredential credential, AzureProfile pro
.append("-")
.append("com.azure.resourcemanager.loadtestservice")
.append("/")
.append("1.0.0-beta.2");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,13 @@ public LoadTestResourceImpl withRegion(String location) {
}

public LoadTestResourceImpl withTags(Map<String, String> tags) {
this.innerModel().withTags(tags);
return this;
if (isInCreateMode()) {
this.innerModel().withTags(tags);
return this;
} else {
this.updateLoadTestResourcePatchRequestBody.withTags(tags);
return this;
}
}

public LoadTestResourceImpl withIdentity(ManagedServiceIdentity identity) {
Expand Down Expand Up @@ -222,11 +227,6 @@ public LoadTestResourceImpl withEncryption(EncryptionProperties encryption) {
}
}

public LoadTestResourceImpl withTags(Object tags) {
this.updateLoadTestResourcePatchRequestBody.withTags(tags);
return this;
}

private boolean isInCreateMode() {
return this.innerModel().id() == null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ interface WithTags {
* @param tags Resource tags.
* @return the next definition stage.
*/
Update withTags(Object tags);
Update withTags(Map<String, String> tags);
}
/** The stage of the LoadTestResource update allowing to specify identity. */
interface WithIdentity {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.loadtestservice.fluent.models.LoadTestResourcePatchRequestBodyProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** LoadTest resource patch request body. */
@Fluent
Expand All @@ -15,7 +17,8 @@ public final class LoadTestResourcePatchRequestBody {
* Resource tags.
*/
@JsonProperty(value = "tags")
private Object tags;
@JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
private Map<String, String> tags;

/*
* The type of identity used for the resource.
Expand All @@ -38,7 +41,7 @@ public LoadTestResourcePatchRequestBody() {
*
* @return the tags value.
*/
public Object tags() {
public Map<String, String> tags() {
return this.tags;
}

Expand All @@ -48,7 +51,7 @@ public Object tags() {
* @param tags the tags value to set.
* @return the LoadTestResourcePatchRequestBody object itself.
*/
public LoadTestResourcePatchRequestBody withTags(Object tags) {
public LoadTestResourcePatchRequestBody withTags(Map<String, String> tags) {
this.tags = tags;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@

package com.azure.resourcemanager.loadtestservice.generated;

import com.azure.core.management.serializer.SerializerFactory;
import com.azure.core.util.Context;
import com.azure.core.util.serializer.SerializerEncoding;
import com.azure.resourcemanager.loadtestservice.models.EncryptionProperties;
import com.azure.resourcemanager.loadtestservice.models.EncryptionPropertiesIdentity;
import com.azure.resourcemanager.loadtestservice.models.LoadTestResource;
import com.azure.resourcemanager.loadtestservice.models.ManagedServiceIdentity;
import com.azure.resourcemanager.loadtestservice.models.ManagedServiceIdentityType;
import com.azure.resourcemanager.loadtestservice.models.Type;
import com.azure.resourcemanager.loadtestservice.models.UserAssignedIdentity;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

Expand All @@ -28,16 +25,12 @@ public final class LoadTestsUpdateSamples {
*
* @param manager Entry point to LoadTestManager.
*/
public static void loadTestsUpdate(com.azure.resourcemanager.loadtestservice.LoadTestManager manager)
throws IOException {
public static void loadTestsUpdate(com.azure.resourcemanager.loadtestservice.LoadTestManager manager) {
LoadTestResource resource =
manager.loadTests().getByResourceGroupWithResponse("dummyrg", "myLoadTest", Context.NONE).getValue();
resource
.update()
.withTags(
SerializerFactory
.createDefaultManagementSerializerAdapter()
.deserialize("{\"Division\":\"LT\",\"Team\":\"Dev Exp\"}", Object.class, SerializerEncoding.JSON))
.withTags(mapOf("Division", "LT", "Team", "Dev Exp"))
.withIdentity(
new ManagedServiceIdentity()
.withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)
Expand Down