Skip to content

Commit

Permalink
[Automation] Generate Fluent Lite from Swagger datafactory#package-20…
Browse files Browse the repository at this point in the history
…18-06 (#41577)
  • Loading branch information
azure-sdk authored Aug 21, 2024
1 parent 76ed71f commit 18ccc98
Show file tree
Hide file tree
Showing 1,898 changed files with 88,967 additions and 28,876 deletions.
3,822 changes: 3,818 additions & 4 deletions sdk/datafactory/azure-resourcemanager-datafactory/CHANGELOG.md

Large diffs are not rendered by default.

13 changes: 5 additions & 8 deletions sdk/datafactory/azure-resourcemanager-datafactory/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-datafactory</artifactId>
<version>1.0.0-beta.29</version>
<version>1.0.0-beta.30</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 @@ -184,6 +180,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
5 changes: 5 additions & 0 deletions sdk/datafactory/azure-resourcemanager-datafactory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
<revapi.skip>true</revapi.skip>
</properties>
<dependencies>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-json</artifactId>
<version>1.2.0</version> <!-- {x-version-update;com.azure:azure-json;dependency} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public DataFactoryManager authenticate(TokenCredential credential, AzureProfile
.append("-")
.append("com.azure.resourcemanager.datafactory")
.append("/")
.append("1.0.0-beta.29");
.append("1.0.0-beta.30");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder.append(" (")
.append(Configuration.getGlobalConfiguration().get("java.version"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,31 @@
package com.azure.resourcemanager.datafactory.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.datafactory.models.UserAccessPolicy;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.IOException;

/**
* Get Data Plane read only token response definition.
*/
@Fluent
public final class AccessPolicyResponseInner {
public final class AccessPolicyResponseInner implements JsonSerializable<AccessPolicyResponseInner> {
/*
* The user access policy.
*/
@JsonProperty(value = "policy")
private UserAccessPolicy policy;

/*
* Data Plane read only access token.
*/
@JsonProperty(value = "accessToken")
private String accessToken;

/*
* Data Plane service base URL.
*/
@JsonProperty(value = "dataPlaneUrl")
private String dataPlaneUrl;

/**
Expand Down Expand Up @@ -107,4 +108,46 @@ public void validate() {
policy().validate();
}
}

/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("policy", this.policy);
jsonWriter.writeStringField("accessToken", this.accessToken);
jsonWriter.writeStringField("dataPlaneUrl", this.dataPlaneUrl);
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of AccessPolicyResponseInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AccessPolicyResponseInner 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 AccessPolicyResponseInner.
*/
public static AccessPolicyResponseInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
AccessPolicyResponseInner deserializedAccessPolicyResponseInner = new AccessPolicyResponseInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();

if ("policy".equals(fieldName)) {
deserializedAccessPolicyResponseInner.policy = UserAccessPolicy.fromJson(reader);
} else if ("accessToken".equals(fieldName)) {
deserializedAccessPolicyResponseInner.accessToken = reader.getString();
} else if ("dataPlaneUrl".equals(fieldName)) {
deserializedAccessPolicyResponseInner.dataPlaneUrl = reader.getString();
} else {
reader.skipChildren();
}
}

return deserializedAccessPolicyResponseInner;
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,27 @@

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.datafactory.models.ActivityRun;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.IOException;
import java.util.List;

/**
* A list activity runs.
*/
@Fluent
public final class ActivityRunsQueryResponseInner {
public final class ActivityRunsQueryResponseInner implements JsonSerializable<ActivityRunsQueryResponseInner> {
/*
* List of activity runs.
*/
@JsonProperty(value = "value", required = true)
private List<ActivityRun> value;

/*
* The continuation token for getting the next page of results, if any remaining results exist, null otherwise.
*/
@JsonProperty(value = "continuationToken")
private String continuationToken;

/**
Expand Down Expand Up @@ -91,4 +93,46 @@ public void validate() {
}

private static final ClientLogger LOGGER = new ClientLogger(ActivityRunsQueryResponseInner.class);

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

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

if ("value".equals(fieldName)) {
List<ActivityRun> value = reader.readArray(reader1 -> ActivityRun.fromJson(reader1));
deserializedActivityRunsQueryResponseInner.value = value;
} else if ("continuationToken".equals(fieldName)) {
deserializedActivityRunsQueryResponseInner.continuationToken = reader.getString();
} else {
reader.skipChildren();
}
}

return deserializedActivityRunsQueryResponseInner;
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@
package com.azure.resourcemanager.datafactory.fluent.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
* Response body structure for starting data flow debug session.
*/
@Fluent
public final class AddDataFlowToDebugSessionResponseInner {
public final class AddDataFlowToDebugSessionResponseInner
implements JsonSerializable<AddDataFlowToDebugSessionResponseInner> {
/*
* The ID of data flow debug job version.
*/
@JsonProperty(value = "jobVersion")
private String jobVersion;

/**
Expand Down Expand Up @@ -51,4 +55,41 @@ public AddDataFlowToDebugSessionResponseInner withJobVersion(String jobVersion)
*/
public void validate() {
}

/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("jobVersion", this.jobVersion);
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of AddDataFlowToDebugSessionResponseInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AddDataFlowToDebugSessionResponseInner 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 AddDataFlowToDebugSessionResponseInner.
*/
public static AddDataFlowToDebugSessionResponseInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
AddDataFlowToDebugSessionResponseInner deserializedAddDataFlowToDebugSessionResponseInner
= new AddDataFlowToDebugSessionResponseInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();

if ("jobVersion".equals(fieldName)) {
deserializedAddDataFlowToDebugSessionResponseInner.jobVersion = reader.getString();
} else {
reader.skipChildren();
}
}

return deserializedAddDataFlowToDebugSessionResponseInner;
});
}
}
Loading

0 comments on commit 18ccc98

Please sign in to comment.