Skip to content

Commit f8cfc7d

Browse files
authored
[Automation] Generate Fluent Lite from Swagger hybridaks#package-2024-01 (#43384)
1 parent 16da6bd commit f8cfc7d

File tree

134 files changed

+4318
-1461
lines changed

Some content is hidden

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

134 files changed

+4318
-1461
lines changed

eng/versioning/version_client.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ com.azure.resourcemanager:azure-resourcemanager-nginx;1.0.0;1.1.0-beta.3
423423
com.azure.resourcemanager:azure-resourcemanager-agrifood;1.0.0-beta.2;1.0.0-beta.3
424424
com.azure.resourcemanager:azure-resourcemanager-devhub;1.0.0-beta.3;1.0.0-beta.4
425425
com.azure.resourcemanager:azure-resourcemanager-elasticsan;1.1.0;1.2.0-beta.2
426-
com.azure.resourcemanager:azure-resourcemanager-hybridcontainerservice;1.0.0;1.1.0-beta.1
426+
com.azure.resourcemanager:azure-resourcemanager-hybridcontainerservice;1.0.0;1.1.0
427427
com.azure.resourcemanager:azure-resourcemanager-securitydevops;1.0.0-beta.1;1.0.0-beta.2
428428
com.azure.resourcemanager:azure-resourcemanager-appcomplianceautomation;1.0.0;1.1.0-beta.1
429429
com.azure.resourcemanager:azure-resourcemanager-servicenetworking;1.0.0;1.1.0-beta.2

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

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

3-
## 1.1.0-beta.1 (Unreleased)
3+
## 1.1.0 (2024-12-13)
44

5-
### Features Added
5+
- Azure Resource Manager HybridContainerService client library for Java. This package contains Microsoft Azure SDK for HybridContainerService Management SDK. The Microsoft.HybridContainerService Rest API spec. Package tag package-2024-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
66

77
### Breaking Changes
88

9-
### Bugs Fixed
9+
#### Serialization/Deserialization change
10+
11+
- `Jackson` is removed from dependency and no longer supported.
12+
13+
##### Migration Guide
1014

11-
### Other Changes
15+
If you are using `Jackson`/`ObjectMapper` for manual serialization/deserialization, configure your `ObjectMapper` for backward compatibility:
16+
```java
17+
objectMapper.registerModule(com.azure.core.serializer.json.jackson.JacksonJsonProvider.getJsonSerializableDatabindModule());
18+
```
1219

1320
## 1.0.0 (2024-01-24)
1421

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

