Skip to content

Dev/digitaltwins/vidyashreeb/update to 2023 10 31 new #45264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ com.azure:azure-data-tables;12.5.3;12.6.0-beta.1
com.azure:azure-data-tables-perf;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-developer-devcenter;1.0.8;1.1.0-beta.1
com.azure:azure-developer-loadtesting;1.0.22;1.1.0-beta.1
com.azure:azure-digitaltwins-core;1.4.2;1.5.0-beta.1
com.azure:azure-digitaltwins-core;1.5.0-beta.1;1.6.0
com.azure:azure-e2e;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-health-deidentification;1.0.0;1.1.0-beta.1
com.azure:azure-health-insights-clinicalmatching;1.0.0-beta.1;1.0.0-beta.2
Expand Down
4 changes: 3 additions & 1 deletion sdk/digitaltwins/azure-digitaltwins-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.5.0-beta.1 (Unreleased)
## 1.6.0 (2025-05-01)

## 1.5.0-beta.1 (2025-05-01)

### Features Added

Expand Down
2 changes: 1 addition & 1 deletion sdk/digitaltwins/azure-digitaltwins-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ add the direct dependency to your project as follows.
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-digitaltwins-core</artifactId>
<version>1.5.0-beta.1</version>
<version>1.6.0</version>
</dependency>
```

Expand Down
3 changes: 1 addition & 2 deletions sdk/digitaltwins/azure-digitaltwins-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
</parent>

<groupId>com.azure</groupId>
<artifactId>azure-digitaltwins-core</artifactId>
<version>1.5.0-beta.1</version> <!-- {x-version-update;com.azure:azure-digitaltwins-core;current} -->
<version>1.6.0</version> <!-- {x-version-update;com.azure:azure-digitaltwins-core;current} -->

<name>Microsoft Azure client library for Digital Twins</name>
<description>This package contains the Microsoft Azure DigitalTwins client library.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import java.io.UncheckedIOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -2056,7 +2057,8 @@ private static DigitalTwinsResponseHeaders createDTResponseHeadersFromResponse(R
: new DigitalTwinsResponseHeaders().setETag(response.getHeaders().getValue(HttpHeaderName.ETAG));
}

private <T> Mono<DigitalTwinsResponse<T>> deserializeHelper(Response<Object> response, Class<T> clazz) {
private <T> Mono<DigitalTwinsResponse<T>> deserializeHelper(Response<Map<String, Object>> response,
Class<T> clazz) {
try {
T genericResponse = DeserializationHelpers.deserializeObject(protocolLayer.getSerializerAdapter(),
response.getValue(), clazz, this.serializer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ public enum DigitalTwinsServiceVersion implements ServiceVersion {
/**
* Service version {@code 2022-05-31}.
*/
V2022_05_31("2022-05-31");
V2022_05_31("2022-05-31"),

/**
* Service version {@code 2023-10-31}.
*/
V2023_10_31("2023-10-31");

private final String version;

Expand All @@ -39,6 +44,6 @@ public String getVersion() {
* @return The latest service API version of Azure Digital Twins that is supported by this client.
*/
public static DigitalTwinsServiceVersion getLatest() {
return V2022_05_31;
return V2023_10_31;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,38 @@
* Initializes a new instance of the AzureDigitalTwinsAPI type.
*/
public final class AzureDigitalTwinsAPIImpl {
/**
* ID for the operation's status monitor. The ID is generated if header was not passed by the client.
*/
private final String operationId;

/**
* Gets ID for the operation's status monitor. The ID is generated if header was not passed by the client.
*
* @return the operationId value.
*/
public String getOperationId() {
return this.operationId;
}

/**
* Desired timeout for the delete job. Once the specified timeout is reached, service will stop any delete
* operations triggered by the current delete job that are in progress, and go to a failed state. Please note that
* this will leave your instance in an unknown state as there won't be any rollback operation.
*/
private final int timeoutInMinutes;

/**
* Gets Desired timeout for the delete job. Once the specified timeout is reached, service will stop any delete
* operations triggered by the current delete job that are in progress, and go to a failed state. Please note that
* this will leave your instance in an unknown state as there won't be any rollback operation.
*
* @return the timeoutInMinutes value.
*/
public int getTimeoutInMinutes() {
return this.timeoutInMinutes;
}

/**
* server parameter.
*/
Expand Down Expand Up @@ -127,45 +159,94 @@ public EventRoutesImpl getEventRoutes() {
return this.eventRoutes;
}

/**
* The ImportJobsImpl object to access its operations.
*/
private final ImportJobsImpl importJobs;

/**
* Gets the ImportJobsImpl object to access its operations.
*
* @return the ImportJobsImpl object.
*/
public ImportJobsImpl getImportJobs() {
return this.importJobs;
}

/**
* The DeleteJobsImpl object to access its operations.
*/
private final DeleteJobsImpl deleteJobs;

/**
* Gets the DeleteJobsImpl object to access its operations.
*
* @return the DeleteJobsImpl object.
*/
public DeleteJobsImpl getDeleteJobs() {
return this.deleteJobs;
}

/**
* Initializes an instance of AzureDigitalTwinsAPI client.
*
* @param operationId ID for the operation's status monitor. The ID is generated if header was not passed by the
* client.
* @param timeoutInMinutes Desired timeout for the delete job. Once the specified timeout is reached, service will
* stop any delete operations triggered by the current delete job that are in progress, and go to a failed state.
* Please note that this will leave your instance in an unknown state as there won't be any rollback operation.
* @param host server parameter.
* @param apiVersion Api Version.
*/
AzureDigitalTwinsAPIImpl(String host, String apiVersion) {
AzureDigitalTwinsAPIImpl(String operationId, int timeoutInMinutes, String host, String apiVersion) {
this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(),
JacksonAdapter.createDefaultSerializerAdapter(), host, apiVersion);
JacksonAdapter.createDefaultSerializerAdapter(), operationId, timeoutInMinutes, host, apiVersion);
}

/**
* Initializes an instance of AzureDigitalTwinsAPI client.
*
* @param httpPipeline The HTTP pipeline to send requests through.
* @param operationId ID for the operation's status monitor. The ID is generated if header was not passed by the
* client.
* @param timeoutInMinutes Desired timeout for the delete job. Once the specified timeout is reached, service will
* stop any delete operations triggered by the current delete job that are in progress, and go to a failed state.
* Please note that this will leave your instance in an unknown state as there won't be any rollback operation.
* @param host server parameter.
* @param apiVersion Api Version.
*/
AzureDigitalTwinsAPIImpl(HttpPipeline httpPipeline, String host, String apiVersion) {
this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), host, apiVersion);
AzureDigitalTwinsAPIImpl(HttpPipeline httpPipeline, String operationId, int timeoutInMinutes, String host,
String apiVersion) {
this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), operationId, timeoutInMinutes, host,
apiVersion);
}

/**
* Initializes an instance of AzureDigitalTwinsAPI client.
*
* @param httpPipeline The HTTP pipeline to send requests through.
* @param serializerAdapter The serializer to serialize an object into a string.
* @param operationId ID for the operation's status monitor. The ID is generated if header was not passed by the
* client.
* @param timeoutInMinutes Desired timeout for the delete job. Once the specified timeout is reached, service will
* stop any delete operations triggered by the current delete job that are in progress, and go to a failed state.
* Please note that this will leave your instance in an unknown state as there won't be any rollback operation.
* @param host server parameter.
* @param apiVersion Api Version.
*/
AzureDigitalTwinsAPIImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String host,
String apiVersion) {
AzureDigitalTwinsAPIImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String operationId,
int timeoutInMinutes, String host, String apiVersion) {
this.httpPipeline = httpPipeline;
this.serializerAdapter = serializerAdapter;
this.operationId = operationId;
this.timeoutInMinutes = timeoutInMinutes;
this.host = host;
this.apiVersion = apiVersion;
this.digitalTwinModels = new DigitalTwinModelsImpl(this);
this.queries = new QueriesImpl(this);
this.digitalTwins = new DigitalTwinsImpl(this);
this.eventRoutes = new EventRoutesImpl(this);
this.importJobs = new ImportJobsImpl(this);
this.deleteJobs = new DeleteJobsImpl(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,46 @@ public AzureDigitalTwinsAPIImplBuilder credential(TokenCredential tokenCredentia
return this;
}

/*
* ID for the operation's status monitor. The ID is generated if header was not passed by the client.
*/
@Generated
private String operationId;

/**
* Sets ID for the operation's status monitor. The ID is generated if header was not passed by the client.
*
* @param operationId the operationId value.
* @return the AzureDigitalTwinsAPIImplBuilder.
*/
@Generated
public AzureDigitalTwinsAPIImplBuilder operationId(String operationId) {
this.operationId = operationId;
return this;
}

/*
* Desired timeout for the delete job. Once the specified timeout is reached, service will stop any delete
* operations triggered by the current delete job that are in progress, and go to a failed state. Please note that
* this will leave your instance in an unknown state as there won't be any rollback operation.
*/
@Generated
private int timeoutInMinutes;

/**
* Sets Desired timeout for the delete job. Once the specified timeout is reached, service will stop any delete
* operations triggered by the current delete job that are in progress, and go to a failed state. Please note that
* this will leave your instance in an unknown state as there won't be any rollback operation.
*
* @param timeoutInMinutes the timeoutInMinutes value.
* @return the AzureDigitalTwinsAPIImplBuilder.
*/
@Generated
public AzureDigitalTwinsAPIImplBuilder timeoutInMinutes(int timeoutInMinutes) {
this.timeoutInMinutes = timeoutInMinutes;
return this;
}

/*
* server parameter
*/
Expand Down Expand Up @@ -270,11 +310,11 @@ public AzureDigitalTwinsAPIImpl buildClient() {
this.validateClient();
HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline();
String localHost = (host != null) ? host : "https://digitaltwins-hostname";
String localApiVersion = (apiVersion != null) ? apiVersion : "2022-05-31";
String localApiVersion = (apiVersion != null) ? apiVersion : "2023-10-31";
SerializerAdapter localSerializerAdapter
= (serializerAdapter != null) ? serializerAdapter : JacksonAdapter.createDefaultSerializerAdapter();
AzureDigitalTwinsAPIImpl client
= new AzureDigitalTwinsAPIImpl(localPipeline, localSerializerAdapter, localHost, localApiVersion);
AzureDigitalTwinsAPIImpl client = new AzureDigitalTwinsAPIImpl(localPipeline, localSerializerAdapter,
this.operationId, this.timeoutInMinutes, localHost, localApiVersion);
return client;
}

Expand Down
Loading
Loading