Skip to content

Commit

Permalink
[Automation] Generate Fluent Lite from Swagger confluent#package-2024…
Browse files Browse the repository at this point in the history
…-02 (#43466)
  • Loading branch information
azure-sdk authored Dec 19, 2024
1 parent 171e418 commit d247f8d
Show file tree
Hide file tree
Showing 124 changed files with 3,807 additions and 1,458 deletions.
2 changes: 1 addition & 1 deletion eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ com.azure.resourcemanager:azure-resourcemanager-kusto;1.1.0;1.2.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-loganalytics;1.1.0;1.2.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-eventgrid;1.1.0;1.2.0-beta.8
com.azure.resourcemanager:azure-resourcemanager-healthbot;1.0.0-beta.3;1.0.0-beta.4
com.azure.resourcemanager:azure-resourcemanager-confluent;1.1.0;1.2.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-confluent;1.1.0;1.2.0
com.azure.resourcemanager:azure-resourcemanager-digitaltwins;1.3.0;1.4.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-netapp;1.5.1;1.6.0-beta.2
com.azure.resourcemanager:azure-resourcemanager-storagecache;1.0.0-beta.12;1.0.0-beta.13
Expand Down
15 changes: 11 additions & 4 deletions sdk/confluent/azure-resourcemanager-confluent/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
# Release History

## 1.2.0-beta.1 (Unreleased)
## 1.2.0 (2024-12-19)

### Features Added
- Azure Resource Manager Confluent client library for Java. This package contains Microsoft Azure SDK for Confluent Management SDK. 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).

### Breaking Changes

### Bugs Fixed
#### Serialization/Deserialization change

- `Jackson` is removed from dependency and no longer supported.

##### Migration Guide

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

## 1.1.0 (2024-03-21)

Expand Down
13 changes: 5 additions & 8 deletions sdk/confluent/azure-resourcemanager-confluent/README.md
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-confluent</artifactId>
<version>1.1.0</version>
<version>1.2.0</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand All @@ -45,15 +45,11 @@ Azure Management Libraries require a `TokenCredential` implementation for authen

### Authentication

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

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

In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable.

With above configuration, `azure` client can be authenticated using the following code:
Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code:

