Skip to content

Commit c3f494c

Browse files
authored
[Automation] Generate Fluent Lite from Swagger devcenter#package-2024-02 (#43206)
1 parent 5221cbf commit c3f494c

File tree

345 files changed

+7435
-2570
lines changed

Some content is hidden

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

345 files changed

+7435
-2570
lines changed

sdk/devcenter/azure-resourcemanager-devcenter/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.0.0-beta.8 (Unreleased)
3+
## 1.0.0-beta.8 (2024-12-04)
44

5-
### Features Added
5+
- Azure Resource Manager DevCenter client library for Java. This package contains Microsoft Azure SDK for DevCenter Management SDK. DevCenter Management API. Package tag package-2024-02. 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-beta.7 (2024-04-23)
1421

sdk/devcenter/azure-resourcemanager-devcenter/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-devcenter</artifactId>
35-
<version>1.0.0-beta.7</version>
35+
<version>1.0.0-beta.8</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/devcenter/azure-resourcemanager-devcenter/SAMPLE.md

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

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
4747
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
4848
<revapi.skip>true</revapi.skip>
49+
<spotless.skip>false</spotless.skip>
4950
</properties>
5051
<dependencies>
5152
<dependency>

sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/DevCenterManager.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
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.HttpLoggingPolicy;
14+
import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
1515
import com.azure.core.http.policy.HttpLogOptions;
16+
import com.azure.core.http.policy.HttpLoggingPolicy;
1617
import com.azure.core.http.policy.HttpPipelinePolicy;
1718
import com.azure.core.http.policy.HttpPolicyProviders;
1819
import com.azure.core.http.policy.RequestIdPolicy;
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;
@@ -34,11 +34,11 @@
3434
import com.azure.resourcemanager.devcenter.implementation.EnvironmentDefinitionsImpl;
3535
import com.azure.resourcemanager.devcenter.implementation.EnvironmentTypesImpl;
3636
import com.azure.resourcemanager.devcenter.implementation.GalleriesImpl;
37-
import com.azure.resourcemanager.devcenter.implementation.ImagesImpl;
3837
import com.azure.resourcemanager.devcenter.implementation.ImageVersionsImpl;
38+
import com.azure.resourcemanager.devcenter.implementation.ImagesImpl;
3939
import com.azure.resourcemanager.devcenter.implementation.NetworkConnectionsImpl;
40-
import com.azure.resourcemanager.devcenter.implementation.OperationsImpl;
4140
import com.azure.resourcemanager.devcenter.implementation.OperationStatusesImpl;
41+
import com.azure.resourcemanager.devcenter.implementation.OperationsImpl;
4242
import com.azure.resourcemanager.devcenter.implementation.PoolsImpl;
4343
import com.azure.resourcemanager.devcenter.implementation.ProjectAllowedEnvironmentTypesImpl;
4444
import com.azure.resourcemanager.devcenter.implementation.ProjectCatalogEnvironmentDefinitionsImpl;
@@ -57,11 +57,11 @@
5757
import com.azure.resourcemanager.devcenter.models.EnvironmentDefinitions;
5858
import com.azure.resourcemanager.devcenter.models.EnvironmentTypes;
5959
import com.azure.resourcemanager.devcenter.models.Galleries;
60-
import com.azure.resourcemanager.devcenter.models.Images;
6160
import com.azure.resourcemanager.devcenter.models.ImageVersions;
61+
import com.azure.resourcemanager.devcenter.models.Images;
6262
import com.azure.resourcemanager.devcenter.models.NetworkConnections;
63-
import com.azure.resourcemanager.devcenter.models.Operations;
6463
import com.azure.resourcemanager.devcenter.models.OperationStatuses;
64+
import com.azure.resourcemanager.devcenter.models.Operations;
6565
import com.azure.resourcemanager.devcenter.models.Pools;
6666
import com.azure.resourcemanager.devcenter.models.ProjectAllowedEnvironmentTypes;
6767
import com.azure.resourcemanager.devcenter.models.ProjectCatalogEnvironmentDefinitions;
@@ -293,7 +293,7 @@ public DevCenterManager authenticate(TokenCredential credential, AzureProfile pr
293293
.append("-")
294294
.append("com.azure.resourcemanager.devcenter")
295295
.append("/")
296-
.append("1.0.0-beta.7");
296+
.append("1.0.0-beta.8");
297297
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
298298
userAgentBuilder.append(" (")
299299
.append(Configuration.getGlobalConfiguration().get("java.version"))
@@ -326,7 +326,7 @@ public DevCenterManager authenticate(TokenCredential credential, AzureProfile pr
326326
HttpPolicyProviders.addBeforeRetryPolicies(policies);
327327
policies.add(retryPolicy);
328328
policies.add(new AddDatePolicy());
329-
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
329+
policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0])));
330330
policies.addAll(this.policies.stream()
331331
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
332332
.collect(Collectors.toList()));

sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/AllowedEnvironmentTypeInner.java

Lines changed: 95 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
import com.azure.core.annotation.Immutable;
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.devcenter.models.ProvisioningState;
11-
import com.fasterxml.jackson.annotation.JsonProperty;
14+
import java.io.IOException;
1215

1316
/**
1417
* Represents an allowed environment type.
@@ -18,15 +21,28 @@ public final class AllowedEnvironmentTypeInner extends ProxyResource {
1821
/*
1922
* Properties of an allowed environment type.
2023
*/
21-
@JsonProperty(value = "properties")
2224
private AllowedEnvironmentTypeProperties innerProperties;
2325

2426
/*
2527
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
2628
*/
27-
@JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
2829
private SystemData systemData;
2930

31+
/*
32+
* The type of the resource.
33+
*/
34+
private String type;
35+
36+
/*
37+
* The name of the resource.
38+
*/
39+
private String name;
40+
41+
/*
42+
* Fully qualified resource Id for the resource.
43+
*/
44+
private String id;
45+
3046
/**
3147
* Creates an instance of AllowedEnvironmentTypeInner class.
3248
*/
@@ -51,6 +67,36 @@ public SystemData systemData() {
5167
return this.systemData;
5268
}
5369

70+
/**
71+
* Get the type property: The type of the resource.
72+
*
73+
* @return the type value.
74+
*/
75+
@Override
76+
public String type() {
77+
return this.type;
78+
}
79+
80+
/**
81+
* Get the name property: The name of the resource.
82+
*
83+
* @return the name value.
84+
*/
85+
@Override
86+
public String name() {
87+
return this.name;
88+
}
89+
90+
/**
91+
* Get the id property: Fully qualified resource Id for the resource.
92+
*
93+
* @return the id value.
94+
*/
95+
@Override
96+
public String id() {
97+
return this.id;
98+
}
99+
54100
/**
55101
* Get the provisioningState property: The provisioning state of the resource.
56102
*
@@ -79,4 +125,50 @@ public void validate() {
79125
innerProperties().validate();
80126
}
81127
}
128+
129+
/**
130+
* {@inheritDoc}
131+
*/
132+
@Override
133+
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
134+
jsonWriter.writeStartObject();
135+
jsonWriter.writeJsonField("properties", this.innerProperties);
136+
return jsonWriter.writeEndObject();
137+
}
138+
139+
/**
140+
* Reads an instance of AllowedEnvironmentTypeInner from the JsonReader.
141+
*
142+
* @param jsonReader The JsonReader being read.
143+
* @return An instance of AllowedEnvironmentTypeInner if the JsonReader was pointing to an instance of it, or null
144+
* if it was pointing to JSON null.
145+
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
146+
* @throws IOException If an error occurs while reading the AllowedEnvironmentTypeInner.
147+
*/
148+
public static AllowedEnvironmentTypeInner fromJson(JsonReader jsonReader) throws IOException {
149+
return jsonReader.readObject(reader -> {
150+
AllowedEnvironmentTypeInner deserializedAllowedEnvironmentTypeInner = new AllowedEnvironmentTypeInner();
151+
while (reader.nextToken() != JsonToken.END_OBJECT) {
152+
String fieldName = reader.getFieldName();
153+
reader.nextToken();
154+
155+
if ("id".equals(fieldName)) {
156+
deserializedAllowedEnvironmentTypeInner.id = reader.getString();
157+
} else if ("name".equals(fieldName)) {
158+
deserializedAllowedEnvironmentTypeInner.name = reader.getString();
159+
} else if ("type".equals(fieldName)) {
160+
deserializedAllowedEnvironmentTypeInner.type = reader.getString();
161+
} else if ("properties".equals(fieldName)) {
162+
deserializedAllowedEnvironmentTypeInner.innerProperties
163+
= AllowedEnvironmentTypeProperties.fromJson(reader);
164+
} else if ("systemData".equals(fieldName)) {
165+
deserializedAllowedEnvironmentTypeInner.systemData = SystemData.fromJson(reader);
166+
} else {
167+
reader.skipChildren();
168+
}
169+
}
170+
171+
return deserializedAllowedEnvironmentTypeInner;
172+
});
173+
}
82174
}