Lines changed: 5 additions & 8 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-hybridcontainerservice</artifactId>
35-
<version>1.0.0</version>
35+
<version>1.1.0</version>
3636
</dependency>
3737
```
3838
[//]: # ({x-version-update-end})
@@ -45,15 +45,11 @@ Azure Management Libraries require a `TokenCredential` implementation for authen
4545

4646
### Authentication
4747

48-
By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables.
48+
Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package.
4949

50-
- `AZURE_CLIENT_ID` for Azure client ID.
51-
- `AZURE_TENANT_ID` for Azure tenant ID.
52-
- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate.
50+
Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable.
5351

54-
In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable.
55-
56-
With above configuration, `azure` client can be authenticated using the following code:
52+
Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code:
5753

5854
```java
5955
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
@@ -97,6 +93,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
9793
[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/
9894
[azure_subscription]: https://azure.microsoft.com/free/
9995
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity
96+
[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials
10097
[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty
10198
[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md
10299
[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md

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

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

sdk/hybridcontainerservice/azure-resourcemanager-hybridcontainerservice/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<groupId>com.azure.resourcemanager</groupId>
1616
<artifactId>azure-resourcemanager-hybridcontainerservice</artifactId>
17-
<version>1.1.0-beta.1</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-hybridcontainerservice;current} -->
17+
<version>1.1.0</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-hybridcontainerservice;current} -->
1818
<packaging>jar</packaging>
1919

2020
<name>Microsoft Azure SDK for HybridContainerService Management</name>
@@ -45,6 +45,7 @@
4545
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4646
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
4747
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
48+
<spotless.skip>false</spotless.skip>
4849
</properties>
4950
<dependencies>
5051
<dependency>

sdk/hybridcontainerservice/azure-resourcemanager-hybridcontainerservice/src/main/java/com/azure/resourcemanager/hybridcontainerservice/HybridContainerServiceManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.azure.core.http.HttpPipelinePosition;
1212
import com.azure.core.http.policy.AddDatePolicy;
1313
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
14+
import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
1415
import com.azure.core.http.policy.HttpLogOptions;
1516
import com.azure.core.http.policy.HttpLoggingPolicy;
1617
import com.azure.core.http.policy.HttpPipelinePolicy;
@@ -19,7 +20,6 @@
1920
import com.azure.core.http.policy.RetryOptions;
2021
import com.azure.core.http.policy.RetryPolicy;
2122
import com.azure.core.http.policy.UserAgentPolicy;
22-
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
2323
import com.azure.core.management.profile.AzureProfile;
2424
import com.azure.core.util.Configuration;
2525
import com.azure.core.util.logging.ClientLogger;
@@ -235,7 +235,7 @@ public HybridContainerServiceManager authenticate(TokenCredential credential, Az
235235
.append("-")
236236
.append("com.azure.resourcemanager.hybridcontainerservice")
237237
.append("/")
238-
.append("1.0.0");
238+
.append("1.1.0");
239239
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
240240
userAgentBuilder.append(" (")
241241
.append(Configuration.getGlobalConfiguration().get("java.version"))
@@ -268,7 +268,7 @@ public HybridContainerServiceManager authenticate(TokenCredential credential, Az
268268
HttpPolicyProviders.addBeforeRetryPolicies(policies);
269269
policies.add(retryPolicy);
270270
policies.add(new AddDatePolicy());
271-
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
271+
policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0])));
272272
policies.addAll(this.policies.stream()
273273
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
274274
.collect(Collectors.toList()));

sdk/hybridcontainerservice/azure-resourcemanager-hybridcontainerservice/src/main/java/com/azure/resourcemanager/hybridcontainerservice/fluent/models/AgentPoolInner.java

Lines changed: 101 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
import com.azure.core.annotation.Fluent;
88
import com.azure.core.management.ProxyResource;
99
import com.azure.core.management.SystemData;
10+
import com.azure.json.JsonReader;
11+
import com.azure.json.JsonToken;
12+
import com.azure.json.JsonWriter;
1013
import com.azure.resourcemanager.hybridcontainerservice.models.AgentPoolProperties;
1114
import com.azure.resourcemanager.hybridcontainerservice.models.ExtendedLocation;
12-
import com.fasterxml.jackson.annotation.JsonInclude;
13-
import com.fasterxml.jackson.annotation.JsonProperty;
15+
import java.io.IOException;
1416
import java.util.Map;
1517

1618
/**
@@ -21,28 +23,38 @@ public final class AgentPoolInner extends ProxyResource {
2123
/*
2224
* Properties of the agent pool resource
2325
*/
24-
@JsonProperty(value = "properties")
2526
private AgentPoolProperties properties;
2627

2728
/*
2829
* Resource tags
2930
*/
30-
@JsonProperty(value = "tags")
31-
@JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
3231
private Map<String, String> tags;
3332

3433
/*
3534
* Extended location pointing to the underlying infrastructure
3635
*/
37-
@JsonProperty(value = "extendedLocation")
3836
private ExtendedLocation extendedLocation;
3937

4038
/*
4139
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
4240
*/
43-
@JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
4441
private SystemData systemData;
4542

43+
/*
44+
* The type of the resource.
45+
*/
46+
private String type;
47+
48+
/*
49+
* The name of the resource.
50+
*/
51+
private String name;
52+
53+
/*
54+
* Fully qualified resource Id for the resource.
55+
*/
56+
private String id;
57+
4658
/**
4759
* Creates an instance of AgentPoolInner class.
4860
*/
@@ -118,6 +130,36 @@ public SystemData systemData() {
118130
return this.systemData;
119131
}
120132

133+
/**
134+
* Get the type property: The type of the resource.
135+
*
136+
* @return the type value.
137+
*/
138+
@Override
139+
public String type() {
140+
return this.type;
141+
}
142+
143+
/**
144+
* Get the name property: The name of the resource.
145+
*
146+
* @return the name value.
147+
*/
148+
@Override
149+
public String name() {
150+
return this.name;
151+
}
152+
153+
/**
154+
* Get the id property: Fully qualified resource Id for the resource.
155+
*
156+
* @return the id value.
157+
*/
158+
@Override
159+
public String id() {
160+
return this.id;
161+
}
162+
121163
/**
122164
* Validates the instance.
123165
*
@@ -131,4 +173,56 @@ public void validate() {
131173
extendedLocation().validate();
132174
}
133175
}
176+
177+
/**
178+
* {@inheritDoc}
179+
*/
180+
@Override
181+
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
182+
jsonWriter.writeStartObject();
183+
jsonWriter.writeJsonField("properties", this.properties);
184+
jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element));
185+
jsonWriter.writeJsonField("extendedLocation", this.extendedLocation);
186+
return jsonWriter.writeEndObject();
187+
}
188+
189+
/**
190+
* Reads an instance of AgentPoolInner from the JsonReader.
191+
*
192+
* @param jsonReader The JsonReader being read.
193+
* @return An instance of AgentPoolInner if the JsonReader was pointing to an instance of it, or null if it was
194+
* pointing to JSON null.
195+
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
196+
* @throws IOException If an error occurs while reading the AgentPoolInner.
197+
*/
198+
public static AgentPoolInner fromJson(JsonReader jsonReader) throws IOException {
199+
return jsonReader.readObject(reader -> {
200+
AgentPoolInner deserializedAgentPoolInner = new AgentPoolInner();
201+
while (reader.nextToken() != JsonToken.END_OBJECT) {
202+
String fieldName = reader.getFieldName();
203+
reader.nextToken();
204+
205+
if ("id".equals(fieldName)) {
206+
deserializedAgentPoolInner.id = reader.getString();
207+
} else if ("name".equals(fieldName)) {
208+
deserializedAgentPoolInner.name = reader.getString();
209+
} else if ("type".equals(fieldName)) {
210+
deserializedAgentPoolInner.type = reader.getString();
211+
} else if ("properties".equals(fieldName)) {
212+
deserializedAgentPoolInner.properties = AgentPoolProperties.fromJson(reader);
213+
} else if ("tags".equals(fieldName)) {
214+
Map<String, String> tags = reader.readMap(reader1 -> reader1.getString());
215+
deserializedAgentPoolInner.tags = tags;
216+
} else if ("extendedLocation".equals(fieldName)) {
217+
deserializedAgentPoolInner.extendedLocation = ExtendedLocation.fromJson(reader);
218+
} else if ("systemData".equals(fieldName)) {
219+
deserializedAgentPoolInner.systemData = SystemData.fromJson(reader);
220+
} else {
221+
reader.skipChildren();
222+
}
223+
}
224+
225+
return deserializedAgentPoolInner;
226+
});
227+
}
134228
}

0 commit comments

Comments
 (0)