```java
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
Expand Down Expand Up @@ -97,6 +93,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/
[azure_subscription]: https://azure.microsoft.com/free/
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity
[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials
[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty
[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md
[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md
Expand Down
188 changes: 114 additions & 74 deletions sdk/confluent/azure-resourcemanager-confluent/SAMPLE.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion sdk/confluent/azure-resourcemanager-confluent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-confluent</artifactId>
<version>1.2.0-beta.1</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-confluent;current} -->
<version>1.2.0</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-confluent;current} -->
<packaging>jar</packaging>

<name>Microsoft Azure SDK for Confluent Management</name>
Expand Down Expand Up @@ -45,6 +45,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
<spotless.skip>false</spotless.skip>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
Expand All @@ -19,7 +20,6 @@
import com.azure.core.http.policy.RetryOptions;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
import com.azure.core.management.profile.AzureProfile;
import com.azure.core.util.Configuration;
import com.azure.core.util.logging.ClientLogger;
Expand Down Expand Up @@ -220,7 +220,7 @@ public ConfluentManager authenticate(TokenCredential credential, AzureProfile pr
.append("-")
.append("com.azure.resourcemanager.confluent")
.append("/")
.append("1.1.0");
.append("1.2.0");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder.append(" (")
.append(Configuration.getGlobalConfiguration().get("java.version"))
Expand Down Expand Up @@ -253,7 +253,7 @@ public ConfluentManager authenticate(TokenCredential credential, AzureProfile pr
HttpPolicyProviders.addBeforeRetryPolicies(policies);
policies.add(retryPolicy);
policies.add(new AddDatePolicy());
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0])));
policies.addAll(this.policies.stream()
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
.collect(Collectors.toList()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,34 @@
package com.azure.resourcemanager.confluent.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.confluent.models.ClusterRecord;
import com.azure.resourcemanager.confluent.models.ConfluentListMetadata;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.IOException;
import java.util.List;

/**
* Details of the clusters returned on successful response.
*/
@Fluent
public final class AccessListClusterSuccessResponseInner {
public final class AccessListClusterSuccessResponseInner
implements JsonSerializable<AccessListClusterSuccessResponseInner> {
/*
* Type of response
*/
@JsonProperty(value = "kind")
private String kind;

/*
* Metadata of the list
*/
@JsonProperty(value = "metadata")
private ConfluentListMetadata metadata;

/*
* List of clusters
*/
@JsonProperty(value = "data")
private List<ClusterRecord> data;

/**
Expand Down Expand Up @@ -112,4 +114,48 @@ public void validate() {
data().forEach(e -> e.validate());
}
}

/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("kind", this.kind);
jsonWriter.writeJsonField("metadata", this.metadata);
jsonWriter.writeArrayField("data", this.data, (writer, element) -> writer.writeJson(element));
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of AccessListClusterSuccessResponseInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AccessListClusterSuccessResponseInner if the JsonReader was pointing to an instance of it,
* or null if it was pointing to JSON null.
* @throws IOException If an error occurs while reading the AccessListClusterSuccessResponseInner.
*/
public static AccessListClusterSuccessResponseInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
AccessListClusterSuccessResponseInner deserializedAccessListClusterSuccessResponseInner
= new AccessListClusterSuccessResponseInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();

if ("kind".equals(fieldName)) {
deserializedAccessListClusterSuccessResponseInner.kind = reader.getString();
} else if ("metadata".equals(fieldName)) {
deserializedAccessListClusterSuccessResponseInner.metadata = ConfluentListMetadata.fromJson(reader);
} else if ("data".equals(fieldName)) {
List<ClusterRecord> data = reader.readArray(reader1 -> ClusterRecord.fromJson(reader1));
deserializedAccessListClusterSuccessResponseInner.data = data;
} else {
reader.skipChildren();
}
}

return deserializedAccessListClusterSuccessResponseInner;
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,34 @@
package com.azure.resourcemanager.confluent.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.confluent.models.ConfluentListMetadata;
import com.azure.resourcemanager.confluent.models.EnvironmentRecord;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.IOException;
import java.util.List;

/**
* Details of the environments returned on successful response.
*/
@Fluent
public final class AccessListEnvironmentsSuccessResponseInner {
public final class AccessListEnvironmentsSuccessResponseInner
implements JsonSerializable<AccessListEnvironmentsSuccessResponseInner> {
/*
* Type of response
*/
@JsonProperty(value = "kind")
private String kind;

/*
* Metadata of the environment list
*/
@JsonProperty(value = "metadata")
private ConfluentListMetadata metadata;

/*
* Environment list data
*/
@JsonProperty(value = "data")
private List<EnvironmentRecord> data;

/**
Expand Down Expand Up @@ -112,4 +114,49 @@ public void validate() {
data().forEach(e -> e.validate());
}
}

/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("kind", this.kind);
jsonWriter.writeJsonField("metadata", this.metadata);
jsonWriter.writeArrayField("data", this.data, (writer, element) -> writer.writeJson(element));
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of AccessListEnvironmentsSuccessResponseInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AccessListEnvironmentsSuccessResponseInner if the JsonReader was pointing to an instance
* of it, or null if it was pointing to JSON null.
* @throws IOException If an error occurs while reading the AccessListEnvironmentsSuccessResponseInner.
*/
public static AccessListEnvironmentsSuccessResponseInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
AccessListEnvironmentsSuccessResponseInner deserializedAccessListEnvironmentsSuccessResponseInner
= new AccessListEnvironmentsSuccessResponseInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();

if ("kind".equals(fieldName)) {
deserializedAccessListEnvironmentsSuccessResponseInner.kind = reader.getString();
} else if ("metadata".equals(fieldName)) {
deserializedAccessListEnvironmentsSuccessResponseInner.metadata
= ConfluentListMetadata.fromJson(reader);
} else if ("data".equals(fieldName)) {
List<EnvironmentRecord> data = reader.readArray(reader1 -> EnvironmentRecord.fromJson(reader1));
deserializedAccessListEnvironmentsSuccessResponseInner.data = data;
} else {
reader.skipChildren();
}
}

return deserializedAccessListEnvironmentsSuccessResponseInner;
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,33 @@
package com.azure.resourcemanager.confluent.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.confluent.models.ConfluentListMetadata;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.IOException;
import java.util.List;

/**
* List invitations success response.
*/
@Fluent
public final class AccessListInvitationsSuccessResponseInner {
public final class AccessListInvitationsSuccessResponseInner
implements JsonSerializable<AccessListInvitationsSuccessResponseInner> {
/*
* Type of response
*/
@JsonProperty(value = "kind")
private String kind;

/*
* Metadata of the list
*/
@JsonProperty(value = "metadata")
private ConfluentListMetadata metadata;

/*
* Data of the invitations list
*/
@JsonProperty(value = "data")
private List<InvitationRecordInner> data;

/**
Expand Down Expand Up @@ -111,4 +113,50 @@ public void validate() {
data().forEach(e -> e.validate());
}
}

/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("kind", this.kind);
jsonWriter.writeJsonField("metadata", this.metadata);
jsonWriter.writeArrayField("data", this.data, (writer, element) -> writer.writeJson(element));
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of AccessListInvitationsSuccessResponseInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AccessListInvitationsSuccessResponseInner if the JsonReader was pointing to an instance of
* it, or null if it was pointing to JSON null.
* @throws IOException If an error occurs while reading the AccessListInvitationsSuccessResponseInner.
*/
public static AccessListInvitationsSuccessResponseInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
AccessListInvitationsSuccessResponseInner deserializedAccessListInvitationsSuccessResponseInner
= new AccessListInvitationsSuccessResponseInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();

if ("kind".equals(fieldName)) {
deserializedAccessListInvitationsSuccessResponseInner.kind = reader.getString();
} else if ("metadata".equals(fieldName)) {
deserializedAccessListInvitationsSuccessResponseInner.metadata
= ConfluentListMetadata.fromJson(reader);
} else if ("data".equals(fieldName)) {
List<InvitationRecordInner> data
= reader.readArray(reader1 -> InvitationRecordInner.fromJson(reader1));
deserializedAccessListInvitationsSuccessResponseInner.data = data;
} else {
reader.skipChildren();
}
}

return deserializedAccessListInvitationsSuccessResponseInner;
});
}
}
Loading

0 comments on commit d247f8d

Please sign in to comment.