sdk/devcenter/azure-resourcemanager-devcenter/src/main/java/com/azure/resourcemanager/devcenter/fluent/models/AllowedEnvironmentTypeProperties.java

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,26 @@
55
package com.azure.resourcemanager.devcenter.fluent.models;
66

77
import com.azure.core.annotation.Immutable;
8+
import com.azure.json.JsonReader;
9+
import com.azure.json.JsonSerializable;
10+
import com.azure.json.JsonToken;
11+
import com.azure.json.JsonWriter;
812
import com.azure.resourcemanager.devcenter.models.ProvisioningState;
9-
import com.fasterxml.jackson.annotation.JsonProperty;
13+
import java.io.IOException;
1014

1115
/**
1216
* Properties of an allowed environment type.
1317
*/
1418
@Immutable
15-
public final class AllowedEnvironmentTypeProperties {
19+
public final class AllowedEnvironmentTypeProperties implements JsonSerializable<AllowedEnvironmentTypeProperties> {
1620
/*
1721
* The provisioning state of the resource.
1822
*/
19-
@JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
2023
private ProvisioningState provisioningState;
2124

2225
/*
2326
* The display name of the allowed environment type.
2427
*/
25-
@JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY)
2628
private String displayName;
2729

2830
/**
@@ -56,4 +58,43 @@ public String displayName() {
5658
*/
5759
public void validate() {
5860
}
61+
62+
/**
63+
* {@inheritDoc}
64+
*/
65+
@Override
66+
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
67+
jsonWriter.writeStartObject();
68+
return jsonWriter.writeEndObject();
69+
}
70+
71+
/**
72+
* Reads an instance of AllowedEnvironmentTypeProperties from the JsonReader.
73+
*
74+
* @param jsonReader The JsonReader being read.
75+
* @return An instance of AllowedEnvironmentTypeProperties if the JsonReader was pointing to an instance of it, or
76+
* null if it was pointing to JSON null.
77+
* @throws IOException If an error occurs while reading the AllowedEnvironmentTypeProperties.
78+
*/
79+
public static AllowedEnvironmentTypeProperties fromJson(JsonReader jsonReader) throws IOException {
80+
return jsonReader.readObject(reader -> {
81+
AllowedEnvironmentTypeProperties deserializedAllowedEnvironmentTypeProperties
82+
= new AllowedEnvironmentTypeProperties();
83+
while (reader.nextToken() != JsonToken.END_OBJECT) {
84+
String fieldName = reader.getFieldName();
85+
reader.nextToken();
86+
87+
if ("provisioningState".equals(fieldName)) {
88+
deserializedAllowedEnvironmentTypeProperties.provisioningState
89+
= ProvisioningState.fromString(reader.getString());
90+
} else if ("displayName".equals(fieldName)) {
91+
deserializedAllowedEnvironmentTypeProperties.displayName = reader.getString();
92+
} else {
93+
reader.skipChildren();
94+
}
95+
}
96+
97+
return deserializedAllowedEnvironmentTypeProperties;
98+
});
99+
}
59100
}

0 commit comments

Comments
 (0)