Skip to content

Commit 6aec1a3

Browse files
privatedns: migrate azure-resourcemanager-privatedns from Swagger to TypeSpec (#48807)
1 parent 760a7ea commit 6aec1a3

58 files changed

Lines changed: 2803 additions & 1588 deletions

File tree

Some content is hidden

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

eng/lintingconfigs/revapi/track2/revapi.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,6 +1686,14 @@
16861686
"match": "method .* com\\.azure\\.resourcemanager\\.msi\\.models\\.OperationDisplay\\:\\:with.*\\(.*\\).*"
16871687
},
16881688
"justification": "Output-only immutable models' setters are removed if no explicit usage."
1689+
},
1690+
{
1691+
"code": "java.class.removed",
1692+
"old" : {
1693+
"matcher": "regex",
1694+
"match": "class com\\.azure\\.resourcemanager\\.privatedns\\.models\\.(PrivateZoneListResult|RecordSetListResult|VirtualNetworkLinkListResult)"
1695+
},
1696+
"justification": "Pageable models moved to implementation package. Unlikely used by user."
16891697
}
16901698
]
16911699
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ For documentation on how to use this package, please see [Azure Management Libra
1818
<dependency>
1919
<groupId>com.azure.resourcemanager</groupId>
2020
<artifactId>azure-resourcemanager-privatedns</artifactId>
21-
<version>2.53.1</version>
21+
<version>2.54.0-beta.1</version>
2222
</dependency>
2323
```
2424
[//]: # ({x-version-update-end})

sdk/privatedns/azure-resourcemanager-privatedns/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "java",
44
"TagPrefix": "java/privatedns/azure-resourcemanager-privatedns",
5-
"Tag": "java/privatedns/azure-resourcemanager-privatedns_10a66c0c1b"
5+
"Tag": "java/privatedns/azure-resourcemanager-privatedns_0b06b6a1db"
66
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
3-
// Code generated by Microsoft (R) AutoRest Code Generator.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
44

55
package com.azure.resourcemanager.privatedns.fluent;
66

@@ -12,27 +12,26 @@
1212
*/
1313
public interface PrivateDnsManagementClient {
1414
/**
15-
* Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID
16-
* forms part of the URI for every service call.
17-
*
18-
* @return the subscriptionId value.
19-
*/
20-
String getSubscriptionId();
21-
22-
/**
23-
* Gets server parameter.
15+
* Gets Service host.
2416
*
2517
* @return the endpoint value.
2618
*/
2719
String getEndpoint();
2820

2921
/**
30-
* Gets Api Version.
22+
* Gets Version parameter.
3123
*
3224
* @return the apiVersion value.
3325
*/
3426
String getApiVersion();
3527

28+
/**
29+
* Gets The ID of the target subscription. The value must be an UUID.
30+
*
31+
* @return the subscriptionId value.
32+
*/
33+
String getSubscriptionId();
34+
3635
/**
3736
* Gets The HTTP pipeline to send requests through.
3837
*
@@ -47,6 +46,13 @@ public interface PrivateDnsManagementClient {
4746
*/
4847
Duration getDefaultPollInterval();
4948

49+
/**
50+
* Gets the RecordSetsClient object to access its operations.
51+
*
52+
* @return the RecordSetsClient object.
53+
*/
54+
RecordSetsClient getRecordSets();
55+
5056
/**
5157
* Gets the PrivateZonesClient object to access its operations.
5258
*
@@ -60,11 +66,4 @@ public interface PrivateDnsManagementClient {
6066
* @return the VirtualNetworkLinksClient object.
6167
*/
6268
VirtualNetworkLinksClient getVirtualNetworkLinks();
63-
64-
/**
65-
* Gets the RecordSetsClient object to access its operations.
66-
*
67-
* @return the RecordSetsClient object.
68-
*/
69-
RecordSetsClient getRecordSets();
7069
}

sdk/privatedns/azure-resourcemanager-privatedns/src/main/java/com/azure/resourcemanager/privatedns/fluent/PrivateZonesClient.java

Lines changed: 114 additions & 114 deletions
Large diffs are not rendered by default.

sdk/privatedns/azure-resourcemanager-privatedns/src/main/java/com/azure/resourcemanager/privatedns/fluent/RecordSetsClient.java

Lines changed: 122 additions & 130 deletions
Large diffs are not rendered by default.

sdk/privatedns/azure-resourcemanager-privatedns/src/main/java/com/azure/resourcemanager/privatedns/fluent/VirtualNetworkLinksClient.java

Lines changed: 97 additions & 101 deletions
Large diffs are not rendered by default.

sdk/privatedns/azure-resourcemanager-privatedns/src/main/java/com/azure/resourcemanager/privatedns/fluent/models/PrivateZoneInner.java

Lines changed: 82 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
3-
// Code generated by Microsoft (R) AutoRest Code Generator.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
44

55
package com.azure.resourcemanager.privatedns.fluent.models;
66

77
import com.azure.core.annotation.Fluent;
88
import com.azure.core.management.Resource;
9-
import com.azure.core.util.logging.ClientLogger;
9+
import com.azure.core.management.SystemData;
1010
import com.azure.json.JsonReader;
1111
import com.azure.json.JsonToken;
1212
import com.azure.json.JsonWriter;
@@ -19,15 +19,30 @@
1919
*/
2020
@Fluent
2121
public final class PrivateZoneInner extends Resource {
22+
/*
23+
* Properties of the Private DNS zone.
24+
*/
25+
private PrivateZoneProperties innerProperties;
26+
27+
/*
28+
* Resource tags.
29+
*/
30+
private Map<String, String> tags;
31+
32+
/*
33+
* The Azure Region where the resource lives
34+
*/
35+
private String location;
36+
2237
/*
2338
* The ETag of the zone.
2439
*/
2540
private String etag;
2641

2742
/*
28-
* Properties of the Private DNS zone.
43+
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
2944
*/
30-
private PrivateZoneProperties innerProperties;
45+
private SystemData systemData;
3146

3247
/*
3348
* The type of the resource.
@@ -50,6 +65,55 @@ public final class PrivateZoneInner extends Resource {
5065
public PrivateZoneInner() {
5166
}
5267

68+
/**
69+
* Get the innerProperties property: Properties of the Private DNS zone.
70+
*
71+
* @return the innerProperties value.
72+
*/
73+
private PrivateZoneProperties innerProperties() {
74+
return this.innerProperties;
75+
}
76+
77+
/**
78+
* Get the tags property: Resource tags.
79+
*
80+
* @return the tags value.
81+
*/
82+
public Map<String, String> tags() {
83+
return this.tags;
84+
}
85+
86+
/**
87+
* Set the tags property: Resource tags.
88+
*
89+
* @param tags the tags value to set.
90+
* @return the PrivateZoneInner object itself.
91+
*/
92+
public PrivateZoneInner withTags(Map<String, String> tags) {
93+
this.tags = tags;
94+
return this;
95+
}
96+
97+
/**
98+
* Get the location property: The Azure Region where the resource lives.
99+
*
100+
* @return the location value.
101+
*/
102+
public String location() {
103+
return this.location;
104+
}
105+
106+
/**
107+
* Set the location property: The Azure Region where the resource lives.
108+
*
109+
* @param location the location value to set.
110+
* @return the PrivateZoneInner object itself.
111+
*/
112+
public PrivateZoneInner withLocation(String location) {
113+
this.location = location;
114+
return this;
115+
}
116+
53117
/**
54118
* Get the etag property: The ETag of the zone.
55119
*
@@ -71,12 +135,12 @@ public PrivateZoneInner withEtag(String etag) {
71135
}
72136

73137
/**
74-
* Get the innerProperties property: Properties of the Private DNS zone.
138+
* Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
75139
*
76-
* @return the innerProperties value.
140+
* @return the systemData value.
77141
*/
78-
private PrivateZoneProperties innerProperties() {
79-
return this.innerProperties;
142+
public SystemData systemData() {
143+
return this.systemData;
80144
}
81145

82146
/**
@@ -109,24 +173,6 @@ public String id() {
109173
return this.id;
110174
}
111175

112-
/**
113-
* {@inheritDoc}
114-
*/
115-
@Override
116-
public PrivateZoneInner withLocation(String location) {
117-
super.withLocation(location);
118-
return this;
119-
}
120-
121-
/**
122-
* {@inheritDoc}
123-
*/
124-
@Override
125-
public PrivateZoneInner withTags(Map<String, String> tags) {
126-
super.withTags(tags);
127-
return this;
128-
}
129-
130176
/**
131177
* Get the maxNumberOfRecordSets property: The maximum number of record sets that can be created in this Private DNS
132178
* zone. This is a read-only property and any attempt to set this value will be ignored.
@@ -221,24 +267,18 @@ public void validate() {
221267
if (innerProperties() != null) {
222268
innerProperties().validate();
223269
}
224-
if (location() == null) {
225-
throw LOGGER.atError()
226-
.log(new IllegalArgumentException("Missing required property location in model PrivateZoneInner"));
227-
}
228270
}
229271

230-
private static final ClientLogger LOGGER = new ClientLogger(PrivateZoneInner.class);
231-
232272
/**
233273
* {@inheritDoc}
234274
*/
235275
@Override
236276
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
237277
jsonWriter.writeStartObject();
238-
jsonWriter.writeStringField("location", location());
239-
jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
240-
jsonWriter.writeStringField("etag", this.etag);
241278
jsonWriter.writeJsonField("properties", this.innerProperties);
279+
jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element));
280+
jsonWriter.writeStringField("location", this.location);
281+
jsonWriter.writeStringField("etag", this.etag);
242282
return jsonWriter.writeEndObject();
243283
}
244284

@@ -264,15 +304,17 @@ public static PrivateZoneInner fromJson(JsonReader jsonReader) throws IOExceptio
264304
deserializedPrivateZoneInner.name = reader.getString();
265305
} else if ("type".equals(fieldName)) {
266306
deserializedPrivateZoneInner.type = reader.getString();
267-
} else if ("location".equals(fieldName)) {
268-
deserializedPrivateZoneInner.withLocation(reader.getString());
307+
} else if ("properties".equals(fieldName)) {
308+
deserializedPrivateZoneInner.innerProperties = PrivateZoneProperties.fromJson(reader);
269309
} else if ("tags".equals(fieldName)) {
270310
Map<String, String> tags = reader.readMap(reader1 -> reader1.getString());
271-
deserializedPrivateZoneInner.withTags(tags);
311+
deserializedPrivateZoneInner.tags = tags;
312+
} else if ("location".equals(fieldName)) {
313+
deserializedPrivateZoneInner.location = reader.getString();
272314
} else if ("etag".equals(fieldName)) {
273315
deserializedPrivateZoneInner.etag = reader.getString();
274-
} else if ("properties".equals(fieldName)) {
275-
deserializedPrivateZoneInner.innerProperties = PrivateZoneProperties.fromJson(reader);
316+
} else if ("systemData".equals(fieldName)) {
317+
deserializedPrivateZoneInner.systemData = SystemData.fromJson(reader);
276318
} else {
277319
reader.skipChildren();
278320
}

sdk/privatedns/azure-resourcemanager-privatedns/src/main/java/com/azure/resourcemanager/privatedns/fluent/models/PrivateZoneProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
3-
// Code generated by Microsoft (R) AutoRest Code Generator.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
44

55
package com.azure.resourcemanager.privatedns.fluent.models;
66

0 commit comments

Comments
 (0)