From ac83f61895489c049ac886cdad7a299d317e3563 Mon Sep 17 00:00:00 2001 From: Vidyashree Biligere Narayanaswamy Date: Thu, 8 May 2025 16:15:15 -0400 Subject: [PATCH 1/2] updaet version --- .../core/DigitalTwinsAsyncClient.java | 4 +- .../core/DigitalTwinsServiceVersion.java | 9 +- .../AzureDigitalTwinsAPIImpl.java | 93 ++- .../AzureDigitalTwinsAPIImplBuilder.java | 46 +- .../core/implementation/DeleteJobsImpl.java | 459 +++++++++++++ .../implementation/DigitalTwinModelsImpl.java | 8 +- .../core/implementation/DigitalTwinsImpl.java | 189 +++--- .../core/implementation/ImportJobsImpl.java | 616 ++++++++++++++++++ .../core/implementation/models/DeleteJob.java | 174 +++++ .../models/DeleteJobCollection.java | 115 ++++ .../models/DeleteJobStatus.java | 66 ++ .../models/DeleteJobsAddHeaders.java | 50 ++ .../models/DeleteJobsAddOptions.java | 71 ++ .../models/DeleteJobsGetByIdOptions.java | 71 ++ .../models/DeleteJobsListOptions.java | 99 +++ .../core/implementation/models/ImportJob.java | 268 ++++++++ .../models/ImportJobCollection.java | 115 ++++ .../models/ImportJobsAddOptions.java | 71 ++ .../models/ImportJobsCancelOptions.java | 71 ++ .../models/ImportJobsDeleteOptions.java | 71 ++ .../models/ImportJobsGetByIdOptions.java | 71 ++ .../models/ImportJobsListOptions.java | 99 +++ .../core/implementation/models/Status.java | 76 +++ .../swagger/autorest.md | 4 +- 24 files changed, 2807 insertions(+), 109 deletions(-) create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/DeleteJobsImpl.java create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/ImportJobsImpl.java create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJob.java create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobCollection.java create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobStatus.java create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobsAddHeaders.java create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobsAddOptions.java create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobsGetByIdOptions.java create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobsListOptions.java create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJob.java create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobCollection.java create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobsAddOptions.java create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobsCancelOptions.java create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobsDeleteOptions.java create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobsGetByIdOptions.java create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobsListOptions.java create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/Status.java diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsAsyncClient.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsAsyncClient.java index 187c85954e8d..83bb7a443bc0 100644 --- a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsAsyncClient.java +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsAsyncClient.java @@ -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; @@ -2056,7 +2057,8 @@ private static DigitalTwinsResponseHeaders createDTResponseHeadersFromResponse(R : new DigitalTwinsResponseHeaders().setETag(response.getHeaders().getValue(HttpHeaderName.ETAG)); } - private Mono> deserializeHelper(Response response, Class clazz) { + private Mono> deserializeHelper(Response> response, + Class clazz) { try { T genericResponse = DeserializationHelpers.deserializeObject(protocolLayer.getSerializerAdapter(), response.getValue(), clazz, this.serializer); diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsServiceVersion.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsServiceVersion.java index 45894391f774..9e1659b3664c 100644 --- a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsServiceVersion.java +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsServiceVersion.java @@ -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 2022-05-31}. + */ + V2023_10_31("2023-10-31"); private final String version; @@ -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; } } diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/AzureDigitalTwinsAPIImpl.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/AzureDigitalTwinsAPIImpl.java index 7c40e8a05f1c..9855c50758a5 100644 --- a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/AzureDigitalTwinsAPIImpl.java +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/AzureDigitalTwinsAPIImpl.java @@ -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. */ @@ -127,26 +159,66 @@ 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); } /** @@ -154,18 +226,27 @@ public EventRoutesImpl getEventRoutes() { * * @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); } } diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/AzureDigitalTwinsAPIImplBuilder.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/AzureDigitalTwinsAPIImplBuilder.java index 157025750791..9ef6b58c0293 100644 --- a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/AzureDigitalTwinsAPIImplBuilder.java +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/AzureDigitalTwinsAPIImplBuilder.java @@ -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 */ @@ -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; } diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/DeleteJobsImpl.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/DeleteJobsImpl.java new file mode 100644 index 000000000000..73ad1aef453f --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/DeleteJobsImpl.java @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.ResponseBase; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.digitaltwins.core.implementation.models.DeleteJob; +import com.azure.digitaltwins.core.implementation.models.DeleteJobCollection; +import com.azure.digitaltwins.core.implementation.models.DeleteJobsAddHeaders; +import com.azure.digitaltwins.core.implementation.models.DeleteJobsAddOptions; +import com.azure.digitaltwins.core.implementation.models.DeleteJobsGetByIdOptions; +import com.azure.digitaltwins.core.implementation.models.DeleteJobsListOptions; +import com.azure.digitaltwins.core.implementation.models.ErrorResponseException; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DeleteJobs. + */ +public final class DeleteJobsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final DeleteJobsService service; + + /** + * The service client containing this operation class. + */ + private final AzureDigitalTwinsAPIImpl client; + + /** + * Initializes an instance of DeleteJobsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DeleteJobsImpl(AzureDigitalTwinsAPIImpl client) { + this.service + = RestProxy.create(DeleteJobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureDigitalTwinsAPIDeleteJobs to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureDigitalTwinsAPI") + public interface DeleteJobsService { + @Post("/jobs/deletions") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> add(@HostParam("$host") String host, + @HeaderParam("traceparent") String traceparent, @HeaderParam("tracestate") String tracestate, + @QueryParam("api-version") String apiVersion, @HeaderParam("operation-id") String operationId, + @QueryParam("timeoutInMinutes") Integer timeoutInMinutes, @HeaderParam("Accept") String accept, + Context context); + + @Post("/jobs/deletions") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> addNoCustomHeaders(@HostParam("$host") String host, + @HeaderParam("traceparent") String traceparent, @HeaderParam("tracestate") String tracestate, + @QueryParam("api-version") String apiVersion, @HeaderParam("operation-id") String operationId, + @QueryParam("timeoutInMinutes") Integer timeoutInMinutes, @HeaderParam("Accept") String accept, + Context context); + + @Get("/jobs/deletions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> list(@HostParam("$host") String host, + @HeaderParam("traceparent") String traceparent, @HeaderParam("tracestate") String tracestate, + @QueryParam("api-version") String apiVersion, @HeaderParam("max-items-per-page") Integer maxItemsPerPage, + @HeaderParam("Accept") String accept, Context context); + + @Get("/jobs/deletions/{id}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> getById(@HostParam("$host") String host, + @HeaderParam("traceparent") String traceparent, @HeaderParam("tracestate") String tracestate, + @PathParam("id") String id, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String host, @HeaderParam("traceparent") String traceparent, + @HeaderParam("tracestate") String tracestate, @HeaderParam("max-items-per-page") Integer maxItemsPerPage, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Initiates a job which deletes all models, twins, and relationships on the instance. Does not delete any other + * types of entities. + * Status codes: + * * 202 Created + * * 400 Bad Request + * * JobLimitReached - The maximum number of delete jobs allowed has been reached. + * * ValidationFailed - Operation-Id already exists. + * + * @param deleteJobsAddOptions Parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a job which contains a reference to the operations to perform, results, and execution metadata along with + * {@link ResponseBase} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> + addWithResponseAsync(DeleteJobsAddOptions deleteJobsAddOptions) { + return FluxUtil.withContext(context -> addWithResponseAsync(deleteJobsAddOptions, context)); + } + + /** + * Initiates a job which deletes all models, twins, and relationships on the instance. Does not delete any other + * types of entities. + * Status codes: + * * 202 Created + * * 400 Bad Request + * * JobLimitReached - The maximum number of delete jobs allowed has been reached. + * * ValidationFailed - Operation-Id already exists. + * + * @param deleteJobsAddOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a job which contains a reference to the operations to perform, results, and execution metadata along with + * {@link ResponseBase} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> + addWithResponseAsync(DeleteJobsAddOptions deleteJobsAddOptions, Context context) { + final String accept = "application/json"; + String traceparentInternal = null; + if (deleteJobsAddOptions != null) { + traceparentInternal = deleteJobsAddOptions.getTraceparent(); + } + String traceparent = traceparentInternal; + String tracestateInternal = null; + if (deleteJobsAddOptions != null) { + tracestateInternal = deleteJobsAddOptions.getTracestate(); + } + String tracestate = tracestateInternal; + return service.add(this.client.getHost(), traceparent, tracestate, this.client.getApiVersion(), + this.client.getOperationId(), this.client.getTimeoutInMinutes(), accept, context); + } + + /** + * Initiates a job which deletes all models, twins, and relationships on the instance. Does not delete any other + * types of entities. + * Status codes: + * * 202 Created + * * 400 Bad Request + * * JobLimitReached - The maximum number of delete jobs allowed has been reached. + * * ValidationFailed - Operation-Id already exists. + * + * @param deleteJobsAddOptions Parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a job which contains a reference to the operations to perform, results, and execution metadata on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono addAsync(DeleteJobsAddOptions deleteJobsAddOptions) { + return addWithResponseAsync(deleteJobsAddOptions).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Initiates a job which deletes all models, twins, and relationships on the instance. Does not delete any other + * types of entities. + * Status codes: + * * 202 Created + * * 400 Bad Request + * * JobLimitReached - The maximum number of delete jobs allowed has been reached. + * * ValidationFailed - Operation-Id already exists. + * + * @param deleteJobsAddOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a job which contains a reference to the operations to perform, results, and execution metadata on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono addAsync(DeleteJobsAddOptions deleteJobsAddOptions, Context context) { + return addWithResponseAsync(deleteJobsAddOptions, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Initiates a job which deletes all models, twins, and relationships on the instance. Does not delete any other + * types of entities. + * Status codes: + * * 202 Created + * * 400 Bad Request + * * JobLimitReached - The maximum number of delete jobs allowed has been reached. + * * ValidationFailed - Operation-Id already exists. + * + * @param deleteJobsAddOptions Parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a job which contains a reference to the operations to perform, results, and execution metadata along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addNoCustomHeadersWithResponseAsync(DeleteJobsAddOptions deleteJobsAddOptions) { + return FluxUtil.withContext(context -> addNoCustomHeadersWithResponseAsync(deleteJobsAddOptions, context)); + } + + /** + * Initiates a job which deletes all models, twins, and relationships on the instance. Does not delete any other + * types of entities. + * Status codes: + * * 202 Created + * * 400 Bad Request + * * JobLimitReached - The maximum number of delete jobs allowed has been reached. + * * ValidationFailed - Operation-Id already exists. + * + * @param deleteJobsAddOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a job which contains a reference to the operations to perform, results, and execution metadata along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addNoCustomHeadersWithResponseAsync(DeleteJobsAddOptions deleteJobsAddOptions, + Context context) { + final String accept = "application/json"; + String traceparentInternal = null; + if (deleteJobsAddOptions != null) { + traceparentInternal = deleteJobsAddOptions.getTraceparent(); + } + String traceparent = traceparentInternal; + String tracestateInternal = null; + if (deleteJobsAddOptions != null) { + tracestateInternal = deleteJobsAddOptions.getTracestate(); + } + String tracestate = tracestateInternal; + return service.addNoCustomHeaders(this.client.getHost(), traceparent, tracestate, this.client.getApiVersion(), + this.client.getOperationId(), this.client.getTimeoutInMinutes(), accept, context); + } + + /** + * Retrieves all deletion jobs. This may be useful to find a delete job that was previously requested, or to view a + * history of delete jobs that have run or are currently running on the instance. + * Status codes: + * * 200 OK. + * + * @param deleteJobsListOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of delete job objects along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync(DeleteJobsListOptions deleteJobsListOptions, + Context context) { + final String accept = "application/json"; + String traceparentInternal = null; + if (deleteJobsListOptions != null) { + traceparentInternal = deleteJobsListOptions.getTraceparent(); + } + String traceparent = traceparentInternal; + String tracestateInternal = null; + if (deleteJobsListOptions != null) { + tracestateInternal = deleteJobsListOptions.getTracestate(); + } + String tracestate = tracestateInternal; + Integer maxItemsPerPageInternal = null; + if (deleteJobsListOptions != null) { + maxItemsPerPageInternal = deleteJobsListOptions.getMaxItemsPerPage(); + } + Integer maxItemsPerPage = maxItemsPerPageInternal; + return service + .list(this.client.getHost(), traceparent, tracestate, this.client.getApiVersion(), maxItemsPerPage, accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getValue(), res.getValue().getNextLink(), null)); + } + + /** + * Retrieves all deletion jobs. This may be useful to find a delete job that was previously requested, or to view a + * history of delete jobs that have run or are currently running on the instance. + * Status codes: + * * 200 OK. + * + * @param deleteJobsListOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of delete job objects as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(DeleteJobsListOptions deleteJobsListOptions, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(deleteJobsListOptions, context), + nextLink -> listNextSinglePageAsync(nextLink, deleteJobsListOptions, context)); + } + + /** + * Retrieves a delete job. + * Status codes: + * * 200 OK + * * 404 Not Found + * * DeleteJobNotFound - The delete job was not found. + * + * @param id The id for the delete job. The id is unique within the service and case sensitive. + * @param deleteJobsGetByIdOptions Parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a job which contains a reference to the operations to perform, results, and execution metadata along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByIdWithResponseAsync(String id, + DeleteJobsGetByIdOptions deleteJobsGetByIdOptions) { + return FluxUtil.withContext(context -> getByIdWithResponseAsync(id, deleteJobsGetByIdOptions, context)); + } + + /** + * Retrieves a delete job. + * Status codes: + * * 200 OK + * * 404 Not Found + * * DeleteJobNotFound - The delete job was not found. + * + * @param id The id for the delete job. The id is unique within the service and case sensitive. + * @param deleteJobsGetByIdOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a job which contains a reference to the operations to perform, results, and execution metadata along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByIdWithResponseAsync(String id, + DeleteJobsGetByIdOptions deleteJobsGetByIdOptions, Context context) { + final String accept = "application/json"; + String traceparentInternal = null; + if (deleteJobsGetByIdOptions != null) { + traceparentInternal = deleteJobsGetByIdOptions.getTraceparent(); + } + String traceparent = traceparentInternal; + String tracestateInternal = null; + if (deleteJobsGetByIdOptions != null) { + tracestateInternal = deleteJobsGetByIdOptions.getTracestate(); + } + String tracestate = tracestateInternal; + return service.getById(this.client.getHost(), traceparent, tracestate, id, this.client.getApiVersion(), accept, + context); + } + + /** + * Retrieves a delete job. + * Status codes: + * * 200 OK + * * 404 Not Found + * * DeleteJobNotFound - The delete job was not found. + * + * @param id The id for the delete job. The id is unique within the service and case sensitive. + * @param deleteJobsGetByIdOptions Parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a job which contains a reference to the operations to perform, results, and execution metadata on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByIdAsync(String id, DeleteJobsGetByIdOptions deleteJobsGetByIdOptions) { + return getByIdWithResponseAsync(id, deleteJobsGetByIdOptions).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves a delete job. + * Status codes: + * * 200 OK + * * 404 Not Found + * * DeleteJobNotFound - The delete job was not found. + * + * @param id The id for the delete job. The id is unique within the service and case sensitive. + * @param deleteJobsGetByIdOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a job which contains a reference to the operations to perform, results, and execution metadata on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByIdAsync(String id, DeleteJobsGetByIdOptions deleteJobsGetByIdOptions, Context context) { + return getByIdWithResponseAsync(id, deleteJobsGetByIdOptions, context) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param deleteJobsListOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of delete job objects along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink, + DeleteJobsListOptions deleteJobsListOptions, Context context) { + final String accept = "application/json"; + String traceparentInternal = null; + if (deleteJobsListOptions != null) { + traceparentInternal = deleteJobsListOptions.getTraceparent(); + } + String traceparent = traceparentInternal; + String tracestateInternal = null; + if (deleteJobsListOptions != null) { + tracestateInternal = deleteJobsListOptions.getTracestate(); + } + String tracestate = tracestateInternal; + Integer maxItemsPerPageInternal = null; + if (deleteJobsListOptions != null) { + maxItemsPerPageInternal = deleteJobsListOptions.getMaxItemsPerPage(); + } + Integer maxItemsPerPage = maxItemsPerPageInternal; + return service + .listNext(nextLink, this.client.getHost(), traceparent, tracestate, maxItemsPerPage, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getValue(), res.getValue().getNextLink(), null)); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/DigitalTwinModelsImpl.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/DigitalTwinModelsImpl.java index 0fb6ce6618f0..a99cbcfc3eea 100644 --- a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/DigitalTwinModelsImpl.java +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/DigitalTwinModelsImpl.java @@ -253,8 +253,8 @@ public Mono> addAsync(List models, * * 404 Not Found * * ModelNotFound - The model was not found. * - * @param dependenciesFor The set of the models which will have their dependencies retrieved. If omitted, all models - * are retrieved. + * @param dependenciesFor If specified, only return the set of the specified models along with their dependencies. + * If omitted, all models are retrieved. * @param includeModelDefinition When true the model definition will be returned as part of the result. * @param digitalTwinModelsListOptions Parameter group. * @param context The context to associate with this operation. @@ -303,8 +303,8 @@ public Mono> listSinglePageAsync(List> getById(@HostParam("$host") String host, + Mono>> getById(@HostParam("$host") String host, @HeaderParam("traceparent") String traceparent, @HeaderParam("tracestate") String tracestate, @PathParam("id") String id, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -100,7 +101,7 @@ Mono> getById(@HostParam("$host @Get("/digitaltwins/{id}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorResponseException.class) - Mono> getByIdNoCustomHeaders(@HostParam("$host") String host, + Mono>> getByIdNoCustomHeaders(@HostParam("$host") String host, @HeaderParam("traceparent") String traceparent, @HeaderParam("tracestate") String tracestate, @PathParam("id") String id, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -108,7 +109,7 @@ Mono> getByIdNoCustomHeaders(@HostParam("$host") String host, @Put("/digitaltwins/{id}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorResponseException.class) - Mono> add(@HostParam("$host") String host, + Mono>> add(@HostParam("$host") String host, @HeaderParam("traceparent") String traceparent, @HeaderParam("tracestate") String tracestate, @PathParam("id") String id, @HeaderParam("If-None-Match") String ifNoneMatch, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") Object twin, @@ -117,7 +118,7 @@ Mono> add(@HostParam("$host") Strin @Put("/digitaltwins/{id}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorResponseException.class) - Mono> addNoCustomHeaders(@HostParam("$host") String host, + Mono>> addNoCustomHeaders(@HostParam("$host") String host, @HeaderParam("traceparent") String traceparent, @HeaderParam("tracestate") String tracestate, @PathParam("id") String id, @HeaderParam("If-None-Match") String ifNoneMatch, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") Object twin, @@ -154,7 +155,7 @@ Mono> updateNoCustomHeaders(@HostParam("$host") String host, @Get("/digitaltwins/{id}/relationships/{relationshipId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorResponseException.class) - Mono> getRelationshipById( + Mono>> getRelationshipById( @HostParam("$host") String host, @HeaderParam("traceparent") String traceparent, @HeaderParam("tracestate") String tracestate, @PathParam("id") String id, @PathParam("relationshipId") String relationshipId, @QueryParam("api-version") String apiVersion, @@ -163,7 +164,7 @@ Mono> getRelationsh @Get("/digitaltwins/{id}/relationships/{relationshipId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorResponseException.class) - Mono> getRelationshipByIdNoCustomHeaders(@HostParam("$host") String host, + Mono>> getRelationshipByIdNoCustomHeaders(@HostParam("$host") String host, @HeaderParam("traceparent") String traceparent, @HeaderParam("tracestate") String tracestate, @PathParam("id") String id, @PathParam("relationshipId") String relationshipId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -171,16 +172,17 @@ Mono> getRelationshipByIdNoCustomHeaders(@HostParam("$host") St @Put("/digitaltwins/{id}/relationships/{relationshipId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorResponseException.class) - Mono> addRelationship(@HostParam("$host") String host, - @HeaderParam("traceparent") String traceparent, @HeaderParam("tracestate") String tracestate, - @PathParam("id") String id, @PathParam("relationshipId") String relationshipId, - @HeaderParam("If-None-Match") String ifNoneMatch, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") Object relationship, @HeaderParam("Accept") String accept, Context context); + Mono>> addRelationship( + @HostParam("$host") String host, @HeaderParam("traceparent") String traceparent, + @HeaderParam("tracestate") String tracestate, @PathParam("id") String id, + @PathParam("relationshipId") String relationshipId, @HeaderParam("If-None-Match") String ifNoneMatch, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") Object relationship, + @HeaderParam("Accept") String accept, Context context); @Put("/digitaltwins/{id}/relationships/{relationshipId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorResponseException.class) - Mono> addRelationshipNoCustomHeaders(@HostParam("$host") String host, + Mono>> addRelationshipNoCustomHeaders(@HostParam("$host") String host, @HeaderParam("traceparent") String traceparent, @HeaderParam("tracestate") String tracestate, @PathParam("id") String id, @PathParam("relationshipId") String relationshipId, @HeaderParam("If-None-Match") String ifNoneMatch, @QueryParam("api-version") String apiVersion, @@ -256,15 +258,16 @@ Mono> sendComponentTelemetry(@HostParam("$host") String host, @Get("/digitaltwins/{id}/components/{componentPath}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorResponseException.class) - Mono> getComponent(@HostParam("$host") String host, - @HeaderParam("traceparent") String traceparent, @HeaderParam("tracestate") String tracestate, - @PathParam("id") String id, @PathParam("componentPath") String componentPath, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono>> getComponent( + @HostParam("$host") String host, @HeaderParam("traceparent") String traceparent, + @HeaderParam("tracestate") String tracestate, @PathParam("id") String id, + @PathParam("componentPath") String componentPath, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); @Get("/digitaltwins/{id}/components/{componentPath}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorResponseException.class) - Mono> getComponentNoCustomHeaders(@HostParam("$host") String host, + Mono>> getComponentNoCustomHeaders(@HostParam("$host") String host, @HeaderParam("traceparent") String traceparent, @HeaderParam("tracestate") String tracestate, @PathParam("id") String id, @PathParam("componentPath") String componentPath, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -320,10 +323,10 @@ Mono> listIncomingRelationshipsNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link ResponseBase} on successful completion of {@link Mono}. + * @return digital twin along with {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByIdWithResponseAsync(String id, + public Mono>> getByIdWithResponseAsync(String id, DigitalTwinsGetByIdOptions digitalTwinsGetByIdOptions) { return FluxUtil.withContext(context -> getByIdWithResponseAsync(id, digitalTwinsGetByIdOptions, context)); } @@ -343,10 +346,10 @@ public Mono> getByIdWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link ResponseBase} on successful completion of {@link Mono}. + * @return digital twin along with {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByIdWithResponseAsync(String id, + public Mono>> getByIdWithResponseAsync(String id, DigitalTwinsGetByIdOptions digitalTwinsGetByIdOptions, Context context) { final String accept = "application/json"; String traceparentInternal = null; @@ -377,10 +380,10 @@ public Mono> getByIdWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object on successful completion of {@link Mono}. + * @return digital twin on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByIdAsync(String id, DigitalTwinsGetByIdOptions digitalTwinsGetByIdOptions) { + public Mono> getByIdAsync(String id, DigitalTwinsGetByIdOptions digitalTwinsGetByIdOptions) { return getByIdWithResponseAsync(id, digitalTwinsGetByIdOptions) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -400,10 +403,10 @@ public Mono getByIdAsync(String id, DigitalTwinsGetByIdOptions digitalTw * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object on successful completion of {@link Mono}. + * @return digital twin on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByIdAsync(String id, DigitalTwinsGetByIdOptions digitalTwinsGetByIdOptions, + public Mono> getByIdAsync(String id, DigitalTwinsGetByIdOptions digitalTwinsGetByIdOptions, Context context) { return getByIdWithResponseAsync(id, digitalTwinsGetByIdOptions, context) .flatMap(res -> Mono.justOrEmpty(res.getValue())); @@ -423,10 +426,10 @@ public Mono getByIdAsync(String id, DigitalTwinsGetByIdOptions digitalTw * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link Response} on successful completion of {@link Mono}. + * @return digital twin along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByIdNoCustomHeadersWithResponseAsync(String id, + public Mono>> getByIdNoCustomHeadersWithResponseAsync(String id, DigitalTwinsGetByIdOptions digitalTwinsGetByIdOptions) { return FluxUtil .withContext(context -> getByIdNoCustomHeadersWithResponseAsync(id, digitalTwinsGetByIdOptions, context)); @@ -447,10 +450,10 @@ public Mono> getByIdNoCustomHeadersWithResponseAsync(String id, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link Response} on successful completion of {@link Mono}. + * @return digital twin along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByIdNoCustomHeadersWithResponseAsync(String id, + public Mono>> getByIdNoCustomHeadersWithResponseAsync(String id, DigitalTwinsGetByIdOptions digitalTwinsGetByIdOptions, Context context) { final String accept = "application/json"; String traceparentInternal = null; @@ -485,10 +488,10 @@ public Mono> getByIdNoCustomHeadersWithResponseAsync(String id, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link ResponseBase} on successful completion of {@link Mono}. + * @return digital twin along with {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> addWithResponseAsync(String id, Object twin, + public Mono>> addWithResponseAsync(String id, Object twin, DigitalTwinsAddOptions digitalTwinsAddOptions) { return FluxUtil.withContext(context -> addWithResponseAsync(id, twin, digitalTwinsAddOptions, context)); } @@ -512,10 +515,10 @@ public Mono> addWithResponseAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link ResponseBase} on successful completion of {@link Mono}. + * @return digital twin along with {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> addWithResponseAsync(String id, Object twin, + public Mono>> addWithResponseAsync(String id, Object twin, DigitalTwinsAddOptions digitalTwinsAddOptions, Context context) { final String accept = "application/json"; String traceparentInternal = null; @@ -555,10 +558,10 @@ public Mono> addWithResponseAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object on successful completion of {@link Mono}. + * @return digital twin on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono addAsync(String id, Object twin, DigitalTwinsAddOptions digitalTwinsAddOptions) { + public Mono> addAsync(String id, Object twin, DigitalTwinsAddOptions digitalTwinsAddOptions) { return addWithResponseAsync(id, twin, digitalTwinsAddOptions).flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -581,10 +584,10 @@ public Mono addAsync(String id, Object twin, DigitalTwinsAddOptions digi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object on successful completion of {@link Mono}. + * @return digital twin on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono addAsync(String id, Object twin, DigitalTwinsAddOptions digitalTwinsAddOptions, + public Mono> addAsync(String id, Object twin, DigitalTwinsAddOptions digitalTwinsAddOptions, Context context) { return addWithResponseAsync(id, twin, digitalTwinsAddOptions, context) .flatMap(res -> Mono.justOrEmpty(res.getValue())); @@ -608,10 +611,10 @@ public Mono addAsync(String id, Object twin, DigitalTwinsAddOptions digi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link Response} on successful completion of {@link Mono}. + * @return digital twin along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> addNoCustomHeadersWithResponseAsync(String id, Object twin, + public Mono>> addNoCustomHeadersWithResponseAsync(String id, Object twin, DigitalTwinsAddOptions digitalTwinsAddOptions) { return FluxUtil .withContext(context -> addNoCustomHeadersWithResponseAsync(id, twin, digitalTwinsAddOptions, context)); @@ -636,10 +639,10 @@ public Mono> addNoCustomHeadersWithResponseAsync(String id, Obj * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link Response} on successful completion of {@link Mono}. + * @return digital twin along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> addNoCustomHeadersWithResponseAsync(String id, Object twin, + public Mono>> addNoCustomHeadersWithResponseAsync(String id, Object twin, DigitalTwinsAddOptions digitalTwinsAddOptions, Context context) { final String accept = "application/json"; String traceparentInternal = null; @@ -1002,12 +1005,12 @@ public Mono> updateNoCustomHeadersWithResponseAsync(String id, Js * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link ResponseBase} on successful completion of {@link Mono}. + * @return digital twin relationship along with {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRelationshipByIdWithResponseAsync( - String id, String relationshipId, - DigitalTwinsGetRelationshipByIdOptions digitalTwinsGetRelationshipByIdOptions) { + public Mono>> + getRelationshipByIdWithResponseAsync(String id, String relationshipId, + DigitalTwinsGetRelationshipByIdOptions digitalTwinsGetRelationshipByIdOptions) { return FluxUtil.withContext(context -> getRelationshipByIdWithResponseAsync(id, relationshipId, digitalTwinsGetRelationshipByIdOptions, context)); } @@ -1029,12 +1032,12 @@ public Mono> getRel * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link ResponseBase} on successful completion of {@link Mono}. + * @return digital twin relationship along with {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRelationshipByIdWithResponseAsync( - String id, String relationshipId, DigitalTwinsGetRelationshipByIdOptions digitalTwinsGetRelationshipByIdOptions, - Context context) { + public Mono>> + getRelationshipByIdWithResponseAsync(String id, String relationshipId, + DigitalTwinsGetRelationshipByIdOptions digitalTwinsGetRelationshipByIdOptions, Context context) { final String accept = "application/json"; String traceparentInternal = null; if (digitalTwinsGetRelationshipByIdOptions != null) { @@ -1066,10 +1069,10 @@ public Mono> getRel * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object on successful completion of {@link Mono}. + * @return digital twin relationship on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getRelationshipByIdAsync(String id, String relationshipId, + public Mono> getRelationshipByIdAsync(String id, String relationshipId, DigitalTwinsGetRelationshipByIdOptions digitalTwinsGetRelationshipByIdOptions) { return getRelationshipByIdWithResponseAsync(id, relationshipId, digitalTwinsGetRelationshipByIdOptions) .flatMap(res -> Mono.justOrEmpty(res.getValue())); @@ -1092,10 +1095,10 @@ public Mono getRelationshipByIdAsync(String id, String relationshipId, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object on successful completion of {@link Mono}. + * @return digital twin relationship on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getRelationshipByIdAsync(String id, String relationshipId, + public Mono> getRelationshipByIdAsync(String id, String relationshipId, DigitalTwinsGetRelationshipByIdOptions digitalTwinsGetRelationshipByIdOptions, Context context) { return getRelationshipByIdWithResponseAsync(id, relationshipId, digitalTwinsGetRelationshipByIdOptions, context) .flatMap(res -> Mono.justOrEmpty(res.getValue())); @@ -1117,11 +1120,11 @@ public Mono getRelationshipByIdAsync(String id, String relationshipId, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link Response} on successful completion of {@link Mono}. + * @return digital twin relationship along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRelationshipByIdNoCustomHeadersWithResponseAsync(String id, String relationshipId, - DigitalTwinsGetRelationshipByIdOptions digitalTwinsGetRelationshipByIdOptions) { + public Mono>> getRelationshipByIdNoCustomHeadersWithResponseAsync(String id, + String relationshipId, DigitalTwinsGetRelationshipByIdOptions digitalTwinsGetRelationshipByIdOptions) { return FluxUtil.withContext(context -> getRelationshipByIdNoCustomHeadersWithResponseAsync(id, relationshipId, digitalTwinsGetRelationshipByIdOptions, context)); } @@ -1143,11 +1146,12 @@ public Mono> getRelationshipByIdNoCustomHeadersWithResponseAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link Response} on successful completion of {@link Mono}. + * @return digital twin relationship along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRelationshipByIdNoCustomHeadersWithResponseAsync(String id, String relationshipId, - DigitalTwinsGetRelationshipByIdOptions digitalTwinsGetRelationshipByIdOptions, Context context) { + public Mono>> getRelationshipByIdNoCustomHeadersWithResponseAsync(String id, + String relationshipId, DigitalTwinsGetRelationshipByIdOptions digitalTwinsGetRelationshipByIdOptions, + Context context) { final String accept = "application/json"; String traceparentInternal = null; if (digitalTwinsGetRelationshipByIdOptions != null) { @@ -1185,11 +1189,11 @@ public Mono> getRelationshipByIdNoCustomHeadersWithResponseAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link ResponseBase} on successful completion of {@link Mono}. + * @return digital twin relationship along with {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> addRelationshipWithResponseAsync(String id, - String relationshipId, Object relationship, + public Mono>> addRelationshipWithResponseAsync( + String id, String relationshipId, Object relationship, DigitalTwinsAddRelationshipOptions digitalTwinsAddRelationshipOptions) { return FluxUtil.withContext(context -> addRelationshipWithResponseAsync(id, relationshipId, relationship, digitalTwinsAddRelationshipOptions, context)); @@ -1218,11 +1222,11 @@ public Mono> addRelatio * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link ResponseBase} on successful completion of {@link Mono}. + * @return digital twin relationship along with {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> addRelationshipWithResponseAsync(String id, - String relationshipId, Object relationship, + public Mono>> addRelationshipWithResponseAsync( + String id, String relationshipId, Object relationship, DigitalTwinsAddRelationshipOptions digitalTwinsAddRelationshipOptions, Context context) { final String accept = "application/json"; String traceparentInternal = null; @@ -1266,10 +1270,10 @@ public Mono> addRelatio * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object on successful completion of {@link Mono}. + * @return digital twin relationship on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono addRelationshipAsync(String id, String relationshipId, Object relationship, + public Mono> addRelationshipAsync(String id, String relationshipId, Object relationship, DigitalTwinsAddRelationshipOptions digitalTwinsAddRelationshipOptions) { return addRelationshipWithResponseAsync(id, relationshipId, relationship, digitalTwinsAddRelationshipOptions) .flatMap(res -> Mono.justOrEmpty(res.getValue())); @@ -1298,10 +1302,10 @@ public Mono addRelationshipAsync(String id, String relationshipId, Objec * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object on successful completion of {@link Mono}. + * @return digital twin relationship on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono addRelationshipAsync(String id, String relationshipId, Object relationship, + public Mono> addRelationshipAsync(String id, String relationshipId, Object relationship, DigitalTwinsAddRelationshipOptions digitalTwinsAddRelationshipOptions, Context context) { return addRelationshipWithResponseAsync(id, relationshipId, relationship, digitalTwinsAddRelationshipOptions, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); @@ -1329,11 +1333,12 @@ public Mono addRelationshipAsync(String id, String relationshipId, Objec * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link Response} on successful completion of {@link Mono}. + * @return digital twin relationship along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> addRelationshipNoCustomHeadersWithResponseAsync(String id, String relationshipId, - Object relationship, DigitalTwinsAddRelationshipOptions digitalTwinsAddRelationshipOptions) { + public Mono>> addRelationshipNoCustomHeadersWithResponseAsync(String id, + String relationshipId, Object relationship, + DigitalTwinsAddRelationshipOptions digitalTwinsAddRelationshipOptions) { return FluxUtil.withContext(context -> addRelationshipNoCustomHeadersWithResponseAsync(id, relationshipId, relationship, digitalTwinsAddRelationshipOptions, context)); } @@ -1361,11 +1366,12 @@ public Mono> addRelationshipNoCustomHeadersWithResponseAsync(St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link Response} on successful completion of {@link Mono}. + * @return digital twin relationship along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> addRelationshipNoCustomHeadersWithResponseAsync(String id, String relationshipId, - Object relationship, DigitalTwinsAddRelationshipOptions digitalTwinsAddRelationshipOptions, Context context) { + public Mono>> addRelationshipNoCustomHeadersWithResponseAsync(String id, + String relationshipId, Object relationship, + DigitalTwinsAddRelationshipOptions digitalTwinsAddRelationshipOptions, Context context) { final String accept = "application/json"; String traceparentInternal = null; if (digitalTwinsAddRelationshipOptions != null) { @@ -2160,11 +2166,11 @@ public Mono sendComponentTelemetryAsync(String id, String componentPath, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link ResponseBase} on successful completion of {@link Mono}. + * @return digital twin component along with {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getComponentWithResponseAsync(String id, - String componentPath, DigitalTwinsGetComponentOptions digitalTwinsGetComponentOptions) { + public Mono>> getComponentWithResponseAsync( + String id, String componentPath, DigitalTwinsGetComponentOptions digitalTwinsGetComponentOptions) { return FluxUtil.withContext( context -> getComponentWithResponseAsync(id, componentPath, digitalTwinsGetComponentOptions, context)); } @@ -2186,11 +2192,12 @@ public Mono> getComponentW * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link ResponseBase} on successful completion of {@link Mono}. + * @return digital twin component along with {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getComponentWithResponseAsync(String id, - String componentPath, DigitalTwinsGetComponentOptions digitalTwinsGetComponentOptions, Context context) { + public Mono>> getComponentWithResponseAsync( + String id, String componentPath, DigitalTwinsGetComponentOptions digitalTwinsGetComponentOptions, + Context context) { final String accept = "application/json"; String traceparentInternal = null; if (digitalTwinsGetComponentOptions != null) { @@ -2222,10 +2229,10 @@ public Mono> getComponentW * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object on successful completion of {@link Mono}. + * @return digital twin component on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getComponentAsync(String id, String componentPath, + public Mono> getComponentAsync(String id, String componentPath, DigitalTwinsGetComponentOptions digitalTwinsGetComponentOptions) { return getComponentWithResponseAsync(id, componentPath, digitalTwinsGetComponentOptions) .flatMap(res -> Mono.justOrEmpty(res.getValue())); @@ -2248,10 +2255,10 @@ public Mono getComponentAsync(String id, String componentPath, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object on successful completion of {@link Mono}. + * @return digital twin component on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getComponentAsync(String id, String componentPath, + public Mono> getComponentAsync(String id, String componentPath, DigitalTwinsGetComponentOptions digitalTwinsGetComponentOptions, Context context) { return getComponentWithResponseAsync(id, componentPath, digitalTwinsGetComponentOptions, context) .flatMap(res -> Mono.justOrEmpty(res.getValue())); @@ -2273,11 +2280,11 @@ public Mono getComponentAsync(String id, String componentPath, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link Response} on successful completion of {@link Mono}. + * @return digital twin component along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getComponentNoCustomHeadersWithResponseAsync(String id, String componentPath, - DigitalTwinsGetComponentOptions digitalTwinsGetComponentOptions) { + public Mono>> getComponentNoCustomHeadersWithResponseAsync(String id, + String componentPath, DigitalTwinsGetComponentOptions digitalTwinsGetComponentOptions) { return FluxUtil.withContext(context -> getComponentNoCustomHeadersWithResponseAsync(id, componentPath, digitalTwinsGetComponentOptions, context)); } @@ -2299,11 +2306,11 @@ public Mono> getComponentNoCustomHeadersWithResponseAsync(Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link Response} on successful completion of {@link Mono}. + * @return digital twin component along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getComponentNoCustomHeadersWithResponseAsync(String id, String componentPath, - DigitalTwinsGetComponentOptions digitalTwinsGetComponentOptions, Context context) { + public Mono>> getComponentNoCustomHeadersWithResponseAsync(String id, + String componentPath, DigitalTwinsGetComponentOptions digitalTwinsGetComponentOptions, Context context) { final String accept = "application/json"; String traceparentInternal = null; if (digitalTwinsGetComponentOptions != null) { diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/ImportJobsImpl.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/ImportJobsImpl.java new file mode 100644 index 000000000000..184b1f04eda5 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/ImportJobsImpl.java @@ -0,0 +1,616 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.digitaltwins.core.implementation.models.ErrorResponseException; +import com.azure.digitaltwins.core.implementation.models.ImportJob; +import com.azure.digitaltwins.core.implementation.models.ImportJobCollection; +import com.azure.digitaltwins.core.implementation.models.ImportJobsAddOptions; +import com.azure.digitaltwins.core.implementation.models.ImportJobsCancelOptions; +import com.azure.digitaltwins.core.implementation.models.ImportJobsDeleteOptions; +import com.azure.digitaltwins.core.implementation.models.ImportJobsGetByIdOptions; +import com.azure.digitaltwins.core.implementation.models.ImportJobsListOptions; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ImportJobs. + */ +public final class ImportJobsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ImportJobsService service; + + /** + * The service client containing this operation class. + */ + private final AzureDigitalTwinsAPIImpl client; + + /** + * Initializes an instance of ImportJobsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ImportJobsImpl(AzureDigitalTwinsAPIImpl client) { + this.service + = RestProxy.create(ImportJobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureDigitalTwinsAPIImportJobs to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureDigitalTwinsAPI") + public interface ImportJobsService { + @Get("/jobs/imports") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> list(@HostParam("$host") String host, + @HeaderParam("traceparent") String traceparent, @HeaderParam("tracestate") String tracestate, + @HeaderParam("max-items-per-page") Integer maxItemsPerPage, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Put("/jobs/imports/{id}") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> add(@HostParam("$host") String host, @HeaderParam("traceparent") String traceparent, + @HeaderParam("tracestate") String tracestate, @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ImportJob importJob, + @HeaderParam("Accept") String accept, Context context); + + @Get("/jobs/imports/{id}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> getById(@HostParam("$host") String host, + @HeaderParam("traceparent") String traceparent, @HeaderParam("tracestate") String tracestate, + @PathParam("id") String id, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Delete("/jobs/imports/{id}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> delete(@HostParam("$host") String host, @HeaderParam("traceparent") String traceparent, + @HeaderParam("tracestate") String tracestate, @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Post("/jobs/imports/{id}/cancel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> cancel(@HostParam("$host") String host, + @HeaderParam("traceparent") String traceparent, @HeaderParam("tracestate") String tracestate, + @PathParam("id") String id, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ErrorResponseException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String host, @HeaderParam("traceparent") String traceparent, + @HeaderParam("tracestate") String tracestate, @HeaderParam("max-items-per-page") Integer maxItemsPerPage, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Retrieves all import jobs. + * Status codes: + * * 200 OK. + * + * @param importJobsListOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of import job objects along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync(ImportJobsListOptions importJobsListOptions, + Context context) { + final String accept = "application/json"; + String traceparentInternal = null; + if (importJobsListOptions != null) { + traceparentInternal = importJobsListOptions.getTraceparent(); + } + String traceparent = traceparentInternal; + String tracestateInternal = null; + if (importJobsListOptions != null) { + tracestateInternal = importJobsListOptions.getTracestate(); + } + String tracestate = tracestateInternal; + Integer maxItemsPerPageInternal = null; + if (importJobsListOptions != null) { + maxItemsPerPageInternal = importJobsListOptions.getMaxItemsPerPage(); + } + Integer maxItemsPerPage = maxItemsPerPageInternal; + return service + .list(this.client.getHost(), traceparent, tracestate, maxItemsPerPage, this.client.getApiVersion(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getValue(), res.getValue().getNextLink(), null)); + } + + /** + * Retrieves all import jobs. + * Status codes: + * * 200 OK. + * + * @param importJobsListOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of import job objects as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(ImportJobsListOptions importJobsListOptions, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(importJobsListOptions, context), + nextLink -> listNextSinglePageAsync(nextLink, importJobsListOptions, context)); + } + + /** + * Creates an import job. + * Status codes: + * * 201 Created + * * 400 Bad Request + * * JobLimitReached - The maximum number of import jobs allowed has been reached. + * * ValidationFailed - The import job request is not valid. + * + * @param id The id for the import job. The id is unique within the service and case sensitive. + * @param importJob The import job being added. + * @param importJobsAddOptions Parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a job which contains a reference to the operations to perform, results, and execution metadata along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addWithResponseAsync(String id, ImportJob importJob, + ImportJobsAddOptions importJobsAddOptions) { + return FluxUtil.withContext(context -> addWithResponseAsync(id, importJob, importJobsAddOptions, context)); + } + + /** + * Creates an import job. + * Status codes: + * * 201 Created + * * 400 Bad Request + * * JobLimitReached - The maximum number of import jobs allowed has been reached. + * * ValidationFailed - The import job request is not valid. + * + * @param id The id for the import job. The id is unique within the service and case sensitive. + * @param importJob The import job being added. + * @param importJobsAddOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a job which contains a reference to the operations to perform, results, and execution metadata along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addWithResponseAsync(String id, ImportJob importJob, + ImportJobsAddOptions importJobsAddOptions, Context context) { + final String accept = "application/json"; + String traceparentInternal = null; + if (importJobsAddOptions != null) { + traceparentInternal = importJobsAddOptions.getTraceparent(); + } + String traceparent = traceparentInternal; + String tracestateInternal = null; + if (importJobsAddOptions != null) { + tracestateInternal = importJobsAddOptions.getTracestate(); + } + String tracestate = tracestateInternal; + return service.add(this.client.getHost(), traceparent, tracestate, id, this.client.getApiVersion(), importJob, + accept, context); + } + + /** + * Creates an import job. + * Status codes: + * * 201 Created + * * 400 Bad Request + * * JobLimitReached - The maximum number of import jobs allowed has been reached. + * * ValidationFailed - The import job request is not valid. + * + * @param id The id for the import job. The id is unique within the service and case sensitive. + * @param importJob The import job being added. + * @param importJobsAddOptions Parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a job which contains a reference to the operations to perform, results, and execution metadata on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono addAsync(String id, ImportJob importJob, ImportJobsAddOptions importJobsAddOptions) { + return addWithResponseAsync(id, importJob, importJobsAddOptions) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates an import job. + * Status codes: + * * 201 Created + * * 400 Bad Request + * * JobLimitReached - The maximum number of import jobs allowed has been reached. + * * ValidationFailed - The import job request is not valid. + * + * @param id The id for the import job. The id is unique within the service and case sensitive. + * @param importJob The import job being added. + * @param importJobsAddOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a job which contains a reference to the operations to perform, results, and execution metadata on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono addAsync(String id, ImportJob importJob, ImportJobsAddOptions importJobsAddOptions, + Context context) { + return addWithResponseAsync(id, importJob, importJobsAddOptions, context) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves an import job. + * Status codes: + * * 200 OK + * * 404 Not Found + * * ImportJobNotFound - The import job was not found. + * + * @param id The id for the import job. The id is unique within the service and case sensitive. + * @param importJobsGetByIdOptions Parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a job which contains a reference to the operations to perform, results, and execution metadata along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByIdWithResponseAsync(String id, + ImportJobsGetByIdOptions importJobsGetByIdOptions) { + return FluxUtil.withContext(context -> getByIdWithResponseAsync(id, importJobsGetByIdOptions, context)); + } + + /** + * Retrieves an import job. + * Status codes: + * * 200 OK + * * 404 Not Found + * * ImportJobNotFound - The import job was not found. + * + * @param id The id for the import job. The id is unique within the service and case sensitive. + * @param importJobsGetByIdOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a job which contains a reference to the operations to perform, results, and execution metadata along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByIdWithResponseAsync(String id, + ImportJobsGetByIdOptions importJobsGetByIdOptions, Context context) { + final String accept = "application/json"; + String traceparentInternal = null; + if (importJobsGetByIdOptions != null) { + traceparentInternal = importJobsGetByIdOptions.getTraceparent(); + } + String traceparent = traceparentInternal; + String tracestateInternal = null; + if (importJobsGetByIdOptions != null) { + tracestateInternal = importJobsGetByIdOptions.getTracestate(); + } + String tracestate = tracestateInternal; + return service.getById(this.client.getHost(), traceparent, tracestate, id, this.client.getApiVersion(), accept, + context); + } + + /** + * Retrieves an import job. + * Status codes: + * * 200 OK + * * 404 Not Found + * * ImportJobNotFound - The import job was not found. + * + * @param id The id for the import job. The id is unique within the service and case sensitive. + * @param importJobsGetByIdOptions Parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a job which contains a reference to the operations to perform, results, and execution metadata on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByIdAsync(String id, ImportJobsGetByIdOptions importJobsGetByIdOptions) { + return getByIdWithResponseAsync(id, importJobsGetByIdOptions).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves an import job. + * Status codes: + * * 200 OK + * * 404 Not Found + * * ImportJobNotFound - The import job was not found. + * + * @param id The id for the import job. The id is unique within the service and case sensitive. + * @param importJobsGetByIdOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a job which contains a reference to the operations to perform, results, and execution metadata on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByIdAsync(String id, ImportJobsGetByIdOptions importJobsGetByIdOptions, Context context) { + return getByIdWithResponseAsync(id, importJobsGetByIdOptions, context) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Deletes an import job. This is simply used to remove a job id, so it may be reused later. It can not be used to + * stop entities from being imported. + * Status codes: + * * 204 No Content + * * 400 Bad Request + * * ValidationFailed - The import job request is not valid. + * + * @param id The id for the import job. The id is unique within the service and case sensitive. + * @param importJobsDeleteOptions Parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync(String id, ImportJobsDeleteOptions importJobsDeleteOptions) { + return FluxUtil.withContext(context -> deleteWithResponseAsync(id, importJobsDeleteOptions, context)); + } + + /** + * Deletes an import job. This is simply used to remove a job id, so it may be reused later. It can not be used to + * stop entities from being imported. + * Status codes: + * * 204 No Content + * * 400 Bad Request + * * ValidationFailed - The import job request is not valid. + * + * @param id The id for the import job. The id is unique within the service and case sensitive. + * @param importJobsDeleteOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync(String id, ImportJobsDeleteOptions importJobsDeleteOptions, + Context context) { + final String accept = "application/json"; + String traceparentInternal = null; + if (importJobsDeleteOptions != null) { + traceparentInternal = importJobsDeleteOptions.getTraceparent(); + } + String traceparent = traceparentInternal; + String tracestateInternal = null; + if (importJobsDeleteOptions != null) { + tracestateInternal = importJobsDeleteOptions.getTracestate(); + } + String tracestate = tracestateInternal; + return service.delete(this.client.getHost(), traceparent, tracestate, id, this.client.getApiVersion(), accept, + context); + } + + /** + * Deletes an import job. This is simply used to remove a job id, so it may be reused later. It can not be used to + * stop entities from being imported. + * Status codes: + * * 204 No Content + * * 400 Bad Request + * * ValidationFailed - The import job request is not valid. + * + * @param id The id for the import job. The id is unique within the service and case sensitive. + * @param importJobsDeleteOptions Parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String id, ImportJobsDeleteOptions importJobsDeleteOptions) { + return deleteWithResponseAsync(id, importJobsDeleteOptions).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes an import job. This is simply used to remove a job id, so it may be reused later. It can not be used to + * stop entities from being imported. + * Status codes: + * * 204 No Content + * * 400 Bad Request + * * ValidationFailed - The import job request is not valid. + * + * @param id The id for the import job. The id is unique within the service and case sensitive. + * @param importJobsDeleteOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String id, ImportJobsDeleteOptions importJobsDeleteOptions, Context context) { + return deleteWithResponseAsync(id, importJobsDeleteOptions, context).flatMap(ignored -> Mono.empty()); + } + + /** + * Cancels an import job that is currently running. Service will stop any import operations triggered by the current + * import job that are in progress, and go to a cancelled state. Please note that this will leave your instance in + * an unknown state as there won't be any rollback operation. + * Status codes: + * * 200 Request Accepted + * * 400 Bad Request + * * ValidationFailed - The import job request is not valid. + * + * @param id The id for the import job. The id is unique within the service and case sensitive. + * @param importJobsCancelOptions Parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a job which contains a reference to the operations to perform, results, and execution metadata along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> cancelWithResponseAsync(String id, + ImportJobsCancelOptions importJobsCancelOptions) { + return FluxUtil.withContext(context -> cancelWithResponseAsync(id, importJobsCancelOptions, context)); + } + + /** + * Cancels an import job that is currently running. Service will stop any import operations triggered by the current + * import job that are in progress, and go to a cancelled state. Please note that this will leave your instance in + * an unknown state as there won't be any rollback operation. + * Status codes: + * * 200 Request Accepted + * * 400 Bad Request + * * ValidationFailed - The import job request is not valid. + * + * @param id The id for the import job. The id is unique within the service and case sensitive. + * @param importJobsCancelOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a job which contains a reference to the operations to perform, results, and execution metadata along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> cancelWithResponseAsync(String id, ImportJobsCancelOptions importJobsCancelOptions, + Context context) { + final String accept = "application/json"; + String traceparentInternal = null; + if (importJobsCancelOptions != null) { + traceparentInternal = importJobsCancelOptions.getTraceparent(); + } + String traceparent = traceparentInternal; + String tracestateInternal = null; + if (importJobsCancelOptions != null) { + tracestateInternal = importJobsCancelOptions.getTracestate(); + } + String tracestate = tracestateInternal; + return service.cancel(this.client.getHost(), traceparent, tracestate, id, this.client.getApiVersion(), accept, + context); + } + + /** + * Cancels an import job that is currently running. Service will stop any import operations triggered by the current + * import job that are in progress, and go to a cancelled state. Please note that this will leave your instance in + * an unknown state as there won't be any rollback operation. + * Status codes: + * * 200 Request Accepted + * * 400 Bad Request + * * ValidationFailed - The import job request is not valid. + * + * @param id The id for the import job. The id is unique within the service and case sensitive. + * @param importJobsCancelOptions Parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a job which contains a reference to the operations to perform, results, and execution metadata on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono cancelAsync(String id, ImportJobsCancelOptions importJobsCancelOptions) { + return cancelWithResponseAsync(id, importJobsCancelOptions).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Cancels an import job that is currently running. Service will stop any import operations triggered by the current + * import job that are in progress, and go to a cancelled state. Please note that this will leave your instance in + * an unknown state as there won't be any rollback operation. + * Status codes: + * * 200 Request Accepted + * * 400 Bad Request + * * ValidationFailed - The import job request is not valid. + * + * @param id The id for the import job. The id is unique within the service and case sensitive. + * @param importJobsCancelOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a job which contains a reference to the operations to perform, results, and execution metadata on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono cancelAsync(String id, ImportJobsCancelOptions importJobsCancelOptions, Context context) { + return cancelWithResponseAsync(id, importJobsCancelOptions, context) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param importJobsListOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of import job objects along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink, + ImportJobsListOptions importJobsListOptions, Context context) { + final String accept = "application/json"; + String traceparentInternal = null; + if (importJobsListOptions != null) { + traceparentInternal = importJobsListOptions.getTraceparent(); + } + String traceparent = traceparentInternal; + String tracestateInternal = null; + if (importJobsListOptions != null) { + tracestateInternal = importJobsListOptions.getTracestate(); + } + String tracestate = tracestateInternal; + Integer maxItemsPerPageInternal = null; + if (importJobsListOptions != null) { + maxItemsPerPageInternal = importJobsListOptions.getMaxItemsPerPage(); + } + Integer maxItemsPerPage = maxItemsPerPageInternal; + return service + .listNext(nextLink, this.client.getHost(), traceparent, tracestate, maxItemsPerPage, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getValue(), res.getValue().getNextLink(), null)); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJob.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJob.java new file mode 100644 index 000000000000..0c6b700dce6c --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJob.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * A job which contains a reference to the operations to perform, results, and execution metadata. + */ +@Fluent +public final class DeleteJob implements JsonSerializable { + /* + * The identifier of the delete job. + */ + private String id; + + /* + * Status of the job. + */ + private DeleteJobStatus status; + + /* + * Start time of the job. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. + */ + private OffsetDateTime createdDateTime; + + /* + * End time of the job. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. + */ + private OffsetDateTime finishedDateTime; + + /* + * Time at which job will be purged by the service from the system. The timestamp is in RFC3339 format: + * `yyyy-MM-ddTHH:mm:ssZ`. + */ + private OffsetDateTime purgeDateTime; + + /* + * Details of the error(s) that occurred executing the import job. + */ + private Error error; + + /** + * Creates an instance of DeleteJob class. + */ + public DeleteJob() { + } + + /** + * Get the id property: The identifier of the delete job. + * + * @return the id value. + */ + public String getId() { + return this.id; + } + + /** + * Get the status property: Status of the job. + * + * @return the status value. + */ + public DeleteJobStatus getStatus() { + return this.status; + } + + /** + * Get the createdDateTime property: Start time of the job. The timestamp is in RFC3339 format: + * `yyyy-MM-ddTHH:mm:ssZ`. + * + * @return the createdDateTime value. + */ + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the finishedDateTime property: End time of the job. The timestamp is in RFC3339 format: + * `yyyy-MM-ddTHH:mm:ssZ`. + * + * @return the finishedDateTime value. + */ + public OffsetDateTime getFinishedDateTime() { + return this.finishedDateTime; + } + + /** + * Get the purgeDateTime property: Time at which job will be purged by the service from the system. The timestamp is + * in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. + * + * @return the purgeDateTime value. + */ + public OffsetDateTime getPurgeDateTime() { + return this.purgeDateTime; + } + + /** + * Get the error property: Details of the error(s) that occurred executing the import job. + * + * @return the error value. + */ + public Error getError() { + return this.error; + } + + /** + * Set the error property: Details of the error(s) that occurred executing the import job. + * + * @param error the error value to set. + * @return the DeleteJob object itself. + */ + public DeleteJob setError(Error error) { + this.error = error; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeleteJob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeleteJob 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 DeleteJob. + */ + public static DeleteJob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeleteJob deserializedDeleteJob = new DeleteJob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDeleteJob.id = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedDeleteJob.status = DeleteJobStatus.fromString(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + deserializedDeleteJob.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("finishedDateTime".equals(fieldName)) { + deserializedDeleteJob.finishedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("purgeDateTime".equals(fieldName)) { + deserializedDeleteJob.purgeDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("error".equals(fieldName)) { + deserializedDeleteJob.error = Error.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDeleteJob; + }); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobCollection.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobCollection.java new file mode 100644 index 000000000000..85e512e19c66 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobCollection.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.implementation.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 java.io.IOException; +import java.util.List; + +/** + * A collection of delete job objects. + */ +@Fluent +public final class DeleteJobCollection implements JsonSerializable { + /* + * The list of delete job objects. + */ + private final List value; + + /* + * A URI to retrieve the next page of results. + */ + private String nextLink; + + /** + * Creates an instance of DeleteJobCollection class. + * + * @param value the value value to set. + */ + public DeleteJobCollection(List value) { + this.value = value; + } + + /** + * Get the value property: The list of delete job objects. + * + * @return the value value. + */ + public List getValue() { + return this.value; + } + + /** + * Get the nextLink property: A URI to retrieve the next page of results. + * + * @return the nextLink value. + */ + public String getNextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: A URI to retrieve the next page of results. + * + * @param nextLink the nextLink value to set. + * @return the DeleteJobCollection object itself. + */ + public DeleteJobCollection setNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeleteJobCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeleteJobCollection 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 DeleteJobCollection. + */ + public static DeleteJobCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + boolean valueFound = false; + List value = null; + String nextLink = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + value = reader.readArray(reader1 -> DeleteJob.fromJson(reader1)); + valueFound = true; + } else if ("nextLink".equals(fieldName)) { + nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + if (valueFound) { + DeleteJobCollection deserializedDeleteJobCollection = new DeleteJobCollection(value); + deserializedDeleteJobCollection.nextLink = nextLink; + + return deserializedDeleteJobCollection; + } + throw new IllegalStateException("Missing required property: value"); + }); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobStatus.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobStatus.java new file mode 100644 index 000000000000..a750ffae4e84 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobStatus.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.implementation.models; + +/** + * Status of the job. + */ +public enum DeleteJobStatus { + /** + * Enum value notstarted. + */ + NOTSTARTED("notstarted"), + + /** + * Enum value running. + */ + RUNNING("running"), + + /** + * Enum value failed. + */ + FAILED("failed"), + + /** + * Enum value succeeded. + */ + SUCCEEDED("succeeded"); + + /** + * The actual serialized value for a DeleteJobStatus instance. + */ + private final String value; + + DeleteJobStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DeleteJobStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed DeleteJobStatus object, or null if unable to parse. + */ + public static DeleteJobStatus fromString(String value) { + if (value == null) { + return null; + } + DeleteJobStatus[] items = DeleteJobStatus.values(); + for (DeleteJobStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobsAddHeaders.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobsAddHeaders.java new file mode 100644 index 000000000000..38260b7d5af0 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobsAddHeaders.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; + +/** + * The DeleteJobsAddHeaders model. + */ +@Fluent +public final class DeleteJobsAddHeaders { + /* + * The Operation-Location property. + */ + private String operationLocation; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of DeleteJobsAddHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public DeleteJobsAddHeaders(HttpHeaders rawHeaders) { + this.operationLocation = rawHeaders.getValue(HttpHeaderName.OPERATION_LOCATION); + } + + /** + * Get the operationLocation property: The Operation-Location property. + * + * @return the operationLocation value. + */ + public String getOperationLocation() { + return this.operationLocation; + } + + /** + * Set the operationLocation property: The Operation-Location property. + * + * @param operationLocation the operationLocation value to set. + * @return the DeleteJobsAddHeaders object itself. + */ + public DeleteJobsAddHeaders setOperationLocation(String operationLocation) { + this.operationLocation = operationLocation; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobsAddOptions.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobsAddOptions.java new file mode 100644 index 000000000000..0b0d89273650 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobsAddOptions.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.implementation.models; + +import com.azure.core.annotation.Fluent; + +/** + * Parameter group. + */ +@Fluent +public final class DeleteJobsAddOptions { + /* + * Identifies the request in a distributed tracing system. + */ + private String traceparent; + + /* + * Provides vendor-specific trace identification information and is a companion to traceparent. + */ + private String tracestate; + + /** + * Creates an instance of DeleteJobsAddOptions class. + */ + public DeleteJobsAddOptions() { + } + + /** + * Get the traceparent property: Identifies the request in a distributed tracing system. + * + * @return the traceparent value. + */ + public String getTraceparent() { + return this.traceparent; + } + + /** + * Set the traceparent property: Identifies the request in a distributed tracing system. + * + * @param traceparent the traceparent value to set. + * @return the DeleteJobsAddOptions object itself. + */ + public DeleteJobsAddOptions setTraceparent(String traceparent) { + this.traceparent = traceparent; + return this; + } + + /** + * Get the tracestate property: Provides vendor-specific trace identification information and is a companion to + * traceparent. + * + * @return the tracestate value. + */ + public String getTracestate() { + return this.tracestate; + } + + /** + * Set the tracestate property: Provides vendor-specific trace identification information and is a companion to + * traceparent. + * + * @param tracestate the tracestate value to set. + * @return the DeleteJobsAddOptions object itself. + */ + public DeleteJobsAddOptions setTracestate(String tracestate) { + this.tracestate = tracestate; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobsGetByIdOptions.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobsGetByIdOptions.java new file mode 100644 index 000000000000..d726a67d1184 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobsGetByIdOptions.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.implementation.models; + +import com.azure.core.annotation.Fluent; + +/** + * Parameter group. + */ +@Fluent +public final class DeleteJobsGetByIdOptions { + /* + * Identifies the request in a distributed tracing system. + */ + private String traceparent; + + /* + * Provides vendor-specific trace identification information and is a companion to traceparent. + */ + private String tracestate; + + /** + * Creates an instance of DeleteJobsGetByIdOptions class. + */ + public DeleteJobsGetByIdOptions() { + } + + /** + * Get the traceparent property: Identifies the request in a distributed tracing system. + * + * @return the traceparent value. + */ + public String getTraceparent() { + return this.traceparent; + } + + /** + * Set the traceparent property: Identifies the request in a distributed tracing system. + * + * @param traceparent the traceparent value to set. + * @return the DeleteJobsGetByIdOptions object itself. + */ + public DeleteJobsGetByIdOptions setTraceparent(String traceparent) { + this.traceparent = traceparent; + return this; + } + + /** + * Get the tracestate property: Provides vendor-specific trace identification information and is a companion to + * traceparent. + * + * @return the tracestate value. + */ + public String getTracestate() { + return this.tracestate; + } + + /** + * Set the tracestate property: Provides vendor-specific trace identification information and is a companion to + * traceparent. + * + * @param tracestate the tracestate value to set. + * @return the DeleteJobsGetByIdOptions object itself. + */ + public DeleteJobsGetByIdOptions setTracestate(String tracestate) { + this.tracestate = tracestate; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobsListOptions.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobsListOptions.java new file mode 100644 index 000000000000..f009de5cb09b --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/DeleteJobsListOptions.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.implementation.models; + +import com.azure.core.annotation.Fluent; + +/** + * Parameter group. + */ +@Fluent +public final class DeleteJobsListOptions { + /* + * Identifies the request in a distributed tracing system. + */ + private String traceparent; + + /* + * Provides vendor-specific trace identification information and is a companion to traceparent. + */ + private String tracestate; + + /* + * The maximum number of items to retrieve per request. The server may choose to return less than the requested + * number. + */ + private Integer maxItemsPerPage; + + /** + * Creates an instance of DeleteJobsListOptions class. + */ + public DeleteJobsListOptions() { + } + + /** + * Get the traceparent property: Identifies the request in a distributed tracing system. + * + * @return the traceparent value. + */ + public String getTraceparent() { + return this.traceparent; + } + + /** + * Set the traceparent property: Identifies the request in a distributed tracing system. + * + * @param traceparent the traceparent value to set. + * @return the DeleteJobsListOptions object itself. + */ + public DeleteJobsListOptions setTraceparent(String traceparent) { + this.traceparent = traceparent; + return this; + } + + /** + * Get the tracestate property: Provides vendor-specific trace identification information and is a companion to + * traceparent. + * + * @return the tracestate value. + */ + public String getTracestate() { + return this.tracestate; + } + + /** + * Set the tracestate property: Provides vendor-specific trace identification information and is a companion to + * traceparent. + * + * @param tracestate the tracestate value to set. + * @return the DeleteJobsListOptions object itself. + */ + public DeleteJobsListOptions setTracestate(String tracestate) { + this.tracestate = tracestate; + return this; + } + + /** + * Get the maxItemsPerPage property: The maximum number of items to retrieve per request. The server may choose to + * return less than the requested number. + * + * @return the maxItemsPerPage value. + */ + public Integer getMaxItemsPerPage() { + return this.maxItemsPerPage; + } + + /** + * Set the maxItemsPerPage property: The maximum number of items to retrieve per request. The server may choose to + * return less than the requested number. + * + * @param maxItemsPerPage the maxItemsPerPage value to set. + * @return the DeleteJobsListOptions object itself. + */ + public DeleteJobsListOptions setMaxItemsPerPage(Integer maxItemsPerPage) { + this.maxItemsPerPage = maxItemsPerPage; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJob.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJob.java new file mode 100644 index 000000000000..b541e495f5ba --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJob.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; + +/** + * A job which contains a reference to the operations to perform, results, and execution metadata. + */ +@Fluent +public final class ImportJob implements JsonSerializable { + /* + * The identifier of the import job. + */ + private String id; + + /* + * The path to the input Azure storage blob that contains file(s) describing the operations to perform in the job. + */ + private final String inputBlobUri; + + /* + * The path to the output Azure storage blob that will contain the errors and progress logs of import job. + */ + private final String outputBlobUri; + + /* + * Status of the job. + */ + private Status status; + + /* + * Start time of the job. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. + */ + private OffsetDateTime createdDateTime; + + /* + * Last time service performed any action from the job. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. + */ + private OffsetDateTime lastActionDateTime; + + /* + * End time of the job. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. + */ + private OffsetDateTime finishedDateTime; + + /* + * Time at which job will be purged by the service from the system. The timestamp is in RFC3339 format: + * `yyyy-MM-ddTHH:mm:ssZ`. + */ + private OffsetDateTime purgeDateTime; + + /* + * Details of the error(s) that occurred executing the import job. + */ + private Error error; + + /** + * Creates an instance of ImportJob class. + * + * @param inputBlobUri the inputBlobUri value to set. + * @param outputBlobUri the outputBlobUri value to set. + */ + public ImportJob(String inputBlobUri, String outputBlobUri) { + this.inputBlobUri = inputBlobUri; + this.outputBlobUri = outputBlobUri; + } + + /** + * Get the id property: The identifier of the import job. + * + * @return the id value. + */ + public String getId() { + return this.id; + } + + /** + * Get the inputBlobUri property: The path to the input Azure storage blob that contains file(s) describing the + * operations to perform in the job. + * + * @return the inputBlobUri value. + */ + public String getInputBlobUri() { + return this.inputBlobUri; + } + + /** + * Get the outputBlobUri property: The path to the output Azure storage blob that will contain the errors and + * progress logs of import job. + * + * @return the outputBlobUri value. + */ + public String getOutputBlobUri() { + return this.outputBlobUri; + } + + /** + * Get the status property: Status of the job. + * + * @return the status value. + */ + public Status getStatus() { + return this.status; + } + + /** + * Get the createdDateTime property: Start time of the job. The timestamp is in RFC3339 format: + * `yyyy-MM-ddTHH:mm:ssZ`. + * + * @return the createdDateTime value. + */ + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the lastActionDateTime property: Last time service performed any action from the job. The timestamp is in + * RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. + * + * @return the lastActionDateTime value. + */ + public OffsetDateTime getLastActionDateTime() { + return this.lastActionDateTime; + } + + /** + * Get the finishedDateTime property: End time of the job. The timestamp is in RFC3339 format: + * `yyyy-MM-ddTHH:mm:ssZ`. + * + * @return the finishedDateTime value. + */ + public OffsetDateTime getFinishedDateTime() { + return this.finishedDateTime; + } + + /** + * Get the purgeDateTime property: Time at which job will be purged by the service from the system. The timestamp is + * in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`. + * + * @return the purgeDateTime value. + */ + public OffsetDateTime getPurgeDateTime() { + return this.purgeDateTime; + } + + /** + * Get the error property: Details of the error(s) that occurred executing the import job. + * + * @return the error value. + */ + public Error getError() { + return this.error; + } + + /** + * Set the error property: Details of the error(s) that occurred executing the import job. + * + * @param error the error value to set. + * @return the ImportJob object itself. + */ + public ImportJob setError(Error error) { + this.error = error; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("inputBlobUri", this.inputBlobUri); + jsonWriter.writeStringField("outputBlobUri", this.outputBlobUri); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImportJob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImportJob 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 ImportJob. + */ + public static ImportJob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + boolean inputBlobUriFound = false; + String inputBlobUri = null; + boolean outputBlobUriFound = false; + String outputBlobUri = null; + String id = null; + Status status = null; + OffsetDateTime createdDateTime = null; + OffsetDateTime lastActionDateTime = null; + OffsetDateTime finishedDateTime = null; + OffsetDateTime purgeDateTime = null; + Error error = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("inputBlobUri".equals(fieldName)) { + inputBlobUri = reader.getString(); + inputBlobUriFound = true; + } else if ("outputBlobUri".equals(fieldName)) { + outputBlobUri = reader.getString(); + outputBlobUriFound = true; + } else if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("status".equals(fieldName)) { + status = Status.fromString(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastActionDateTime".equals(fieldName)) { + lastActionDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("finishedDateTime".equals(fieldName)) { + finishedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("purgeDateTime".equals(fieldName)) { + purgeDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("error".equals(fieldName)) { + error = Error.fromJson(reader); + } else { + reader.skipChildren(); + } + } + if (inputBlobUriFound && outputBlobUriFound) { + ImportJob deserializedImportJob = new ImportJob(inputBlobUri, outputBlobUri); + deserializedImportJob.id = id; + deserializedImportJob.status = status; + deserializedImportJob.createdDateTime = createdDateTime; + deserializedImportJob.lastActionDateTime = lastActionDateTime; + deserializedImportJob.finishedDateTime = finishedDateTime; + deserializedImportJob.purgeDateTime = purgeDateTime; + deserializedImportJob.error = error; + + return deserializedImportJob; + } + List missingProperties = new ArrayList<>(); + if (!inputBlobUriFound) { + missingProperties.add("inputBlobUri"); + } + if (!outputBlobUriFound) { + missingProperties.add("outputBlobUri"); + } + + throw new IllegalStateException( + "Missing required property/properties: " + String.join(", ", missingProperties)); + }); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobCollection.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobCollection.java new file mode 100644 index 000000000000..356861b9fdab --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobCollection.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.implementation.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 java.io.IOException; +import java.util.List; + +/** + * A collection of import job objects. + */ +@Fluent +public final class ImportJobCollection implements JsonSerializable { + /* + * The list of import job objects. + */ + private final List value; + + /* + * A URI to retrieve the next page of results. + */ + private String nextLink; + + /** + * Creates an instance of ImportJobCollection class. + * + * @param value the value value to set. + */ + public ImportJobCollection(List value) { + this.value = value; + } + + /** + * Get the value property: The list of import job objects. + * + * @return the value value. + */ + public List getValue() { + return this.value; + } + + /** + * Get the nextLink property: A URI to retrieve the next page of results. + * + * @return the nextLink value. + */ + public String getNextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: A URI to retrieve the next page of results. + * + * @param nextLink the nextLink value to set. + * @return the ImportJobCollection object itself. + */ + public ImportJobCollection setNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImportJobCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImportJobCollection 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 ImportJobCollection. + */ + public static ImportJobCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + boolean valueFound = false; + List value = null; + String nextLink = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + value = reader.readArray(reader1 -> ImportJob.fromJson(reader1)); + valueFound = true; + } else if ("nextLink".equals(fieldName)) { + nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + if (valueFound) { + ImportJobCollection deserializedImportJobCollection = new ImportJobCollection(value); + deserializedImportJobCollection.nextLink = nextLink; + + return deserializedImportJobCollection; + } + throw new IllegalStateException("Missing required property: value"); + }); + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobsAddOptions.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobsAddOptions.java new file mode 100644 index 000000000000..bee07cec9974 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobsAddOptions.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.implementation.models; + +import com.azure.core.annotation.Fluent; + +/** + * Parameter group. + */ +@Fluent +public final class ImportJobsAddOptions { + /* + * Identifies the request in a distributed tracing system. + */ + private String traceparent; + + /* + * Provides vendor-specific trace identification information and is a companion to traceparent. + */ + private String tracestate; + + /** + * Creates an instance of ImportJobsAddOptions class. + */ + public ImportJobsAddOptions() { + } + + /** + * Get the traceparent property: Identifies the request in a distributed tracing system. + * + * @return the traceparent value. + */ + public String getTraceparent() { + return this.traceparent; + } + + /** + * Set the traceparent property: Identifies the request in a distributed tracing system. + * + * @param traceparent the traceparent value to set. + * @return the ImportJobsAddOptions object itself. + */ + public ImportJobsAddOptions setTraceparent(String traceparent) { + this.traceparent = traceparent; + return this; + } + + /** + * Get the tracestate property: Provides vendor-specific trace identification information and is a companion to + * traceparent. + * + * @return the tracestate value. + */ + public String getTracestate() { + return this.tracestate; + } + + /** + * Set the tracestate property: Provides vendor-specific trace identification information and is a companion to + * traceparent. + * + * @param tracestate the tracestate value to set. + * @return the ImportJobsAddOptions object itself. + */ + public ImportJobsAddOptions setTracestate(String tracestate) { + this.tracestate = tracestate; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobsCancelOptions.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobsCancelOptions.java new file mode 100644 index 000000000000..febb59bbea10 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobsCancelOptions.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.implementation.models; + +import com.azure.core.annotation.Fluent; + +/** + * Parameter group. + */ +@Fluent +public final class ImportJobsCancelOptions { + /* + * Identifies the request in a distributed tracing system. + */ + private String traceparent; + + /* + * Provides vendor-specific trace identification information and is a companion to traceparent. + */ + private String tracestate; + + /** + * Creates an instance of ImportJobsCancelOptions class. + */ + public ImportJobsCancelOptions() { + } + + /** + * Get the traceparent property: Identifies the request in a distributed tracing system. + * + * @return the traceparent value. + */ + public String getTraceparent() { + return this.traceparent; + } + + /** + * Set the traceparent property: Identifies the request in a distributed tracing system. + * + * @param traceparent the traceparent value to set. + * @return the ImportJobsCancelOptions object itself. + */ + public ImportJobsCancelOptions setTraceparent(String traceparent) { + this.traceparent = traceparent; + return this; + } + + /** + * Get the tracestate property: Provides vendor-specific trace identification information and is a companion to + * traceparent. + * + * @return the tracestate value. + */ + public String getTracestate() { + return this.tracestate; + } + + /** + * Set the tracestate property: Provides vendor-specific trace identification information and is a companion to + * traceparent. + * + * @param tracestate the tracestate value to set. + * @return the ImportJobsCancelOptions object itself. + */ + public ImportJobsCancelOptions setTracestate(String tracestate) { + this.tracestate = tracestate; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobsDeleteOptions.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobsDeleteOptions.java new file mode 100644 index 000000000000..755de1184787 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobsDeleteOptions.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.implementation.models; + +import com.azure.core.annotation.Fluent; + +/** + * Parameter group. + */ +@Fluent +public final class ImportJobsDeleteOptions { + /* + * Identifies the request in a distributed tracing system. + */ + private String traceparent; + + /* + * Provides vendor-specific trace identification information and is a companion to traceparent. + */ + private String tracestate; + + /** + * Creates an instance of ImportJobsDeleteOptions class. + */ + public ImportJobsDeleteOptions() { + } + + /** + * Get the traceparent property: Identifies the request in a distributed tracing system. + * + * @return the traceparent value. + */ + public String getTraceparent() { + return this.traceparent; + } + + /** + * Set the traceparent property: Identifies the request in a distributed tracing system. + * + * @param traceparent the traceparent value to set. + * @return the ImportJobsDeleteOptions object itself. + */ + public ImportJobsDeleteOptions setTraceparent(String traceparent) { + this.traceparent = traceparent; + return this; + } + + /** + * Get the tracestate property: Provides vendor-specific trace identification information and is a companion to + * traceparent. + * + * @return the tracestate value. + */ + public String getTracestate() { + return this.tracestate; + } + + /** + * Set the tracestate property: Provides vendor-specific trace identification information and is a companion to + * traceparent. + * + * @param tracestate the tracestate value to set. + * @return the ImportJobsDeleteOptions object itself. + */ + public ImportJobsDeleteOptions setTracestate(String tracestate) { + this.tracestate = tracestate; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobsGetByIdOptions.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobsGetByIdOptions.java new file mode 100644 index 000000000000..62e50252c592 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobsGetByIdOptions.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.implementation.models; + +import com.azure.core.annotation.Fluent; + +/** + * Parameter group. + */ +@Fluent +public final class ImportJobsGetByIdOptions { + /* + * Identifies the request in a distributed tracing system. + */ + private String traceparent; + + /* + * Provides vendor-specific trace identification information and is a companion to traceparent. + */ + private String tracestate; + + /** + * Creates an instance of ImportJobsGetByIdOptions class. + */ + public ImportJobsGetByIdOptions() { + } + + /** + * Get the traceparent property: Identifies the request in a distributed tracing system. + * + * @return the traceparent value. + */ + public String getTraceparent() { + return this.traceparent; + } + + /** + * Set the traceparent property: Identifies the request in a distributed tracing system. + * + * @param traceparent the traceparent value to set. + * @return the ImportJobsGetByIdOptions object itself. + */ + public ImportJobsGetByIdOptions setTraceparent(String traceparent) { + this.traceparent = traceparent; + return this; + } + + /** + * Get the tracestate property: Provides vendor-specific trace identification information and is a companion to + * traceparent. + * + * @return the tracestate value. + */ + public String getTracestate() { + return this.tracestate; + } + + /** + * Set the tracestate property: Provides vendor-specific trace identification information and is a companion to + * traceparent. + * + * @param tracestate the tracestate value to set. + * @return the ImportJobsGetByIdOptions object itself. + */ + public ImportJobsGetByIdOptions setTracestate(String tracestate) { + this.tracestate = tracestate; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobsListOptions.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobsListOptions.java new file mode 100644 index 000000000000..011c6c669870 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/ImportJobsListOptions.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.implementation.models; + +import com.azure.core.annotation.Fluent; + +/** + * Parameter group. + */ +@Fluent +public final class ImportJobsListOptions { + /* + * Identifies the request in a distributed tracing system. + */ + private String traceparent; + + /* + * Provides vendor-specific trace identification information and is a companion to traceparent. + */ + private String tracestate; + + /* + * The maximum number of items to retrieve per request. The server may choose to return less than the requested + * number. + */ + private Integer maxItemsPerPage; + + /** + * Creates an instance of ImportJobsListOptions class. + */ + public ImportJobsListOptions() { + } + + /** + * Get the traceparent property: Identifies the request in a distributed tracing system. + * + * @return the traceparent value. + */ + public String getTraceparent() { + return this.traceparent; + } + + /** + * Set the traceparent property: Identifies the request in a distributed tracing system. + * + * @param traceparent the traceparent value to set. + * @return the ImportJobsListOptions object itself. + */ + public ImportJobsListOptions setTraceparent(String traceparent) { + this.traceparent = traceparent; + return this; + } + + /** + * Get the tracestate property: Provides vendor-specific trace identification information and is a companion to + * traceparent. + * + * @return the tracestate value. + */ + public String getTracestate() { + return this.tracestate; + } + + /** + * Set the tracestate property: Provides vendor-specific trace identification information and is a companion to + * traceparent. + * + * @param tracestate the tracestate value to set. + * @return the ImportJobsListOptions object itself. + */ + public ImportJobsListOptions setTracestate(String tracestate) { + this.tracestate = tracestate; + return this; + } + + /** + * Get the maxItemsPerPage property: The maximum number of items to retrieve per request. The server may choose to + * return less than the requested number. + * + * @return the maxItemsPerPage value. + */ + public Integer getMaxItemsPerPage() { + return this.maxItemsPerPage; + } + + /** + * Set the maxItemsPerPage property: The maximum number of items to retrieve per request. The server may choose to + * return less than the requested number. + * + * @param maxItemsPerPage the maxItemsPerPage value to set. + * @return the ImportJobsListOptions object itself. + */ + public ImportJobsListOptions setMaxItemsPerPage(Integer maxItemsPerPage) { + this.maxItemsPerPage = maxItemsPerPage; + return this; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/Status.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/Status.java new file mode 100644 index 000000000000..33844736a549 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/implementation/models/Status.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.digitaltwins.core.implementation.models; + +/** + * Status of the job. + */ +public enum Status { + /** + * Enum value notstarted. + */ + NOTSTARTED("notstarted"), + + /** + * Enum value running. + */ + RUNNING("running"), + + /** + * Enum value failed. + */ + FAILED("failed"), + + /** + * Enum value succeeded. + */ + SUCCEEDED("succeeded"), + + /** + * Enum value cancelling. + */ + CANCELLING("cancelling"), + + /** + * Enum value cancelled. + */ + CANCELLED("cancelled"); + + /** + * The actual serialized value for a Status instance. + */ + private final String value; + + Status(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Status instance. + * + * @param value the serialized value to parse. + * @return the parsed Status object, or null if unable to parse. + */ + public static Status fromString(String value) { + if (value == null) { + return null; + } + Status[] items = Status.values(); + for (Status item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/digitaltwins/azure-digitaltwins-core/swagger/autorest.md b/sdk/digitaltwins/azure-digitaltwins-core/swagger/autorest.md index 86c50dec753c..6fcaab9ba5e2 100644 --- a/sdk/digitaltwins/azure-digitaltwins-core/swagger/autorest.md +++ b/sdk/digitaltwins/azure-digitaltwins-core/swagger/autorest.md @@ -30,10 +30,10 @@ autorest ``` yaml #When generating from the official specifications repository -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/e79e929e76c8da146e561b4e1246980e336fdc00/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/digitaltwins.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/764484f6d4d2eeace159a19d3df364abc0645c7e/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2023-10-31/digitaltwins.json #if you want to generate using local swagger copy: -#input-file: $(this-folder)/swagger/2022-05-31/digitaltwins.json +#input-file: $(this-folder)/swagger/2023-10-31/digitaltwins.json output-folder: ../ license-header: MICROSOFT_MIT_SMALL From fdad07219d9b8a06f6c698d2b1d7f8b5b0ea3a12 Mon Sep 17 00:00:00 2001 From: Vidyashree Biligere Narayanaswamy Date: Thu, 8 May 2025 18:03:37 -0400 Subject: [PATCH 2/2] update version --- eng/versioning/version_client.txt | 2 +- sdk/digitaltwins/azure-digitaltwins-core/CHANGELOG.md | 4 +++- sdk/digitaltwins/azure-digitaltwins-core/README.md | 2 +- sdk/digitaltwins/azure-digitaltwins-core/pom.xml | 3 +-- .../azure/digitaltwins/core/DigitalTwinsServiceVersion.java | 2 +- .../samples/resources/DTDL/DigitalTwins/BuildingTwin.json | 2 +- .../src/samples/resources/DTDL/DigitalTwins/FloorTwin.json | 2 +- .../src/samples/resources/DTDL/DigitalTwins/RoomTwin.json | 6 +++--- 8 files changed, 12 insertions(+), 11 deletions(-) diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 04ef7eee1015..348893ad2579 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -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 diff --git a/sdk/digitaltwins/azure-digitaltwins-core/CHANGELOG.md b/sdk/digitaltwins/azure-digitaltwins-core/CHANGELOG.md index 1ed72c86e895..04a2d31836d4 100644 --- a/sdk/digitaltwins/azure-digitaltwins-core/CHANGELOG.md +++ b/sdk/digitaltwins/azure-digitaltwins-core/CHANGELOG.md @@ -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 diff --git a/sdk/digitaltwins/azure-digitaltwins-core/README.md b/sdk/digitaltwins/azure-digitaltwins-core/README.md index fcb7ac68f30a..aac763290936 100644 --- a/sdk/digitaltwins/azure-digitaltwins-core/README.md +++ b/sdk/digitaltwins/azure-digitaltwins-core/README.md @@ -51,7 +51,7 @@ add the direct dependency to your project as follows. com.azure azure-digitaltwins-core - 1.5.0-beta.1 + 1.6.0 ``` diff --git a/sdk/digitaltwins/azure-digitaltwins-core/pom.xml b/sdk/digitaltwins/azure-digitaltwins-core/pom.xml index 373a64047943..2ae44704c93b 100644 --- a/sdk/digitaltwins/azure-digitaltwins-core/pom.xml +++ b/sdk/digitaltwins/azure-digitaltwins-core/pom.xml @@ -11,9 +11,8 @@ ../../parents/azure-client-sdk-parent - com.azure azure-digitaltwins-core - 1.5.0-beta.1 + 1.6.0 Microsoft Azure client library for Digital Twins This package contains the Microsoft Azure DigitalTwins client library. diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsServiceVersion.java b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsServiceVersion.java index 9e1659b3664c..c85757aa6bc5 100644 --- a/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsServiceVersion.java +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/main/java/com/azure/digitaltwins/core/DigitalTwinsServiceVersion.java @@ -20,7 +20,7 @@ public enum DigitalTwinsServiceVersion implements ServiceVersion { V2022_05_31("2022-05-31"), /** - * Service version {@code 2022-05-31}. + * Service version {@code 2023-10-31}. */ V2023_10_31("2023-10-31"); diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/samples/resources/DTDL/DigitalTwins/BuildingTwin.json b/sdk/digitaltwins/azure-digitaltwins-core/src/samples/resources/DTDL/DigitalTwins/BuildingTwin.json index b97285414198..2f7704c15c3b 100644 --- a/sdk/digitaltwins/azure-digitaltwins-core/src/samples/resources/DTDL/DigitalTwins/BuildingTwin.json +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/samples/resources/DTDL/DigitalTwins/BuildingTwin.json @@ -2,7 +2,7 @@ "$metadata": { "$model": "dtmi:com:samples:Building;1", "AverageTemperature": { - "sourceTime": "2022-05-31T19:01:32.000000Z" + "sourceTime": "2023-10-31T19:01:32.000000Z" } }, "AverageTemperature": 68, diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/samples/resources/DTDL/DigitalTwins/FloorTwin.json b/sdk/digitaltwins/azure-digitaltwins-core/src/samples/resources/DTDL/DigitalTwins/FloorTwin.json index fe8ac4add446..88ea1978daac 100644 --- a/sdk/digitaltwins/azure-digitaltwins-core/src/samples/resources/DTDL/DigitalTwins/FloorTwin.json +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/samples/resources/DTDL/DigitalTwins/FloorTwin.json @@ -2,7 +2,7 @@ "$metadata": { "$model": "dtmi:com:samples:Floor;1", "AverageTemperature": { - "sourceTime": "2022-05-31T19:01:32.000000Z" + "sourceTime": "2023-10-31T19:01:32.000000Z" } }, "AverageTemperature": 75 diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/samples/resources/DTDL/DigitalTwins/RoomTwin.json b/sdk/digitaltwins/azure-digitaltwins-core/src/samples/resources/DTDL/DigitalTwins/RoomTwin.json index 0757c0310336..52006a208e91 100644 --- a/sdk/digitaltwins/azure-digitaltwins-core/src/samples/resources/DTDL/DigitalTwins/RoomTwin.json +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/samples/resources/DTDL/DigitalTwins/RoomTwin.json @@ -2,10 +2,10 @@ "$metadata": { "$model": "dtmi:com:samples:Room;1", "Temperature": { - "sourceTime": "2022-05-31T19:01:31.073819Z" + "sourceTime": "2023-10-31T19:01:31.073819Z" }, "Humidity": { - "sourceTime": "2022-05-31T19:01:31.120392Z" + "sourceTime": "2023-10-31T19:01:31.120392Z" } }, "Temperature": 80, @@ -15,7 +15,7 @@ "wifiAccessPoint": { "$metadata": { "TransmissionPower": { - "sourceTime": "2022-05-31T19:01:30.736273Z" + "sourceTime": "2023-10-31T19:01:30.736273Z" } }, "RouterName": "Cisco1",