Skip to content

Commit 4da271b

Browse files
azure-sdkweidongxu-microsoftjoshelton1
authored
[AutoPR azure-resourcemanager-dashboard]-generated-from-SDK Generation - Java-5112177 (#46078)
* Configurations: 'specification/dashboard/Dashboard.Management/tspconfig.yaml', API Version: 2024-11-01-preview, SDK Release Type: beta, and CommitSHA: '737d276c61674f351c2d8ff06c69341ee0f7a598' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' * Update CHANGELOG.md * fix test * Update README.md --------- Co-authored-by: Weidong Xu <[email protected]> Co-authored-by: joshelton1 <[email protected]>
1 parent 9264857 commit 4da271b

File tree

54 files changed

+556
-375
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+556
-375
lines changed

sdk/dashboard/azure-resourcemanager-dashboard/CHANGELOG.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
# Release History
22

3-
## 1.2.0-beta.2 (Unreleased)
3+
## 1.2.0-beta.2 (2025-07-21)
44

5-
### Features Added
6-
7-
### Breaking Changes
5+
- Azure Resource Manager Dashboard client library for Java. This package contains Microsoft Azure SDK for Dashboard Management SDK. The Microsoft.Dashboard Rest API spec. Package api-version 2024-11-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
86

97
### Bugs Fixed
108

11-
### Other Changes
9+
- Fixed bug on update of `ManagedGrafana`.
1210

1311
## 1.2.0-beta.1 (2025-07-14)
1412

sdk/dashboard/azure-resourcemanager-dashboard/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Various documentation is available to help you get started
3232
<dependency>
3333
<groupId>com.azure.resourcemanager</groupId>
3434
<artifactId>azure-resourcemanager-dashboard</artifactId>
35-
<version>1.2.0-beta.1</version>
35+
<version>1.2.0-beta.2</version>
3636
</dependency>
3737
```
3838
[//]: # ({x-version-update-end})
@@ -73,8 +73,8 @@ See [API design][design] for general introduction on design and key concepts on
7373
```java
7474
grafana = dashboardManager.grafanas()
7575
.define(grafanaName)
76-
.withRegion(REGION)
7776
.withExistingResourceGroup(resourceGroupName)
77+
.withRegion(REGION)
7878
.withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED))
7979
.create();
8080
```

sdk/dashboard/azure-resourcemanager-dashboard/SAMPLE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,9 @@ public final class GrafanaCreateSamples {
117117
public static void grafanaCreate(com.azure.resourcemanager.dashboard.DashboardManager manager) {
118118
manager.grafanas()
119119
.define("myWorkspace")
120-
.withRegion("West US")
121120
.withExistingResourceGroup("myResourceGroup")
121+
.withRegion("West US")
122122
.withTags(mapOf("Environment", "Dev"))
123-
.withSku(new ResourceSku().withName("Standard"))
124123
.withProperties(new ManagedGrafanaProperties().withPublicNetworkAccess(PublicNetworkAccess.ENABLED)
125124
.withZoneRedundancy(ZoneRedundancy.ENABLED)
126125
.withApiKey(ApiKey.ENABLED)
@@ -145,6 +144,7 @@ public final class GrafanaCreateSamples {
145144
.withUnifiedAlertingScreenshots(new UnifiedAlertingScreenshots().withCaptureEnabled(false)))
146145
.withGrafanaPlugins(mapOf("sample-plugin-id", new GrafanaPlugin()))
147146
.withGrafanaMajorVersion("9"))
147+
.withSku(new ResourceSku().withName("Standard"))
148148
.withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED))
149149
.create();
150150
}

sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/GrafanasClient.java

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,21 @@ ManagedGrafanaInner create(String resourceGroupName, String workspaceName,
114114
ManagedGrafanaInner create(String resourceGroupName, String workspaceName,
115115
ManagedGrafanaInner requestBodyParameters, Context context);
116116

117+
/**
118+
* Update a workspace for Grafana resource.
119+
*
120+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
121+
* @param workspaceName The workspace name of Azure Managed Grafana.
122+
* @param requestBodyParameters The requestBodyParameters parameter.
123+
* @throws IllegalArgumentException thrown if parameters fail the validation.
124+
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
125+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
126+
* @return the {@link SyncPoller} for polling of the grafana resource type.
127+
*/
128+
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
129+
SyncPoller<PollResult<ManagedGrafanaInner>, ManagedGrafanaInner> beginUpdate(String resourceGroupName,
130+
String workspaceName, ManagedGrafanaUpdateParameters requestBodyParameters);
131+
117132
/**
118133
* Update a workspace for Grafana resource.
119134
*
@@ -124,11 +139,11 @@ ManagedGrafanaInner create(String resourceGroupName, String workspaceName,
124139
* @throws IllegalArgumentException thrown if parameters fail the validation.
125140
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
126141
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
127-
* @return the grafana resource type along with {@link Response}.
142+
* @return the {@link SyncPoller} for polling of the grafana resource type.
128143
*/
129-
@ServiceMethod(returns = ReturnType.SINGLE)
130-
Response<ManagedGrafanaInner> updateWithResponse(String resourceGroupName, String workspaceName,
131-
ManagedGrafanaUpdateParameters requestBodyParameters, Context context);
144+
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
145+
SyncPoller<PollResult<ManagedGrafanaInner>, ManagedGrafanaInner> beginUpdate(String resourceGroupName,
146+
String workspaceName, ManagedGrafanaUpdateParameters requestBodyParameters, Context context);
132147

133148
/**
134149
* Update a workspace for Grafana resource.
@@ -145,6 +160,22 @@ Response<ManagedGrafanaInner> updateWithResponse(String resourceGroupName, Strin
145160
ManagedGrafanaInner update(String resourceGroupName, String workspaceName,
146161
ManagedGrafanaUpdateParameters requestBodyParameters);
147162

163+
/**
164+
* Update a workspace for Grafana resource.
165+
*
166+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
167+
* @param workspaceName The workspace name of Azure Managed Grafana.
168+
* @param requestBodyParameters The requestBodyParameters parameter.
169+
* @param context The context to associate with this operation.
170+
* @throws IllegalArgumentException thrown if parameters fail the validation.
171+
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
172+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
173+
* @return the grafana resource type.
174+
*/
175+
@ServiceMethod(returns = ReturnType.SINGLE)
176+
ManagedGrafanaInner update(String resourceGroupName, String workspaceName,
177+
ManagedGrafanaUpdateParameters requestBodyParameters, Context context);
178+
148179
/**
149180
* Delete a workspace for Grafana resource.
150181
*

sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/ManagedGrafanaInner.java

Lines changed: 75 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
package com.azure.resourcemanager.dashboard.fluent.models;
66

77
import com.azure.core.annotation.Fluent;
8-
import com.azure.core.management.Resource;
8+
import com.azure.core.management.ProxyResource;
99
import com.azure.core.management.SystemData;
1010
import com.azure.json.JsonReader;
1111
import com.azure.json.JsonToken;
@@ -20,16 +20,26 @@
2020
* The grafana resource type.
2121
*/
2222
@Fluent
23-
public final class ManagedGrafanaInner extends Resource {
23+
public final class ManagedGrafanaInner extends ProxyResource {
24+
/*
25+
* Properties specific to the grafana resource.
26+
*/
27+
private ManagedGrafanaProperties properties;
28+
2429
/*
2530
* The Sku of the grafana resource.
2631
*/
2732
private ResourceSku sku;
2833

2934
/*
30-
* Properties specific to the grafana resource.
35+
* Resource tags.
3136
*/
32-
private ManagedGrafanaProperties properties;
37+
private Map<String, String> tags;
38+
39+
/*
40+
* The geo-location where the resource lives
41+
*/
42+
private String location;
3343

3444
/*
3545
* The managed service identities assigned to this resource.
@@ -62,6 +72,26 @@ public final class ManagedGrafanaInner extends Resource {
6272
public ManagedGrafanaInner() {
6373
}
6474

75+
/**
76+
* Get the properties property: Properties specific to the grafana resource.
77+
*
78+
* @return the properties value.
79+
*/
80+
public ManagedGrafanaProperties properties() {
81+
return this.properties;
82+
}
83+
84+
/**
85+
* Set the properties property: Properties specific to the grafana resource.
86+
*
87+
* @param properties the properties value to set.
88+
* @return the ManagedGrafanaInner object itself.
89+
*/
90+
public ManagedGrafanaInner withProperties(ManagedGrafanaProperties properties) {
91+
this.properties = properties;
92+
return this;
93+
}
94+
6595
/**
6696
* Get the sku property: The Sku of the grafana resource.
6797
*
@@ -83,22 +113,42 @@ public ManagedGrafanaInner withSku(ResourceSku sku) {
83113
}
84114

85115
/**
86-
* Get the properties property: Properties specific to the grafana resource.
116+
* Get the tags property: Resource tags.
87117
*
88-
* @return the properties value.
118+
* @return the tags value.
89119
*/
90-
public ManagedGrafanaProperties properties() {
91-
return this.properties;
120+
public Map<String, String> tags() {
121+
return this.tags;
92122
}
93123

94124
/**
95-
* Set the properties property: Properties specific to the grafana resource.
125+
* Set the tags property: Resource tags.
96126
*
97-
* @param properties the properties value to set.
127+
* @param tags the tags value to set.
98128
* @return the ManagedGrafanaInner object itself.
99129
*/
100-
public ManagedGrafanaInner withProperties(ManagedGrafanaProperties properties) {
101-
this.properties = properties;
130+
public ManagedGrafanaInner withTags(Map<String, String> tags) {
131+
this.tags = tags;
132+
return this;
133+
}
134+
135+
/**
136+
* Get the location property: The geo-location where the resource lives.
137+
*
138+
* @return the location value.
139+
*/
140+
public String location() {
141+
return this.location;
142+
}
143+
144+
/**
145+
* Set the location property: The geo-location where the resource lives.
146+
*
147+
* @param location the location value to set.
148+
* @return the ManagedGrafanaInner object itself.
149+
*/
150+
public ManagedGrafanaInner withLocation(String location) {
151+
this.location = location;
102152
return this;
103153
}
104154

@@ -161,36 +211,18 @@ public String id() {
161211
return this.id;
162212
}
163213

164-
/**
165-
* {@inheritDoc}
166-
*/
167-
@Override
168-
public ManagedGrafanaInner withLocation(String location) {
169-
super.withLocation(location);
170-
return this;
171-
}
172-
173-
/**
174-
* {@inheritDoc}
175-
*/
176-
@Override
177-
public ManagedGrafanaInner withTags(Map<String, String> tags) {
178-
super.withTags(tags);
179-
return this;
180-
}
181-
182214
/**
183215
* Validates the instance.
184216
*
185217
* @throws IllegalArgumentException thrown if the instance is not valid.
186218
*/
187219
public void validate() {
188-
if (sku() != null) {
189-
sku().validate();
190-
}
191220
if (properties() != null) {
192221
properties().validate();
193222
}
223+
if (sku() != null) {
224+
sku().validate();
225+
}
194226
if (identity() != null) {
195227
identity().validate();
196228
}
@@ -202,10 +234,10 @@ public void validate() {
202234
@Override
203235
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
204236
jsonWriter.writeStartObject();
205-
jsonWriter.writeStringField("location", location());
206-
jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
207-
jsonWriter.writeJsonField("sku", this.sku);
208237
jsonWriter.writeJsonField("properties", this.properties);
238+
jsonWriter.writeJsonField("sku", this.sku);
239+
jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element));
240+
jsonWriter.writeStringField("location", this.location);
209241
jsonWriter.writeJsonField("identity", this.identity);
210242
return jsonWriter.writeEndObject();
211243
}
@@ -232,15 +264,15 @@ public static ManagedGrafanaInner fromJson(JsonReader jsonReader) throws IOExcep
232264
deserializedManagedGrafanaInner.name = reader.getString();
233265
} else if ("type".equals(fieldName)) {
234266
deserializedManagedGrafanaInner.type = reader.getString();
235-
} else if ("location".equals(fieldName)) {
236-
deserializedManagedGrafanaInner.withLocation(reader.getString());
237-
} else if ("tags".equals(fieldName)) {
238-
Map<String, String> tags = reader.readMap(reader1 -> reader1.getString());
239-
deserializedManagedGrafanaInner.withTags(tags);
240-
} else if ("sku".equals(fieldName)) {
241-
deserializedManagedGrafanaInner.sku = ResourceSku.fromJson(reader);
242267
} else if ("properties".equals(fieldName)) {
243268
deserializedManagedGrafanaInner.properties = ManagedGrafanaProperties.fromJson(reader);
269+
} else if ("sku".equals(fieldName)) {
270+
deserializedManagedGrafanaInner.sku = ResourceSku.fromJson(reader);
271+
} else if ("tags".equals(fieldName)) {
272+
Map<String, String> tags = reader.readMap(reader1 -> reader1.getString());
273+
deserializedManagedGrafanaInner.tags = tags;
274+
} else if ("location".equals(fieldName)) {
275+
deserializedManagedGrafanaInner.location = reader.getString();
244276
} else if ("identity".equals(fieldName)) {
245277
deserializedManagedGrafanaInner.identity = ManagedServiceIdentity.fromJson(reader);
246278
} else if ("systemData".equals(fieldName)) {

0 commit comments

Comments
 (0)