diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt
index 12c1345b83f3..53577558f9a6 100644
--- a/eng/versioning/version_client.txt
+++ b/eng/versioning/version_client.txt
@@ -257,6 +257,7 @@ com.azure.spring:spring-cloud-azure-stream-binder-servicebus-core;5.22.0;5.23.0-
com.azure.spring:spring-cloud-azure-stream-binder-servicebus;5.22.0;5.23.0-beta.1
com.azure.spring:spring-cloud-azure-testcontainers;5.22.0;5.23.0-beta.1
com.azure:azure-spring-data-cosmos;5.22.0;5.23.0-beta.1
+com.azure:azure-developer-trustedsigning;1.0.0-beta.1;1.0.0-beta.1
com.azure.resourcemanager:azure-resourcemanager;2.49.0;2.50.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-appplatform;2.49.0;2.50.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-appservice;2.49.0;2.50.0-beta.1
diff --git a/pom.xml b/pom.xml
index e985a85808f9..cba37bf699b6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -78,6 +78,7 @@
sdk/deploymentmanager
sdk/desktopvirtualization
sdk/devcenter
+ sdk/developer
sdk/devhub
sdk/deviceprovisioningservices
sdk/deviceregistry
diff --git a/sdk/developer/azure-developer-trustedsigning/CHANGELOG.md b/sdk/developer/azure-developer-trustedsigning/CHANGELOG.md
new file mode 100644
index 000000000000..9d8d32abb877
--- /dev/null
+++ b/sdk/developer/azure-developer-trustedsigning/CHANGELOG.md
@@ -0,0 +1,16 @@
+# Release History
+
+## 1.0.0-beta.1 (Unreleased)
+
+- Azure TrustedSigning client library for Java. This package contains Microsoft Azure TrustedSigning client library.
+
+### Features Added
+
+### Breaking Changes
+
+### Bugs Fixed
+
+### Other Changes
+### Features Added
+
+- Initial release for the azure-developer-trustedsigning Java SDK.
diff --git a/sdk/developer/azure-developer-trustedsigning/README.md b/sdk/developer/azure-developer-trustedsigning/README.md
new file mode 100644
index 000000000000..00064fb7656f
--- /dev/null
+++ b/sdk/developer/azure-developer-trustedsigning/README.md
@@ -0,0 +1,78 @@
+# Azure TrustedSigning client library for Java
+
+Azure TrustedSigning client library for Java.
+
+This package contains Microsoft Azure TrustedSigning client library.
+
+## Documentation
+
+Various documentation is available to help you get started
+
+- [API reference documentation][docs]
+- [Product documentation][product_documentation]
+
+## Getting started
+
+### Prerequisites
+
+- [Java Development Kit (JDK)][jdk] with version 8 or above
+- [Azure Subscription][azure_subscription]
+
+### Adding the package to your product
+
+[//]: # ({x-version-update-start;com.azure:azure-developer-trustedsigning;current})
+```xml
+
+ com.azure
+ azure-developer-trustedsigning
+ 1.0.0-beta.1
+
+```
+[//]: # ({x-version-update-end})
+
+### Authentication
+
+[Azure Identity][azure_identity] package provides the default implementation for authenticating the client.
+
+## Key concepts
+
+## Examples
+
+```java com.azure.developer.trustedsigning.readme
+```
+
+### Service API versions
+
+The client library targets the latest service API version by default.
+The service client builder accepts an optional service API version parameter to specify which API version to communicate.
+
+#### Select a service API version
+
+You have the flexibility to explicitly select a supported service API version when initializing a service client via the service client builder.
+This ensures that the client can communicate with services using the specified API version.
+
+When selecting an API version, it is important to verify that there are no breaking changes compared to the latest API version.
+If there are significant differences, API calls may fail due to incompatibility.
+
+Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy.
+
+## Troubleshooting
+
+## Next steps
+
+## Contributing
+
+For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md).
+
+1. Fork it
+1. Create your feature branch (`git checkout -b my-new-feature`)
+1. Commit your changes (`git commit -am 'Add some feature'`)
+1. Push to the branch (`git push origin my-new-feature`)
+1. Create new Pull Request
+
+
+[product_documentation]: https://azure.microsoft.com/services/
+[docs]: https://azure.github.io/azure-sdk-for-java/
+[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/
+[azure_subscription]: https://azure.microsoft.com/free/
+[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity
diff --git a/sdk/developer/azure-developer-trustedsigning/assets.json b/sdk/developer/azure-developer-trustedsigning/assets.json
new file mode 100644
index 000000000000..7742cbe8d095
--- /dev/null
+++ b/sdk/developer/azure-developer-trustedsigning/assets.json
@@ -0,0 +1 @@
+{"AssetsRepo":"Azure/azure-sdk-assets","AssetsRepoPrefixPath":"java","TagPrefix":"java/developer/azure-developer-trustedsigning","Tag":""}
\ No newline at end of file
diff --git a/sdk/developer/azure-developer-trustedsigning/pom.xml b/sdk/developer/azure-developer-trustedsigning/pom.xml
new file mode 100644
index 000000000000..3afc6bc1ae6c
--- /dev/null
+++ b/sdk/developer/azure-developer-trustedsigning/pom.xml
@@ -0,0 +1,71 @@
+
+
+ 4.0.0
+
+ com.azure
+ azure-client-sdk-parent
+ 1.7.0
+ ../../parents/azure-client-sdk-parent
+
+
+ com.azure
+ azure-developer-trustedsigning
+ 1.0.0-beta.1
+ jar
+
+ Microsoft Azure SDK for TrustedSigning
+ This package contains Microsoft Azure TrustedSigning client library.
+ https://github.com/Azure/azure-sdk-for-java
+
+
+
+ The MIT License (MIT)
+ http://opensource.org/licenses/MIT
+ repo
+
+
+
+
+ https://github.com/Azure/azure-sdk-for-java
+ scm:git:git@github.com:Azure/azure-sdk-for-java.git
+ scm:git:git@github.com:Azure/azure-sdk-for-java.git
+ HEAD
+
+
+
+ microsoft
+ Microsoft
+
+
+
+ UTF-8
+
+
+
+ com.azure
+ azure-core
+ 1.55.3
+
+
+ com.azure
+ azure-core-http-netty
+ 1.15.11
+
+
+ com.azure
+ azure-core-test
+ 1.27.0-beta.8
+ test
+
+
+ com.azure
+ azure-identity
+ 1.15.4
+ test
+
+
+
diff --git a/sdk/developer/azure-developer-trustedsigning/src/main/java/com/azure/developer/trustedsigning/TrustedSigningAsyncClient.java b/sdk/developer/azure-developer-trustedsigning/src/main/java/com/azure/developer/trustedsigning/TrustedSigningAsyncClient.java
new file mode 100644
index 000000000000..4d6c9083ad4e
--- /dev/null
+++ b/sdk/developer/azure-developer-trustedsigning/src/main/java/com/azure/developer/trustedsigning/TrustedSigningAsyncClient.java
@@ -0,0 +1,406 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.developer.trustedsigning;
+
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.exception.ClientAuthenticationException;
+import com.azure.core.exception.HttpResponseException;
+import com.azure.core.exception.ResourceModifiedException;
+import com.azure.core.exception.ResourceNotFoundException;
+import com.azure.core.http.HttpHeaderName;
+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.RequestOptions;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.BinaryData;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollOperationDetails;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.developer.trustedsigning.implementation.CertificateProfileOperationsImpl;
+import com.azure.developer.trustedsigning.models.ExtendedKeyUsage;
+import com.azure.developer.trustedsigning.models.OperationStatusSignResultError;
+import com.azure.developer.trustedsigning.models.SignResult;
+import com.azure.developer.trustedsigning.models.SigningPayloadOptions;
+import java.util.stream.Collectors;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/**
+ * Initializes a new instance of the asynchronous TrustedSigningClient type.
+ */
+@ServiceClient(builder = TrustedSigningClientBuilder.class, isAsync = true)
+public final class TrustedSigningAsyncClient {
+ @Generated
+ private final CertificateProfileOperationsImpl serviceClient;
+
+ /**
+ * Initializes an instance of TrustedSigningAsyncClient class.
+ *
+ * @param serviceClient the service client implementation.
+ */
+ @Generated
+ TrustedSigningAsyncClient(CertificateProfileOperationsImpl serviceClient) {
+ this.serviceClient = serviceClient;
+ }
+
+ /**
+ * Gets the status of a signing operation.
+ *
+ * This status operation requires that a Sign request has been submitted and the operationId is known.
+ *
Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * signature: byte[] (Optional)
+ * signingCertificate: byte[] (Optional)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param accountName Signing account name.
+ * @param certificateProfile Signing Certificate profile name.
+ * @param operationId The unique ID of the operation.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the status of a signing operation.
+ *
+ * This status operation requires that a Sign request has been submitted and the operationId is known along with
+ * {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getSigningStatusWithResponse(String accountName, String certificateProfile,
+ String operationId, RequestOptions requestOptions) {
+ return this.serviceClient.getSigningStatusWithResponseAsync(accountName, certificateProfile, operationId,
+ requestOptions);
+ }
+
+ /**
+ * Gets the signing root certificate on the certificate chain for that account and profile name.
+ *
+ * The root certificate is generated as part of the initial account creation and it is used to sign the bits for the
+ * profile provided.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * @param accountName Signing account name.
+ * @param certificateProfile Signing Certificate profile name.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the signing root certificate on the certificate chain for that account and profile name.
+ *
+ * The root certificate is generated as part of the initial account creation and it is used to sign the bits for the
+ * profile provided along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getSignRootCertificateWithResponse(String accountName, String certificateProfile,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getSignRootCertificateWithResponseAsync(accountName, certificateProfile,
+ requestOptions);
+ }
+
+ /**
+ * Gets a list of extended key usage object identifiers that are allowed for this account and profile combination.
+ *
+ * The list of extended key usages are used to determine the purpose of the certificate usage as part of the signing
+ * operation.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * eku: String (Required)
+ * }
+ * }
+ *
+ *
+ * @param accountName Azure Trusted Signing account name.
+ * @param certificateProfile Azure Trusted Signing certificate profile name under an account.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of extended key usage object identifiers that are allowed for this account and profile
+ * combination.
+ *
+ * The list of extended key usages are used to determine the purpose of the certificate usage as part of the signing
+ * operation as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listExtendedKeyUsages(String accountName, String certificateProfile,
+ RequestOptions requestOptions) {
+ return this.serviceClient.listExtendedKeyUsagesAsync(accountName, certificateProfile, requestOptions);
+ }
+
+ /**
+ * Submit a sign operation.
+ *
+ * Submit a sign operation under the created account and profile name provided.
+ * Header Parameters
+ *
+ * Header Parameters
+ * | Name | Type | Required | Description |
+ * | client-version | String | No | An optional client version. |
+ * | x-correlation-id | String | No | An identifier used to batch multiple
+ * requests. |
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * signatureAlgorithm: String(RS256/RS384/RS512/PS256/PS384/PS512/ES256/ES384/ES512/ES256K) (Required)
+ * digest: byte[] (Required)
+ * fileHashList (Optional): [
+ * byte[] (Optional)
+ * ]
+ * authenticodeHashList (Optional): [
+ * byte[] (Optional)
+ * ]
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * error (Required): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * }
+ * result (Optional): {
+ * signature: byte[] (Optional)
+ * signingCertificate: byte[] (Optional)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param accountName Azure Trusted Signing account name.
+ * @param certificateProfile Azure Trusted Signing certificate profile name under an account.
+ * @param body Body parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link PollerFlux} for polling of provides status details for long running operations.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginSign(String accountName, String certificateProfile, BinaryData body,
+ RequestOptions requestOptions) {
+ return this.serviceClient.beginSignAsync(accountName, certificateProfile, body, requestOptions);
+ }
+
+ /**
+ * Gets the status of a signing operation.
+ *
+ * This status operation requires that a Sign request has been submitted and the operationId is known.
+ *
+ * @param accountName Signing account name.
+ * @param certificateProfile Signing Certificate profile name.
+ * @param operationId The unique ID of the operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the status of a signing operation.
+ *
+ * This status operation requires that a Sign request has been submitted and the operationId is known on successful
+ * completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getSigningStatus(String accountName, String certificateProfile,
+ String operationId) {
+ // Generated convenience method for getSigningStatusWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getSigningStatusWithResponse(accountName, certificateProfile, operationId, requestOptions)
+ .flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(OperationStatusSignResultError.class));
+ }
+
+ /**
+ * Gets the signing root certificate on the certificate chain for that account and profile name.
+ *
+ * The root certificate is generated as part of the initial account creation and it is used to sign the bits for the
+ * profile provided.
+ *
+ * @param accountName Signing account name.
+ * @param certificateProfile Signing Certificate profile name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the signing root certificate on the certificate chain for that account and profile name.
+ *
+ * The root certificate is generated as part of the initial account creation and it is used to sign the bits for the
+ * profile provided on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getSignRootCertificate(String accountName, String certificateProfile) {
+ // Generated convenience method for getSignRootCertificateWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getSignRootCertificateWithResponse(accountName, certificateProfile, requestOptions)
+ .flatMap(FluxUtil::toMono);
+ }
+
+ /**
+ * Gets a list of extended key usage object identifiers that are allowed for this account and profile combination.
+ *
+ * The list of extended key usages are used to determine the purpose of the certificate usage as part of the signing
+ * operation.
+ *
+ * @param accountName Azure Trusted Signing account name.
+ * @param certificateProfile Azure Trusted Signing certificate profile name under an account.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of extended key usage object identifiers that are allowed for this account and profile
+ * combination.
+ *
+ * The list of extended key usages are used to determine the purpose of the certificate usage as part of the signing
+ * operation as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listExtendedKeyUsages(String accountName, String certificateProfile) {
+ // Generated convenience method for listExtendedKeyUsages
+ RequestOptions requestOptions = new RequestOptions();
+ PagedFlux pagedFluxResponse
+ = listExtendedKeyUsages(accountName, certificateProfile, requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(ExtendedKeyUsage.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * Submit a sign operation.
+ *
+ * Submit a sign operation under the created account and profile name provided.
+ *
+ * @param accountName Azure Trusted Signing account name.
+ * @param certificateProfile Azure Trusted Signing certificate profile name under an account.
+ * @param body Body parameter.
+ * @param clientVersion An optional client version.
+ * @param xCorrelationId An identifier used to batch multiple requests.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of provides status details for long running operations.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginSign(String accountName, String certificateProfile,
+ SigningPayloadOptions body, String clientVersion, String xCorrelationId) {
+ // Generated convenience method for beginSignWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ if (clientVersion != null) {
+ requestOptions.setHeader(HttpHeaderName.fromString("client-version"), clientVersion);
+ }
+ if (xCorrelationId != null) {
+ requestOptions.setHeader(HttpHeaderName.fromString("x-correlation-id"), xCorrelationId);
+ }
+ return serviceClient.beginSignWithModelAsync(accountName, certificateProfile, BinaryData.fromObject(body),
+ requestOptions);
+ }
+
+ /**
+ * Submit a sign operation.
+ *
+ * Submit a sign operation under the created account and profile name provided.
+ *
+ * @param accountName Azure Trusted Signing account name.
+ * @param certificateProfile Azure Trusted Signing certificate profile name under an account.
+ * @param body Body parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of provides status details for long running operations.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginSign(String accountName, String certificateProfile,
+ SigningPayloadOptions body) {
+ // Generated convenience method for beginSignWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.beginSignWithModelAsync(accountName, certificateProfile, BinaryData.fromObject(body),
+ requestOptions);
+ }
+}
diff --git a/sdk/developer/azure-developer-trustedsigning/src/main/java/com/azure/developer/trustedsigning/TrustedSigningClient.java b/sdk/developer/azure-developer-trustedsigning/src/main/java/com/azure/developer/trustedsigning/TrustedSigningClient.java
new file mode 100644
index 000000000000..6613d72de8bb
--- /dev/null
+++ b/sdk/developer/azure-developer-trustedsigning/src/main/java/com/azure/developer/trustedsigning/TrustedSigningClient.java
@@ -0,0 +1,384 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.developer.trustedsigning;
+
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.exception.ClientAuthenticationException;
+import com.azure.core.exception.HttpResponseException;
+import com.azure.core.exception.ResourceModifiedException;
+import com.azure.core.exception.ResourceNotFoundException;
+import com.azure.core.http.HttpHeaderName;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.RequestOptions;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.BinaryData;
+import com.azure.core.util.polling.PollOperationDetails;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.developer.trustedsigning.implementation.CertificateProfileOperationsImpl;
+import com.azure.developer.trustedsigning.models.ExtendedKeyUsage;
+import com.azure.developer.trustedsigning.models.OperationStatusSignResultError;
+import com.azure.developer.trustedsigning.models.SignResult;
+import com.azure.developer.trustedsigning.models.SigningPayloadOptions;
+
+/**
+ * Initializes a new instance of the synchronous TrustedSigningClient type.
+ */
+@ServiceClient(builder = TrustedSigningClientBuilder.class)
+public final class TrustedSigningClient {
+ @Generated
+ private final CertificateProfileOperationsImpl serviceClient;
+
+ /**
+ * Initializes an instance of TrustedSigningClient class.
+ *
+ * @param serviceClient the service client implementation.
+ */
+ @Generated
+ TrustedSigningClient(CertificateProfileOperationsImpl serviceClient) {
+ this.serviceClient = serviceClient;
+ }
+
+ /**
+ * Gets the status of a signing operation.
+ *
+ * This status operation requires that a Sign request has been submitted and the operationId is known.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * signature: byte[] (Optional)
+ * signingCertificate: byte[] (Optional)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param accountName Signing account name.
+ * @param certificateProfile Signing Certificate profile name.
+ * @param operationId The unique ID of the operation.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the status of a signing operation.
+ *
+ * This status operation requires that a Sign request has been submitted and the operationId is known along with
+ * {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getSigningStatusWithResponse(String accountName, String certificateProfile,
+ String operationId, RequestOptions requestOptions) {
+ return this.serviceClient.getSigningStatusWithResponse(accountName, certificateProfile, operationId,
+ requestOptions);
+ }
+
+ /**
+ * Gets the signing root certificate on the certificate chain for that account and profile name.
+ *
+ * The root certificate is generated as part of the initial account creation and it is used to sign the bits for the
+ * profile provided.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * @param accountName Signing account name.
+ * @param certificateProfile Signing Certificate profile name.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the signing root certificate on the certificate chain for that account and profile name.
+ *
+ * The root certificate is generated as part of the initial account creation and it is used to sign the bits for the
+ * profile provided along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getSignRootCertificateWithResponse(String accountName, String certificateProfile,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getSignRootCertificateWithResponse(accountName, certificateProfile, requestOptions);
+ }
+
+ /**
+ * Gets a list of extended key usage object identifiers that are allowed for this account and profile combination.
+ *
+ * The list of extended key usages are used to determine the purpose of the certificate usage as part of the signing
+ * operation.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * eku: String (Required)
+ * }
+ * }
+ *
+ *
+ * @param accountName Azure Trusted Signing account name.
+ * @param certificateProfile Azure Trusted Signing certificate profile name under an account.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of extended key usage object identifiers that are allowed for this account and profile
+ * combination.
+ *
+ * The list of extended key usages are used to determine the purpose of the certificate usage as part of the signing
+ * operation as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listExtendedKeyUsages(String accountName, String certificateProfile,
+ RequestOptions requestOptions) {
+ return this.serviceClient.listExtendedKeyUsages(accountName, certificateProfile, requestOptions);
+ }
+
+ /**
+ * Submit a sign operation.
+ *
+ * Submit a sign operation under the created account and profile name provided.
+ * Header Parameters
+ *
+ * Header Parameters
+ * | Name | Type | Required | Description |
+ * | client-version | String | No | An optional client version. |
+ * | x-correlation-id | String | No | An identifier used to batch multiple
+ * requests. |
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * signatureAlgorithm: String(RS256/RS384/RS512/PS256/PS384/PS512/ES256/ES384/ES512/ES256K) (Required)
+ * digest: byte[] (Required)
+ * fileHashList (Optional): [
+ * byte[] (Optional)
+ * ]
+ * authenticodeHashList (Optional): [
+ * byte[] (Optional)
+ * ]
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * error (Required): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * }
+ * result (Optional): {
+ * signature: byte[] (Optional)
+ * signingCertificate: byte[] (Optional)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param accountName Azure Trusted Signing account name.
+ * @param certificateProfile Azure Trusted Signing certificate profile name under an account.
+ * @param body Body parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link SyncPoller} for polling of provides status details for long running operations.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginSign(String accountName, String certificateProfile, BinaryData body,
+ RequestOptions requestOptions) {
+ return this.serviceClient.beginSign(accountName, certificateProfile, body, requestOptions);
+ }
+
+ /**
+ * Gets the status of a signing operation.
+ *
+ * This status operation requires that a Sign request has been submitted and the operationId is known.
+ *
+ * @param accountName Signing account name.
+ * @param certificateProfile Signing Certificate profile name.
+ * @param operationId The unique ID of the operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the status of a signing operation.
+ *
+ * This status operation requires that a Sign request has been submitted and the operationId is known.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public OperationStatusSignResultError getSigningStatus(String accountName, String certificateProfile,
+ String operationId) {
+ // Generated convenience method for getSigningStatusWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getSigningStatusWithResponse(accountName, certificateProfile, operationId, requestOptions).getValue()
+ .toObject(OperationStatusSignResultError.class);
+ }
+
+ /**
+ * Gets the signing root certificate on the certificate chain for that account and profile name.
+ *
+ * The root certificate is generated as part of the initial account creation and it is used to sign the bits for the
+ * profile provided.
+ *
+ * @param accountName Signing account name.
+ * @param certificateProfile Signing Certificate profile name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the signing root certificate on the certificate chain for that account and profile name.
+ *
+ * The root certificate is generated as part of the initial account creation and it is used to sign the bits for the
+ * profile provided.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public BinaryData getSignRootCertificate(String accountName, String certificateProfile) {
+ // Generated convenience method for getSignRootCertificateWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getSignRootCertificateWithResponse(accountName, certificateProfile, requestOptions).getValue();
+ }
+
+ /**
+ * Gets a list of extended key usage object identifiers that are allowed for this account and profile combination.
+ *
+ * The list of extended key usages are used to determine the purpose of the certificate usage as part of the signing
+ * operation.
+ *
+ * @param accountName Azure Trusted Signing account name.
+ * @param certificateProfile Azure Trusted Signing certificate profile name under an account.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of extended key usage object identifiers that are allowed for this account and profile
+ * combination.
+ *
+ * The list of extended key usages are used to determine the purpose of the certificate usage as part of the signing
+ * operation as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listExtendedKeyUsages(String accountName, String certificateProfile) {
+ // Generated convenience method for listExtendedKeyUsages
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.listExtendedKeyUsages(accountName, certificateProfile, requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(ExtendedKeyUsage.class));
+ }
+
+ /**
+ * Submit a sign operation.
+ *
+ * Submit a sign operation under the created account and profile name provided.
+ *
+ * @param accountName Azure Trusted Signing account name.
+ * @param certificateProfile Azure Trusted Signing certificate profile name under an account.
+ * @param body Body parameter.
+ * @param clientVersion An optional client version.
+ * @param xCorrelationId An identifier used to batch multiple requests.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of provides status details for long running operations.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginSign(String accountName, String certificateProfile,
+ SigningPayloadOptions body, String clientVersion, String xCorrelationId) {
+ // Generated convenience method for beginSignWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ if (clientVersion != null) {
+ requestOptions.setHeader(HttpHeaderName.fromString("client-version"), clientVersion);
+ }
+ if (xCorrelationId != null) {
+ requestOptions.setHeader(HttpHeaderName.fromString("x-correlation-id"), xCorrelationId);
+ }
+ return serviceClient.beginSignWithModel(accountName, certificateProfile, BinaryData.fromObject(body),
+ requestOptions);
+ }
+
+ /**
+ * Submit a sign operation.
+ *
+ * Submit a sign operation under the created account and profile name provided.
+ *
+ * @param accountName Azure Trusted Signing account name.
+ * @param certificateProfile Azure Trusted Signing certificate profile name under an account.
+ * @param body Body parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of provides status details for long running operations.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginSign(String accountName, String certificateProfile,
+ SigningPayloadOptions body) {
+ // Generated convenience method for beginSignWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.beginSignWithModel(accountName, certificateProfile, BinaryData.fromObject(body),
+ requestOptions);
+ }
+}
diff --git a/sdk/developer/azure-developer-trustedsigning/src/main/java/com/azure/developer/trustedsigning/TrustedSigningClientBuilder.java b/sdk/developer/azure-developer-trustedsigning/src/main/java/com/azure/developer/trustedsigning/TrustedSigningClientBuilder.java
new file mode 100644
index 000000000000..42b4fc138fad
--- /dev/null
+++ b/sdk/developer/azure-developer-trustedsigning/src/main/java/com/azure/developer/trustedsigning/TrustedSigningClientBuilder.java
@@ -0,0 +1,334 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.developer.trustedsigning;
+
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.ServiceClientBuilder;
+import com.azure.core.client.traits.ConfigurationTrait;
+import com.azure.core.client.traits.EndpointTrait;
+import com.azure.core.client.traits.HttpTrait;
+import com.azure.core.client.traits.TokenCredentialTrait;
+import com.azure.core.credential.TokenCredential;
+import com.azure.core.http.HttpClient;
+import com.azure.core.http.HttpHeaders;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
+import com.azure.core.http.HttpPipelinePosition;
+import com.azure.core.http.policy.AddDatePolicy;
+import com.azure.core.http.policy.AddHeadersFromContextPolicy;
+import com.azure.core.http.policy.AddHeadersPolicy;
+import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
+import com.azure.core.http.policy.HttpLogOptions;
+import com.azure.core.http.policy.HttpLoggingPolicy;
+import com.azure.core.http.policy.HttpPipelinePolicy;
+import com.azure.core.http.policy.HttpPolicyProviders;
+import com.azure.core.http.policy.RequestIdPolicy;
+import com.azure.core.http.policy.RetryOptions;
+import com.azure.core.http.policy.RetryPolicy;
+import com.azure.core.http.policy.UserAgentPolicy;
+import com.azure.core.util.ClientOptions;
+import com.azure.core.util.Configuration;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.builder.ClientBuilderUtil;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.serializer.JacksonAdapter;
+import com.azure.developer.trustedsigning.implementation.TrustedSigningClientImpl;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * A builder for creating a new instance of the TrustedSigningClient type.
+ */
+@ServiceClientBuilder(serviceClients = { TrustedSigningClient.class, TrustedSigningAsyncClient.class })
+public final class TrustedSigningClientBuilder
+ implements HttpTrait, ConfigurationTrait,
+ TokenCredentialTrait, EndpointTrait {
+ @Generated
+ private static final String SDK_NAME = "name";
+
+ @Generated
+ private static final String SDK_VERSION = "version";
+
+ @Generated
+ private static final String[] DEFAULT_SCOPES = new String[] { "https://codesigning.azure.net/.default" };
+
+ @Generated
+ private static final Map PROPERTIES
+ = CoreUtils.getProperties("azure-developer-trustedsigning.properties");
+
+ @Generated
+ private final List pipelinePolicies;
+
+ /**
+ * Create an instance of the TrustedSigningClientBuilder.
+ */
+ @Generated
+ public TrustedSigningClientBuilder() {
+ this.pipelinePolicies = new ArrayList<>();
+ }
+
+ /*
+ * The HTTP pipeline to send requests through.
+ */
+ @Generated
+ private HttpPipeline pipeline;
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public TrustedSigningClientBuilder pipeline(HttpPipeline pipeline) {
+ if (this.pipeline != null && pipeline == null) {
+ LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured.");
+ }
+ this.pipeline = pipeline;
+ return this;
+ }
+
+ /*
+ * The HTTP client used to send the request.
+ */
+ @Generated
+ private HttpClient httpClient;
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public TrustedSigningClientBuilder httpClient(HttpClient httpClient) {
+ this.httpClient = httpClient;
+ return this;
+ }
+
+ /*
+ * The logging configuration for HTTP requests and responses.
+ */
+ @Generated
+ private HttpLogOptions httpLogOptions;
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public TrustedSigningClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) {
+ this.httpLogOptions = httpLogOptions;
+ return this;
+ }
+
+ /*
+ * The client options such as application ID and custom headers to set on a request.
+ */
+ @Generated
+ private ClientOptions clientOptions;
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public TrustedSigningClientBuilder clientOptions(ClientOptions clientOptions) {
+ this.clientOptions = clientOptions;
+ return this;
+ }
+
+ /*
+ * The retry options to configure retry policy for failed requests.
+ */
+ @Generated
+ private RetryOptions retryOptions;
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public TrustedSigningClientBuilder retryOptions(RetryOptions retryOptions) {
+ this.retryOptions = retryOptions;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public TrustedSigningClientBuilder addPolicy(HttpPipelinePolicy customPolicy) {
+ Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null.");
+ pipelinePolicies.add(customPolicy);
+ return this;
+ }
+
+ /*
+ * The configuration store that is used during construction of the service client.
+ */
+ @Generated
+ private Configuration configuration;
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public TrustedSigningClientBuilder configuration(Configuration configuration) {
+ this.configuration = configuration;
+ return this;
+ }
+
+ /*
+ * The TokenCredential used for authentication.
+ */
+ @Generated
+ private TokenCredential tokenCredential;
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public TrustedSigningClientBuilder credential(TokenCredential tokenCredential) {
+ this.tokenCredential = tokenCredential;
+ return this;
+ }
+
+ /*
+ * The service endpoint
+ */
+ @Generated
+ private String endpoint;
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public TrustedSigningClientBuilder endpoint(String endpoint) {
+ this.endpoint = endpoint;
+ return this;
+ }
+
+ /*
+ * Service version
+ */
+ @Generated
+ private TrustedSigningServiceVersion serviceVersion;
+
+ /**
+ * Sets Service version.
+ *
+ * @param serviceVersion the serviceVersion value.
+ * @return the TrustedSigningClientBuilder.
+ */
+ @Generated
+ public TrustedSigningClientBuilder serviceVersion(TrustedSigningServiceVersion serviceVersion) {
+ this.serviceVersion = serviceVersion;
+ return this;
+ }
+
+ /*
+ * The retry policy that will attempt to retry failed requests, if applicable.
+ */
+ @Generated
+ private RetryPolicy retryPolicy;
+
+ /**
+ * Sets The retry policy that will attempt to retry failed requests, if applicable.
+ *
+ * @param retryPolicy the retryPolicy value.
+ * @return the TrustedSigningClientBuilder.
+ */
+ @Generated
+ public TrustedSigningClientBuilder retryPolicy(RetryPolicy retryPolicy) {
+ this.retryPolicy = retryPolicy;
+ return this;
+ }
+
+ /**
+ * Builds an instance of TrustedSigningClientImpl with the provided parameters.
+ *
+ * @return an instance of TrustedSigningClientImpl.
+ */
+ @Generated
+ private TrustedSigningClientImpl buildInnerClient() {
+ this.validateClient();
+ HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline();
+ TrustedSigningServiceVersion localServiceVersion
+ = (serviceVersion != null) ? serviceVersion : TrustedSigningServiceVersion.getLatest();
+ TrustedSigningClientImpl client = new TrustedSigningClientImpl(localPipeline,
+ JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion);
+ return client;
+ }
+
+ @Generated
+ private void validateClient() {
+ // This method is invoked from 'buildInnerClient'/'buildClient' method.
+ // Developer can customize this method, to validate that the necessary conditions are met for the new client.
+ Objects.requireNonNull(endpoint, "'endpoint' cannot be null.");
+ }
+
+ @Generated
+ private HttpPipeline createHttpPipeline() {
+ Configuration buildConfiguration
+ = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration;
+ HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions;
+ ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions;
+ List policies = new ArrayList<>();
+ String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName");
+ String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion");
+ String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions);
+ policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration));
+ policies.add(new RequestIdPolicy());
+ policies.add(new AddHeadersFromContextPolicy());
+ HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions);
+ if (headers != null) {
+ policies.add(new AddHeadersPolicy(headers));
+ }
+ this.pipelinePolicies.stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+ .forEach(p -> policies.add(p));
+ HttpPolicyProviders.addBeforeRetryPolicies(policies);
+ policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy()));
+ policies.add(new AddDatePolicy());
+ if (tokenCredential != null) {
+ policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES));
+ }
+ this.pipelinePolicies.stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
+ .forEach(p -> policies.add(p));
+ HttpPolicyProviders.addAfterRetryPolicies(policies);
+ policies.add(new HttpLoggingPolicy(localHttpLogOptions));
+ HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0]))
+ .httpClient(httpClient)
+ .clientOptions(localClientOptions)
+ .build();
+ return httpPipeline;
+ }
+
+ /**
+ * Builds an instance of TrustedSigningAsyncClient class.
+ *
+ * @return an instance of TrustedSigningAsyncClient.
+ */
+ @Generated
+ public TrustedSigningAsyncClient buildAsyncClient() {
+ return new TrustedSigningAsyncClient(buildInnerClient().getCertificateProfileOperations());
+ }
+
+ /**
+ * Builds an instance of TrustedSigningClient class.
+ *
+ * @return an instance of TrustedSigningClient.
+ */
+ @Generated
+ public TrustedSigningClient buildClient() {
+ return new TrustedSigningClient(buildInnerClient().getCertificateProfileOperations());
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(TrustedSigningClientBuilder.class);
+}
diff --git a/sdk/developer/azure-developer-trustedsigning/src/main/java/com/azure/developer/trustedsigning/TrustedSigningServiceVersion.java b/sdk/developer/azure-developer-trustedsigning/src/main/java/com/azure/developer/trustedsigning/TrustedSigningServiceVersion.java
new file mode 100644
index 000000000000..aa6d5416cef5
--- /dev/null
+++ b/sdk/developer/azure-developer-trustedsigning/src/main/java/com/azure/developer/trustedsigning/TrustedSigningServiceVersion.java
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.developer.trustedsigning;
+
+import com.azure.core.util.ServiceVersion;
+
+/**
+ * Service version of TrustedSigningClient.
+ */
+public enum TrustedSigningServiceVersion implements ServiceVersion {
+ /**
+ * Enum value 2023-06-15-preview.
+ */
+ V2023_06_15_PREVIEW("2023-06-15-preview");
+
+ private final String version;
+
+ TrustedSigningServiceVersion(String version) {
+ this.version = version;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getVersion() {
+ return this.version;
+ }
+
+ /**
+ * Gets the latest service version supported by this client library.
+ *
+ * @return The latest {@link TrustedSigningServiceVersion}.
+ */
+ public static TrustedSigningServiceVersion getLatest() {
+ return V2023_06_15_PREVIEW;
+ }
+}
diff --git a/sdk/developer/azure-developer-trustedsigning/src/main/java/com/azure/developer/trustedsigning/implementation/CertificateProfileOperationsImpl.java b/sdk/developer/azure-developer-trustedsigning/src/main/java/com/azure/developer/trustedsigning/implementation/CertificateProfileOperationsImpl.java
new file mode 100644
index 000000000000..e3dc50cb481f
--- /dev/null
+++ b/sdk/developer/azure-developer-trustedsigning/src/main/java/com/azure/developer/trustedsigning/implementation/CertificateProfileOperationsImpl.java
@@ -0,0 +1,1111 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.developer.trustedsigning.implementation;
+
+import com.azure.core.annotation.BodyParam;
+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.exception.ClientAuthenticationException;
+import com.azure.core.exception.HttpResponseException;
+import com.azure.core.exception.ResourceModifiedException;
+import com.azure.core.exception.ResourceNotFoundException;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.RequestOptions;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.util.BinaryData;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollOperationDetails;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.PollingStrategyOptions;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.core.util.serializer.TypeReference;
+import com.azure.developer.trustedsigning.TrustedSigningServiceVersion;
+import com.azure.developer.trustedsigning.models.SignResult;
+import java.time.Duration;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in CertificateProfileOperations.
+ */
+public final class CertificateProfileOperationsImpl {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final CertificateProfileOperationsService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final TrustedSigningClientImpl client;
+
+ /**
+ * Initializes an instance of CertificateProfileOperationsImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ CertificateProfileOperationsImpl(TrustedSigningClientImpl client) {
+ this.service = RestProxy.create(CertificateProfileOperationsService.class, client.getHttpPipeline(),
+ client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * Gets Service version.
+ *
+ * @return the serviceVersion value.
+ */
+ public TrustedSigningServiceVersion getServiceVersion() {
+ return client.getServiceVersion();
+ }
+
+ /**
+ * The interface defining all the services for TrustedSigningClientCertificateProfileOperations to be used by the
+ * proxy service to perform REST calls.
+ */
+ @Host("{endpoint}")
+ @ServiceInterface(name = "TrustedSigningClient")
+ public interface CertificateProfileOperationsService {
+ @Get("/codesigningaccounts/{accountName}/certificateprofiles/{certificateProfile}/sign/{operationId}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> getSigningStatus(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("accountName") String accountName,
+ @PathParam("certificateProfile") String certificateProfile, @PathParam("operationId") String operationId,
+ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+
+ @Get("/codesigningaccounts/{accountName}/certificateprofiles/{certificateProfile}/sign/{operationId}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response getSigningStatusSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("accountName") String accountName,
+ @PathParam("certificateProfile") String certificateProfile, @PathParam("operationId") String operationId,
+ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+
+ @Get("/codesigningaccounts/{accountName}/certificateprofiles/{certificateProfile}/sign/rootcert")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> getSignRootCertificate(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("accountName") String accountName,
+ @PathParam("certificateProfile") String certificateProfile, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Get("/codesigningaccounts/{accountName}/certificateprofiles/{certificateProfile}/sign/rootcert")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response getSignRootCertificateSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("accountName") String accountName,
+ @PathParam("certificateProfile") String certificateProfile, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Get("/codesigningaccounts/{accountName}/certificateprofiles/{certificateProfile}/sign/eku")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> listExtendedKeyUsages(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("accountName") String accountName,
+ @PathParam("certificateProfile") String certificateProfile, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Get("/codesigningaccounts/{accountName}/certificateprofiles/{certificateProfile}/sign/eku")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response listExtendedKeyUsagesSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("accountName") String accountName,
+ @PathParam("certificateProfile") String certificateProfile, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Post("/codesigningaccounts/{accountName}/certificateprofiles/{certificateProfile}:sign")
+ @ExpectedResponses({ 202 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> sign(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("accountName") String accountName,
+ @PathParam("certificateProfile") String certificateProfile, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body,
+ RequestOptions requestOptions, Context context);
+
+ @Post("/codesigningaccounts/{accountName}/certificateprofiles/{certificateProfile}:sign")
+ @ExpectedResponses({ 202 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response signSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("accountName") String accountName,
+ @PathParam("certificateProfile") String certificateProfile, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body,
+ RequestOptions requestOptions, Context context);
+
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> listExtendedKeyUsagesNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
+ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response listExtendedKeyUsagesNextSync(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
+ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+ }
+
+ /**
+ * Gets the status of a signing operation.
+ *
+ * This status operation requires that a Sign request has been submitted and the operationId is known.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * signature: byte[] (Optional)
+ * signingCertificate: byte[] (Optional)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param accountName Signing account name.
+ * @param certificateProfile Signing Certificate profile name.
+ * @param operationId The unique ID of the operation.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the status of a signing operation.
+ *
+ * This status operation requires that a Sign request has been submitted and the operationId is known along with
+ * {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getSigningStatusWithResponseAsync(String accountName, String certificateProfile,
+ String operationId, RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil.withContext(
+ context -> service.getSigningStatus(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(),
+ accountName, certificateProfile, operationId, accept, requestOptions, context));
+ }
+
+ /**
+ * Gets the status of a signing operation.
+ *
+ * This status operation requires that a Sign request has been submitted and the operationId is known.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * signature: byte[] (Optional)
+ * signingCertificate: byte[] (Optional)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param accountName Signing account name.
+ * @param certificateProfile Signing Certificate profile name.
+ * @param operationId The unique ID of the operation.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the status of a signing operation.
+ *
+ * This status operation requires that a Sign request has been submitted and the operationId is known along with
+ * {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getSigningStatusWithResponse(String accountName, String certificateProfile,
+ String operationId, RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return service.getSigningStatusSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(),
+ accountName, certificateProfile, operationId, accept, requestOptions, Context.NONE);
+ }
+
+ /**
+ * Gets the signing root certificate on the certificate chain for that account and profile name.
+ *
+ * The root certificate is generated as part of the initial account creation and it is used to sign the bits for the
+ * profile provided.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * @param accountName Signing account name.
+ * @param certificateProfile Signing Certificate profile name.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the signing root certificate on the certificate chain for that account and profile name.
+ *
+ * The root certificate is generated as part of the initial account creation and it is used to sign the bits for the
+ * profile provided along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getSignRootCertificateWithResponseAsync(String accountName,
+ String certificateProfile, RequestOptions requestOptions) {
+ final String accept = "application/x-x509-ca-cert";
+ return FluxUtil.withContext(context -> service.getSignRootCertificate(this.client.getEndpoint(),
+ this.client.getServiceVersion().getVersion(), accountName, certificateProfile, accept, requestOptions,
+ context));
+ }
+
+ /**
+ * Gets the signing root certificate on the certificate chain for that account and profile name.
+ *
+ * The root certificate is generated as part of the initial account creation and it is used to sign the bits for the
+ * profile provided.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * @param accountName Signing account name.
+ * @param certificateProfile Signing Certificate profile name.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the signing root certificate on the certificate chain for that account and profile name.
+ *
+ * The root certificate is generated as part of the initial account creation and it is used to sign the bits for the
+ * profile provided along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getSignRootCertificateWithResponse(String accountName, String certificateProfile,
+ RequestOptions requestOptions) {
+ final String accept = "application/x-x509-ca-cert";
+ return service.getSignRootCertificateSync(this.client.getEndpoint(),
+ this.client.getServiceVersion().getVersion(), accountName, certificateProfile, accept, requestOptions,
+ Context.NONE);
+ }
+
+ /**
+ * Gets a list of extended key usage object identifiers that are allowed for this account and profile combination.
+ *
+ * The list of extended key usages are used to determine the purpose of the certificate usage as part of the signing
+ * operation.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * eku: String (Required)
+ * }
+ * }
+ *
+ *
+ * @param accountName Azure Trusted Signing account name.
+ * @param certificateProfile Azure Trusted Signing certificate profile name under an account.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of extended key usage object identifiers that are allowed for this account and profile
+ * combination.
+ *
+ * The list of extended key usages are used to determine the purpose of the certificate usage as part of the signing
+ * operation along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listExtendedKeyUsagesSinglePageAsync(String accountName,
+ String certificateProfile, RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listExtendedKeyUsages(this.client.getEndpoint(),
+ this.client.getServiceVersion().getVersion(), accountName, certificateProfile, accept, requestOptions,
+ context))
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
+ }
+
+ /**
+ * Gets a list of extended key usage object identifiers that are allowed for this account and profile combination.
+ *
+ * The list of extended key usages are used to determine the purpose of the certificate usage as part of the signing
+ * operation.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * eku: String (Required)
+ * }
+ * }
+ *
+ *
+ * @param accountName Azure Trusted Signing account name.
+ * @param certificateProfile Azure Trusted Signing certificate profile name under an account.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of extended key usage object identifiers that are allowed for this account and profile
+ * combination.
+ *
+ * The list of extended key usages are used to determine the purpose of the certificate usage as part of the signing
+ * operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listExtendedKeyUsagesAsync(String accountName, String certificateProfile,
+ RequestOptions requestOptions) {
+ RequestOptions requestOptionsForNextPage = new RequestOptions();
+ requestOptionsForNextPage.setContext(
+ requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
+ return new PagedFlux<>(
+ () -> listExtendedKeyUsagesSinglePageAsync(accountName, certificateProfile, requestOptions),
+ nextLink -> listExtendedKeyUsagesNextSinglePageAsync(nextLink, requestOptionsForNextPage));
+ }
+
+ /**
+ * Gets a list of extended key usage object identifiers that are allowed for this account and profile combination.
+ *
+ * The list of extended key usages are used to determine the purpose of the certificate usage as part of the signing
+ * operation.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * eku: String (Required)
+ * }
+ * }
+ *
+ *
+ * @param accountName Azure Trusted Signing account name.
+ * @param certificateProfile Azure Trusted Signing certificate profile name under an account.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of extended key usage object identifiers that are allowed for this account and profile
+ * combination.
+ *
+ * The list of extended key usages are used to determine the purpose of the certificate usage as part of the signing
+ * operation along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listExtendedKeyUsagesSinglePage(String accountName, String certificateProfile,
+ RequestOptions requestOptions) {
+ final String accept = "application/json";
+ Response res
+ = service.listExtendedKeyUsagesSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(),
+ accountName, certificateProfile, accept, requestOptions, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
+ }
+
+ /**
+ * Gets a list of extended key usage object identifiers that are allowed for this account and profile combination.
+ *
+ * The list of extended key usages are used to determine the purpose of the certificate usage as part of the signing
+ * operation.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * eku: String (Required)
+ * }
+ * }
+ *
+ *
+ * @param accountName Azure Trusted Signing account name.
+ * @param certificateProfile Azure Trusted Signing certificate profile name under an account.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of extended key usage object identifiers that are allowed for this account and profile
+ * combination.
+ *
+ * The list of extended key usages are used to determine the purpose of the certificate usage as part of the signing
+ * operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listExtendedKeyUsages(String accountName, String certificateProfile,
+ RequestOptions requestOptions) {
+ RequestOptions requestOptionsForNextPage = new RequestOptions();
+ requestOptionsForNextPage.setContext(
+ requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
+ return new PagedIterable<>(
+ () -> listExtendedKeyUsagesSinglePage(accountName, certificateProfile, requestOptions),
+ nextLink -> listExtendedKeyUsagesNextSinglePage(nextLink, requestOptionsForNextPage));
+ }
+
+ /**
+ * Submit a sign operation.
+ *
+ * Submit a sign operation under the created account and profile name provided.
+ * Header Parameters
+ *
+ * Header Parameters
+ * | Name | Type | Required | Description |
+ * | client-version | String | No | An optional client version. |
+ * | x-correlation-id | String | No | An identifier used to batch multiple
+ * requests. |
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * signatureAlgorithm: String(RS256/RS384/RS512/PS256/PS384/PS512/ES256/ES384/ES512/ES256K) (Required)
+ * digest: byte[] (Required)
+ * fileHashList (Optional): [
+ * byte[] (Optional)
+ * ]
+ * authenticodeHashList (Optional): [
+ * byte[] (Optional)
+ * ]
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * error (Required): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * }
+ * result (Optional): {
+ * signature: byte[] (Optional)
+ * signingCertificate: byte[] (Optional)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param accountName Azure Trusted Signing account name.
+ * @param certificateProfile Azure Trusted Signing certificate profile name under an account.
+ * @param body Body parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return provides status details for long running operations along with {@link Response} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> signWithResponseAsync(String accountName, String certificateProfile,
+ BinaryData body, RequestOptions requestOptions) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return FluxUtil.withContext(
+ context -> service.sign(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(),
+ accountName, certificateProfile, contentType, accept, body, requestOptions, context));
+ }
+
+ /**
+ * Submit a sign operation.
+ *
+ * Submit a sign operation under the created account and profile name provided.
+ * Header Parameters
+ *
+ * Header Parameters
+ * | Name | Type | Required | Description |
+ * | client-version | String | No | An optional client version. |
+ * | x-correlation-id | String | No | An identifier used to batch multiple
+ * requests. |
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * signatureAlgorithm: String(RS256/RS384/RS512/PS256/PS384/PS512/ES256/ES384/ES512/ES256K) (Required)
+ * digest: byte[] (Required)
+ * fileHashList (Optional): [
+ * byte[] (Optional)
+ * ]
+ * authenticodeHashList (Optional): [
+ * byte[] (Optional)
+ * ]
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * error (Required): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * }
+ * result (Optional): {
+ * signature: byte[] (Optional)
+ * signingCertificate: byte[] (Optional)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param accountName Azure Trusted Signing account name.
+ * @param certificateProfile Azure Trusted Signing certificate profile name under an account.
+ * @param body Body parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return provides status details for long running operations along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response signWithResponse(String accountName, String certificateProfile, BinaryData body,
+ RequestOptions requestOptions) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return service.signSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), accountName,
+ certificateProfile, contentType, accept, body, requestOptions, Context.NONE);
+ }
+
+ /**
+ * Submit a sign operation.
+ *
+ * Submit a sign operation under the created account and profile name provided.
+ * Header Parameters
+ *
+ * Header Parameters
+ * | Name | Type | Required | Description |
+ * | client-version | String | No | An optional client version. |
+ * | x-correlation-id | String | No | An identifier used to batch multiple
+ * requests. |
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * signatureAlgorithm: String(RS256/RS384/RS512/PS256/PS384/PS512/ES256/ES384/ES512/ES256K) (Required)
+ * digest: byte[] (Required)
+ * fileHashList (Optional): [
+ * byte[] (Optional)
+ * ]
+ * authenticodeHashList (Optional): [
+ * byte[] (Optional)
+ * ]
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * error (Required): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * }
+ * result (Optional): {
+ * signature: byte[] (Optional)
+ * signingCertificate: byte[] (Optional)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param accountName Azure Trusted Signing account name.
+ * @param certificateProfile Azure Trusted Signing certificate profile name under an account.
+ * @param body Body parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link PollerFlux} for polling of provides status details for long running operations.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginSignAsync(String accountName, String certificateProfile,
+ BinaryData body, RequestOptions requestOptions) {
+ return PollerFlux.create(Duration.ofSeconds(1),
+ () -> this.signWithResponseAsync(accountName, certificateProfile, body, requestOptions),
+ new com.azure.developer.trustedsigning.implementation.OperationLocationPollingStrategy<>(
+ new PollingStrategyOptions(this.client.getHttpPipeline())
+ .setEndpoint("{endpoint}".replace("{endpoint}", this.client.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.client.getServiceVersion().getVersion()),
+ "result"),
+ TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class));
+ }
+
+ /**
+ * Submit a sign operation.
+ *
+ * Submit a sign operation under the created account and profile name provided.
+ * Header Parameters
+ *
+ * Header Parameters
+ * | Name | Type | Required | Description |
+ * | client-version | String | No | An optional client version. |
+ * | x-correlation-id | String | No | An identifier used to batch multiple
+ * requests. |
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * signatureAlgorithm: String(RS256/RS384/RS512/PS256/PS384/PS512/ES256/ES384/ES512/ES256K) (Required)
+ * digest: byte[] (Required)
+ * fileHashList (Optional): [
+ * byte[] (Optional)
+ * ]
+ * authenticodeHashList (Optional): [
+ * byte[] (Optional)
+ * ]
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * error (Required): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * }
+ * result (Optional): {
+ * signature: byte[] (Optional)
+ * signingCertificate: byte[] (Optional)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param accountName Azure Trusted Signing account name.
+ * @param certificateProfile Azure Trusted Signing certificate profile name under an account.
+ * @param body Body parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link SyncPoller} for polling of provides status details for long running operations.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginSign(String accountName, String certificateProfile, BinaryData body,
+ RequestOptions requestOptions) {
+ return SyncPoller.createPoller(Duration.ofSeconds(1),
+ () -> this.signWithResponse(accountName, certificateProfile, body, requestOptions),
+ new com.azure.developer.trustedsigning.implementation.SyncOperationLocationPollingStrategy<>(
+ new PollingStrategyOptions(this.client.getHttpPipeline())
+ .setEndpoint("{endpoint}".replace("{endpoint}", this.client.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.client.getServiceVersion().getVersion()),
+ "result"),
+ TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class));
+ }
+
+ /**
+ * Submit a sign operation.
+ *
+ * Submit a sign operation under the created account and profile name provided.
+ * Header Parameters
+ *
+ * Header Parameters
+ * | Name | Type | Required | Description |
+ * | client-version | String | No | An optional client version. |
+ * | x-correlation-id | String | No | An identifier used to batch multiple
+ * requests. |
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * signatureAlgorithm: String(RS256/RS384/RS512/PS256/PS384/PS512/ES256/ES384/ES512/ES256K) (Required)
+ * digest: byte[] (Required)
+ * fileHashList (Optional): [
+ * byte[] (Optional)
+ * ]
+ * authenticodeHashList (Optional): [
+ * byte[] (Optional)
+ * ]
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * error (Required): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * }
+ * result (Optional): {
+ * signature: byte[] (Optional)
+ * signingCertificate: byte[] (Optional)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param accountName Azure Trusted Signing account name.
+ * @param certificateProfile Azure Trusted Signing certificate profile name under an account.
+ * @param body Body parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link PollerFlux} for polling of provides status details for long running operations.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginSignWithModelAsync(String accountName,
+ String certificateProfile, BinaryData body, RequestOptions requestOptions) {
+ return PollerFlux.create(Duration.ofSeconds(1),
+ () -> this.signWithResponseAsync(accountName, certificateProfile, body, requestOptions),
+ new com.azure.developer.trustedsigning.implementation.OperationLocationPollingStrategy<>(
+ new PollingStrategyOptions(this.client.getHttpPipeline())
+ .setEndpoint("{endpoint}".replace("{endpoint}", this.client.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.client.getServiceVersion().getVersion()),
+ "result"),
+ TypeReference.createInstance(PollOperationDetails.class), TypeReference.createInstance(SignResult.class));
+ }
+
+ /**
+ * Submit a sign operation.
+ *
+ * Submit a sign operation under the created account and profile name provided.
+ * Header Parameters
+ *
+ * Header Parameters
+ * | Name | Type | Required | Description |
+ * | client-version | String | No | An optional client version. |
+ * | x-correlation-id | String | No | An identifier used to batch multiple
+ * requests. |
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * signatureAlgorithm: String(RS256/RS384/RS512/PS256/PS384/PS512/ES256/ES384/ES512/ES256K) (Required)
+ * digest: byte[] (Required)
+ * fileHashList (Optional): [
+ * byte[] (Optional)
+ * ]
+ * authenticodeHashList (Optional): [
+ * byte[] (Optional)
+ * ]
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * error (Required): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * }
+ * result (Optional): {
+ * signature: byte[] (Optional)
+ * signingCertificate: byte[] (Optional)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param accountName Azure Trusted Signing account name.
+ * @param certificateProfile Azure Trusted Signing certificate profile name under an account.
+ * @param body Body parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link SyncPoller} for polling of provides status details for long running operations.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginSignWithModel(String accountName,
+ String certificateProfile, BinaryData body, RequestOptions requestOptions) {
+ return SyncPoller.createPoller(Duration.ofSeconds(1),
+ () -> this.signWithResponse(accountName, certificateProfile, body, requestOptions),
+ new com.azure.developer.trustedsigning.implementation.SyncOperationLocationPollingStrategy<>(
+ new PollingStrategyOptions(this.client.getHttpPipeline())
+ .setEndpoint("{endpoint}".replace("{endpoint}", this.client.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.client.getServiceVersion().getVersion()),
+ "result"),
+ TypeReference.createInstance(PollOperationDetails.class), TypeReference.createInstance(SignResult.class));
+ }
+
+ /**
+ * Gets a list of extended key usage object identifiers that are allowed for this account and profile combination.
+ *
+ * Get the next page of items.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * eku: String (Required)
+ * }
+ * }
+ *
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return paged collection of ExtendedKeyUsage items along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listExtendedKeyUsagesNextSinglePageAsync(String nextLink,
+ RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listExtendedKeyUsagesNext(nextLink, this.client.getEndpoint(), accept,
+ requestOptions, context))
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
+ }
+
+ /**
+ * Gets a list of extended key usage object identifiers that are allowed for this account and profile combination.
+ *
+ * Get the next page of items.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * eku: String (Required)
+ * }
+ * }
+ *
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return paged collection of ExtendedKeyUsage items along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listExtendedKeyUsagesNextSinglePage(String nextLink,
+ RequestOptions requestOptions) {
+ final String accept = "application/json";
+ Response res = service.listExtendedKeyUsagesNextSync(nextLink, this.client.getEndpoint(), accept,
+ requestOptions, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
+ }
+
+ private List getValues(BinaryData binaryData, String path) {
+ try {
+ Map, ?> obj = binaryData.toObject(Map.class);
+ List> values = (List>) obj.get(path);
+ return values.stream().map(BinaryData::fromObject).collect(Collectors.toList());
+ } catch (RuntimeException e) {
+ return null;
+ }
+ }
+
+ private String getNextLink(BinaryData binaryData, String path) {
+ try {
+ Map, ?> obj = binaryData.toObject(Map.class);
+ return (String) obj.get(path);
+ } catch (RuntimeException e) {
+ return null;
+ }
+ }
+}
diff --git a/sdk/developer/azure-developer-trustedsigning/src/main/java/com/azure/developer/trustedsigning/implementation/OperationLocationPollingStrategy.java b/sdk/developer/azure-developer-trustedsigning/src/main/java/com/azure/developer/trustedsigning/implementation/OperationLocationPollingStrategy.java
new file mode 100644
index 000000000000..aa70806c24e2
--- /dev/null
+++ b/sdk/developer/azure-developer-trustedsigning/src/main/java/com/azure/developer/trustedsigning/implementation/OperationLocationPollingStrategy.java
@@ -0,0 +1,140 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.developer.trustedsigning.implementation;
+
+import com.azure.core.exception.AzureException;
+import com.azure.core.http.HttpHeader;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.BinaryData;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.polling.LongRunningOperationStatus;
+import com.azure.core.util.polling.OperationResourcePollingStrategy;
+import com.azure.core.util.polling.PollResponse;
+import com.azure.core.util.polling.PollingContext;
+import com.azure.core.util.polling.PollingStrategyOptions;
+import com.azure.core.util.serializer.JsonSerializerProviders;
+import com.azure.core.util.serializer.ObjectSerializer;
+import com.azure.core.util.serializer.TypeReference;
+import java.time.Duration;
+import java.time.OffsetDateTime;
+import reactor.core.publisher.Mono;
+
+// DO NOT modify this helper class
+
+/**
+ * Implements an operation location polling strategy, from Operation-Location.
+ *
+ * @param the type of the response type from a polling call, or BinaryData if raw response body should be kept
+ * @param the type of the final result object to deserialize into, or BinaryData if raw response body should be
+ * kept
+ */
+public final class OperationLocationPollingStrategy extends OperationResourcePollingStrategy {
+
+ private static final ClientLogger LOGGER = new ClientLogger(OperationLocationPollingStrategy.class);
+
+ private final ObjectSerializer serializer;
+ private final String endpoint;
+ private final String propertyName;
+
+ /**
+ * Creates an instance of the operation resource polling strategy.
+ *
+ * @param pollingStrategyOptions options to configure this polling strategy.
+ * @throws NullPointerException if {@code pollingStrategyOptions} is null.
+ */
+ public OperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOptions) {
+ this(pollingStrategyOptions, null);
+ }
+
+ /**
+ * Creates an instance of the operation resource polling strategy.
+ *
+ * @param pollingStrategyOptions options to configure this polling strategy.
+ * @param propertyName the name of the property to extract final result.
+ * @throws NullPointerException if {@code pollingStrategyOptions} is null.
+ */
+ public OperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOptions, String propertyName) {
+ super(PollingUtils.OPERATION_LOCATION_HEADER, pollingStrategyOptions);
+ this.propertyName = propertyName;
+ this.endpoint = pollingStrategyOptions.getEndpoint();
+ this.serializer = pollingStrategyOptions.getSerializer() != null
+ ? pollingStrategyOptions.getSerializer()
+ : JsonSerializerProviders.createInstance(true);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Mono> onInitialResponse(Response> response, PollingContext pollingContext,
+ TypeReference pollResponseType) {
+ // Response> is Response
+
+ HttpHeader operationLocationHeader = response.getHeaders().get(PollingUtils.OPERATION_LOCATION_HEADER);
+ if (operationLocationHeader != null) {
+ pollingContext.setData(PollingUtils.OPERATION_LOCATION_HEADER.getCaseSensitiveName(),
+ PollingUtils.getAbsolutePath(operationLocationHeader.getValue(), endpoint, LOGGER));
+ }
+ final String httpMethod = response.getRequest().getHttpMethod().name();
+ pollingContext.setData(PollingUtils.HTTP_METHOD, httpMethod);
+ pollingContext.setData(PollingUtils.REQUEST_URL, response.getRequest().getUrl().toString());
+
+ if (response.getStatusCode() == 200
+ || response.getStatusCode() == 201
+ || response.getStatusCode() == 202
+ || response.getStatusCode() == 204) {
+ final Duration retryAfter
+ = PollingUtils.getRetryAfterFromHeaders(response.getHeaders(), OffsetDateTime::now);
+ final Mono> pollResponseMono
+ = PollingUtils.deserializeResponse((BinaryData) response.getValue(), serializer, pollResponseType)
+ .onErrorResume(exception -> {
+ LOGGER.info("Failed to parse initial response.");
+ return Mono.empty();
+ })
+ .map(value -> new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, value, retryAfter));
+ return pollResponseMono.switchIfEmpty(
+ Mono.fromSupplier(() -> new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, null, retryAfter)));
+ } else {
+ return Mono
+ .error(
+ new AzureException(String.format(
+ "Operation failed or cancelled with status code %d,"
+ + ", '%s' header: %s, and response body: %s",
+ response.getStatusCode(), PollingUtils.OPERATION_LOCATION_HEADER, operationLocationHeader,
+ response.getValue())));
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Mono getResult(PollingContext pollingContext, TypeReference resultType) {
+ if (pollingContext.getLatestResponse().getStatus() == LongRunningOperationStatus.FAILED) {
+ return Mono.error(new AzureException("Long running operation failed."));
+ } else if (pollingContext.getLatestResponse().getStatus() == LongRunningOperationStatus.USER_CANCELLED) {
+ return Mono.error(new AzureException("Long running operation cancelled."));
+ }
+ if (propertyName != null) {
+ // take the last poll response body from PollingContext,
+ // and de-serialize the property as final result
+ BinaryData latestResponseBody
+ = BinaryData.fromString(pollingContext.getData(PollingUtils.POLL_RESPONSE_BODY));
+ return PollingUtils
+ .deserializeResponse(latestResponseBody, serializer, PollingUtils.POST_POLL_RESULT_TYPE_REFERENCE)
+ .flatMap(value -> {
+ if (value.get(propertyName) != null) {
+ return BinaryData.fromObjectAsync(value.get(propertyName))
+ .flatMap(result -> PollingUtils.deserializeResponse(result, serializer, resultType));
+ } else {
+ return Mono.error(new AzureException("Cannot get final result"));
+ }
+ })
+ .switchIfEmpty(Mono.error(new AzureException("Cannot get final result")));
+ } else {
+ return super.getResult(pollingContext, resultType);
+ }
+ }
+}
diff --git a/sdk/developer/azure-developer-trustedsigning/src/main/java/com/azure/developer/trustedsigning/implementation/PollingUtils.java b/sdk/developer/azure-developer-trustedsigning/src/main/java/com/azure/developer/trustedsigning/implementation/PollingUtils.java
new file mode 100644
index 000000000000..4500d3989b1f
--- /dev/null
+++ b/sdk/developer/azure-developer-trustedsigning/src/main/java/com/azure/developer/trustedsigning/implementation/PollingUtils.java
@@ -0,0 +1,151 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.developer.trustedsigning.implementation;
+
+import com.azure.core.http.HttpHeaderName;
+import com.azure.core.http.HttpHeaders;
+import com.azure.core.util.BinaryData;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.DateTimeRfc1123;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.serializer.ObjectSerializer;
+import com.azure.core.util.serializer.TypeReference;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.time.DateTimeException;
+import java.time.Duration;
+import java.time.OffsetDateTime;
+import java.time.temporal.ChronoUnit;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.function.Supplier;
+import reactor.core.publisher.Mono;
+
+// DO NOT modify this helper class
+
+final class PollingUtils {
+
+ public static final TypeReference