diff --git a/sdk/confidentialledger/azure-security-confidentialledger/CHANGELOG.md b/sdk/confidentialledger/azure-security-confidentialledger/CHANGELOG.md index e007cb1d1667..05be514617d9 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/CHANGELOG.md +++ b/sdk/confidentialledger/azure-security-confidentialledger/CHANGELOG.md @@ -1,14 +1,238 @@ # Release History -## 1.1.0-beta.4 (Unreleased) +## 1.1.0-beta.4 (2026-06-16) + +### Breaking Changes + +#### `ConfidentialLedgerClientBuilder` was modified + +* `credential(com.azure.core.credential.TokenCredential)` was removed + +#### `ConfidentialLedgerServiceVersion` was modified + +* `V2022_05_13` was removed ### Features Added -### Breaking Changes +* `models.ReceiptLeafComponents` was added -### Bugs Fixed +* `models.UserDefinedFunctionHook` was added -### Other Changes +* `models.UserDefinedRole` was added + +* `models.Collection` was added + +* `models.LedgerUser` was added + +* `models.ConfidentialLedgerEnclaves` was added + +* `models.Metadata` was added + +* `models.ApplicationClaim` was added + +* `models.UserDefinedFunctionExecutionResponse` was added + +* `models.Role` was added + +* `models.LedgerUserMultipleRoles` was added + +* `models.JsRuntimeOptions` was added + +* `models.ClaimDigest` was added + +* `models.TransactionState` was added + +* `models.Bundle` was added + +* `models.LedgerQueryResult` was added + +* `models.UserDefinedFunction` was added + +* `models.UserDefinedFunctionExecutionStatus` was added + +* `models.UserDefinedRoles` was added + +* `models.ModuleDef` was added + +* `models.ReceiptElement` was added + +* `models.EnclaveQuote` was added + +* `models.TransactionStatus` was added + +* `models.ForwardingRequired` was added + +* `models.UserDefinedFunctionExecutionProperties` was added + +* `models.ConfidentialLedgerQueryState` was added + +* `models.RedirectionStrategy` was added + +* `models.InterpreterReusePolicy` was added + +* `models.LedgerEntry` was added + +* `models.UserDefinedFunctionExecutionError` was added + +* `models.UserDefinedFunctionExecutionResult` was added + +* `models.ApplicationClaimProtocol` was added + +* `models.ConsortiumMember` was added + +* `models.MethodToEndpointProperties` was added + +* `models.ReceiptContents` was added + +* `models.LedgerEntryClaim` was added + +* `models.Mode` was added + +* `models.TransactionReceipt` was added + +* `models.ApplicationClaimKind` was added + +* `ConfidentialLedgerRedirectPolicy` was added + +* `models.EndpointProperties` was added + +* `models.ConfidentialLedgerUserRoleName` was added + +* `models.Constitution` was added + +* `models.LedgerWriteResult` was added + +#### `ConfidentialLedgerAsyncClient` was modified + +* `getUserDefinedFunctionWithResponse(java.lang.String,com.azure.core.http.rest.RequestOptions)` was added +* `createUserDefinedFunction(java.lang.String,models.UserDefinedFunction)` was added +* `createOrUpdateUser(java.lang.String,models.LedgerUser)` was added +* `updateUserDefinedRoleStableWithResponse(com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions)` was added +* `getRuntimeOptionsWithResponse(com.azure.core.http.rest.RequestOptions)` was added +* `createOrUpdateLedgerUserWithResponse(java.lang.String,com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions)` was added +* `listLedgerEntries(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `listTags(com.azure.core.http.rest.RequestOptions)` was added +* `executeUserDefinedFunction(java.lang.String,models.UserDefinedFunctionExecutionProperties)` was added +* `listTags()` was added +* `createUserDefinedRoleStableWithResponse(com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions)` was added +* `createLedgerEntry(models.LedgerEntry,java.lang.String,java.lang.String)` was added +* `createUserDefinedRoleStable(models.UserDefinedRoles)` was added +* `deleteLedgerUser(java.lang.String)` was added +* `updateRuntimeOptionsStableWithResponse(com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions)` was added +* `createUserDefinedEndpoint(models.Bundle)` was added +* `getLedgerUserWithResponse(java.lang.String,com.azure.core.http.rest.RequestOptions)` was added +* `listLedgerEntries()` was added +* `getUserDefinedEndpoint()` was added +* `executeUserDefinedFunction(java.lang.String)` was added +* `listUsers(com.azure.core.http.rest.RequestOptions)` was added +* `getLedgerUser(java.lang.String)` was added +* `getCurrentLedgerEntry()` was added +* `deleteUserDefinedFunctionWithResponse(java.lang.String,com.azure.core.http.rest.RequestOptions)` was added +* `getEnclaveQuotes()` was added +* `getUser(java.lang.String)` was added +* `getUserDefinedFunction(java.lang.String)` was added +* `updateRuntimeOptionsStable(models.JsRuntimeOptions)` was added +* `getLedgerEntry(java.lang.String,java.lang.String)` was added +* `getConstitution()` was added +* `listCollections()` was added +* `deleteLedgerUserWithResponse(java.lang.String,com.azure.core.http.rest.RequestOptions)` was added +* `createOrUpdateLedgerUser(java.lang.String,models.LedgerUserMultipleRoles)` was added +* `deleteUserDefinedRoleStableWithResponse(java.lang.String,com.azure.core.http.rest.RequestOptions)` was added +* `getCurrentLedgerEntry(java.lang.String)` was added +* `executeUserDefinedFunctionWithResponse(java.lang.String,com.azure.core.http.rest.RequestOptions)` was added +* `getUserDefinedEndpointWithResponse(com.azure.core.http.rest.RequestOptions)` was added +* `getTransactionStatus(java.lang.String)` was added +* `getReceipt(java.lang.String)` was added +* `listTags(java.lang.String)` was added +* `createUserDefinedEndpointWithResponse(com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions)` was added +* `deleteUser(java.lang.String)` was added +* `getUserDefinedRole(java.lang.String)` was added +* `getUserDefinedEndpointsModuleWithResponse(java.lang.String,com.azure.core.http.rest.RequestOptions)` was added +* `listUserDefinedFunctions()` was added +* `getLedgerEntry(java.lang.String)` was added +* `getUserDefinedRoleWithResponse(java.lang.String,com.azure.core.http.rest.RequestOptions)` was added +* `deleteUserDefinedRoleStable(java.lang.String)` was added +* `getUserDefinedEndpointsModule(java.lang.String)` was added +* `listUsers()` was added +* `getRuntimeOptions()` was added +* `createUserDefinedFunctionWithResponse(java.lang.String,com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions)` was added +* `listConsortiumMembers()` was added +* `listLedgerUsers(com.azure.core.http.rest.RequestOptions)` was added +* `listUserDefinedFunctions(com.azure.core.http.rest.RequestOptions)` was added +* `updateUserDefinedRoleStable(models.UserDefinedRoles)` was added +* `createLedgerEntry(models.LedgerEntry)` was added +* `listLedgerUsers()` was added +* `deleteUserDefinedFunction(java.lang.String)` was added + +#### `ConfidentialLedgerServiceVersion` was modified + +* `V2026_02_23` was added + +#### `ConfidentialLedgerClient` was modified + +* `deleteLedgerUser(java.lang.String)` was added +* `getUserDefinedRoleWithResponse(java.lang.String,com.azure.core.http.rest.RequestOptions)` was added +* `getUserDefinedEndpointsModule(java.lang.String)` was added +* `listTags()` was added +* `listUserDefinedFunctions(com.azure.core.http.rest.RequestOptions)` was added +* `updateRuntimeOptionsStable(models.JsRuntimeOptions)` was added +* `deleteUserDefinedFunction(java.lang.String)` was added +* `getLedgerEntry(java.lang.String,java.lang.String)` was added +* `listLedgerEntries()` was added +* `getUserDefinedEndpointWithResponse(com.azure.core.http.rest.RequestOptions)` was added +* `updateRuntimeOptionsStableWithResponse(com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions)` was added +* `getCurrentLedgerEntry()` was added +* `getTransactionStatus(java.lang.String)` was added +* `listCollections()` was added +* `listLedgerUsers()` was added +* `getCurrentLedgerEntry(java.lang.String)` was added +* `getReceipt(java.lang.String)` was added +* `createOrUpdateLedgerUserWithResponse(java.lang.String,com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions)` was added +* `deleteUserDefinedRoleStable(java.lang.String)` was added +* `executeUserDefinedFunction(java.lang.String,models.UserDefinedFunctionExecutionProperties)` was added +* `getUserDefinedFunction(java.lang.String)` was added +* `deleteUserDefinedFunctionWithResponse(java.lang.String,com.azure.core.http.rest.RequestOptions)` was added +* `getUserDefinedFunctionWithResponse(java.lang.String,com.azure.core.http.rest.RequestOptions)` was added +* `listLedgerUsers(com.azure.core.http.rest.RequestOptions)` was added +* `getLedgerEntry(java.lang.String)` was added +* `deleteLedgerUserWithResponse(java.lang.String,com.azure.core.http.rest.RequestOptions)` was added +* `getLedgerUserWithResponse(java.lang.String,com.azure.core.http.rest.RequestOptions)` was added +* `getUser(java.lang.String)` was added +* `deleteUser(java.lang.String)` was added +* `getUserDefinedEndpoint()` was added +* `createOrUpdateLedgerUser(java.lang.String,models.LedgerUserMultipleRoles)` was added +* `getLedgerUser(java.lang.String)` was added +* `getEnclaveQuotes()` was added +* `listTags(java.lang.String)` was added +* `createUserDefinedEndpoint(models.Bundle)` was added +* `createUserDefinedEndpointWithResponse(com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions)` was added +* `getUserDefinedEndpointsModuleWithResponse(java.lang.String,com.azure.core.http.rest.RequestOptions)` was added +* `createUserDefinedFunctionWithResponse(java.lang.String,com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions)` was added +* `listUserDefinedFunctions()` was added +* `getConstitution()` was added +* `updateUserDefinedRoleStableWithResponse(com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions)` was added +* `createOrUpdateUser(java.lang.String,models.LedgerUser)` was added +* `createUserDefinedRoleStable(models.UserDefinedRoles)` was added +* `executeUserDefinedFunction(java.lang.String)` was added +* `getUserDefinedRole(java.lang.String)` was added +* `listTags(com.azure.core.http.rest.RequestOptions)` was added +* `deleteUserDefinedRoleStableWithResponse(java.lang.String,com.azure.core.http.rest.RequestOptions)` was added +* `getRuntimeOptionsWithResponse(com.azure.core.http.rest.RequestOptions)` was added +* `executeUserDefinedFunctionWithResponse(java.lang.String,com.azure.core.http.rest.RequestOptions)` was added +* `getRuntimeOptions()` was added +* `listUsers()` was added +* `listConsortiumMembers()` was added +* `listLedgerEntries(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `updateUserDefinedRoleStable(models.UserDefinedRoles)` was added +* `createUserDefinedRoleStableWithResponse(com.azure.core.util.BinaryData,com.azure.core.http.rest.RequestOptions)` was added +* `createUserDefinedFunction(java.lang.String,models.UserDefinedFunction)` was added +* `createLedgerEntry(models.LedgerEntry,java.lang.String,java.lang.String)` was added +* `listUsers(com.azure.core.http.rest.RequestOptions)` was added +* `createLedgerEntry(models.LedgerEntry)` was added + +#### `certificate.ConfidentialLedgerCertificateServiceVersion` was modified + +* `V2024_12_09_PREVIEW` was added ## 1.1.0-beta.3 (2026-06-05) diff --git a/sdk/confidentialledger/azure-security-confidentialledger/assets.json b/sdk/confidentialledger/azure-security-confidentialledger/assets.json index 957055dfa611..6b2b025879d9 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/assets.json +++ b/sdk/confidentialledger/azure-security-confidentialledger/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/confidentialledger/azure-security-confidentialledger", - "Tag": "java/confidentialledger/azure-security-confidentialledger_9c0435eeeb" + "Tag": "java/confidentialledger/azure-security-confidentialledger_2827c512f8" } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/pom.xml b/sdk/confidentialledger/azure-security-confidentialledger/pom.xml index 0d41b829d56f..acf28abb6d93 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/pom.xml +++ b/sdk/confidentialledger/azure-security-confidentialledger/pom.xml @@ -42,9 +42,10 @@ false + true - 0.2 - 0.1 + 0.0 + 0.0 diff --git a/sdk/confidentialledger/azure-security-confidentialledger/revapi-suppressions.json b/sdk/confidentialledger/azure-security-confidentialledger/revapi-suppressions.json new file mode 100644 index 000000000000..da1ee971fe5f --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/revapi-suppressions.json @@ -0,0 +1,20 @@ +[ + { + "extension": "revapi.differences", + "configuration": { + "ignore": true, + "differences": [ + { + "code": "java.method.removed", + "old": "method com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder::credential(com.azure.core.credential.TokenCredential)", + "justification": "TypeSpec regeneration removed credential() in favor of addPolicy() for auth configuration. Package is beta." + }, + { + "code": "java.field.removed", + "old": "field com.azure.security.confidentialledger.ConfidentialLedgerServiceVersion.V2022_05_13", + "justification": "Old API version removed in TypeSpec regeneration for stable 2026-02-23. Package is beta." + } + ] + } + } +] diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/ConfidentialLedgerAsyncClient.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/ConfidentialLedgerAsyncClient.java index 67b5f582e7bd..bf93e65b071f 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/ConfidentialLedgerAsyncClient.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/ConfidentialLedgerAsyncClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger; @@ -13,10 +13,35 @@ 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.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.security.confidentialledger.implementation.ConfidentialLedgerClientImpl; +import com.azure.security.confidentialledger.implementation.JsonMergePatchHelper; +import com.azure.security.confidentialledger.models.Bundle; +import com.azure.security.confidentialledger.models.Collection; +import com.azure.security.confidentialledger.models.ConfidentialLedgerEnclaves; +import com.azure.security.confidentialledger.models.ConsortiumMember; +import com.azure.security.confidentialledger.models.Constitution; +import com.azure.security.confidentialledger.models.JsRuntimeOptions; +import com.azure.security.confidentialledger.models.LedgerEntry; +import com.azure.security.confidentialledger.models.LedgerQueryResult; +import com.azure.security.confidentialledger.models.LedgerUser; +import com.azure.security.confidentialledger.models.LedgerUserMultipleRoles; +import com.azure.security.confidentialledger.models.LedgerWriteResult; +import com.azure.security.confidentialledger.models.ModuleDef; +import com.azure.security.confidentialledger.models.TransactionReceipt; +import com.azure.security.confidentialledger.models.TransactionStatus; +import com.azure.security.confidentialledger.models.UserDefinedFunction; +import com.azure.security.confidentialledger.models.UserDefinedFunctionExecutionProperties; +import com.azure.security.confidentialledger.models.UserDefinedFunctionExecutionResponse; +import com.azure.security.confidentialledger.models.UserDefinedRole; +import com.azure.security.confidentialledger.models.UserDefinedRoles; +import java.util.stream.Collectors; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** @@ -40,7 +65,8 @@ public final class ConfidentialLedgerAsyncClient { /** * Gets the constitution used for governance. * - * The constitution is a script that assesses and applies proposals from consortium members. + * The constitution is a script that assesses and applies proposals from + * consortium members. *

Response Body Schema

* *
@@ -57,8 +83,10 @@ public final class ConfidentialLedgerAsyncClient {
      * @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 governance script for the application along with {@link Response} on successful completion of
-     * {@link Mono}.
+     * @return the constitution used for governance.
+     * 
+     * The constitution is a script that assesses and applies proposals from
+     * consortium members along with {@link Response} on successful completion of {@link Mono}.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -97,7 +125,8 @@ public PagedFlux listConsortiumMembers(RequestOptions requestOptions
     /**
      * Gets quotes for all nodes of the Confidential Ledger.
      * 
-     * A quote is an SGX enclave measurement that can be used to verify the validity of a node and its enclave.
+     * A quote is an SGX enclave measurement that can be used to verify the validity
+     * of a node and its enclave.
      * 

Response Body Schema

* *
@@ -121,8 +150,10 @@ public PagedFlux listConsortiumMembers(RequestOptions requestOptions
      * @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 information about the enclaves running the Confidential Ledger along with {@link Response} on successful
-     * completion of {@link Mono}.
+     * @return quotes for all nodes of the Confidential Ledger.
+     * 
+     * A quote is an SGX enclave measurement that can be used to verify the validity
+     * of a node and its enclave along with {@link Response} on successful completion of {@link Mono}.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -157,11 +188,45 @@ public PagedFlux listCollections(RequestOptions requestOptions) {
         return this.serviceClient.listCollectionsAsync(requestOptions);
     }
 
+    /**
+     * Gets a list of tags for a collection.
+     * 
+     * Retrieves the tags associated with a collection.
+     * 

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
collectionIdStringNoThe collection id.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * String
+     * }
+     * 
+ * + * @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 tags for a collection. + * + * Retrieves the tags associated with a collection as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTags(RequestOptions requestOptions) { + return this.serviceClient.listTagsAsync(requestOptions); + } + /** * Gets ledger entries from a collection corresponding to a range. * - * A collection id may optionally be specified. Only entries in the specified (or default) collection will be - * returned. + * A collection id may optionally be specified. Only entries in the specified (or + * default) collection will be returned. *

Query Parameters

* * @@ -212,7 +277,9 @@ public PagedFlux listCollections(RequestOptions requestOptions) { * @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 paginated ledger entries returned in response to a query as paginated response with {@link PagedFlux}. + * @return ledger entries from a collection corresponding to a range. + * + * A collection id may optionally be specified as paginated response with {@link PagedFlux}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -282,8 +349,9 @@ public PagedFlux listLedgerEntries(RequestOptions requestOptions) { * @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 returned as a result of a write to the Confidential Ledger, the transaction id in the response indicates - * when the write will become durable along with {@link Response} on successful completion of {@link Mono}. + * @return returned as a result of a write to the Confidential Ledger, the transaction id + * in the response indicates when the write will become durable along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -292,12 +360,14 @@ public Mono> createLedgerEntryWithResponse(BinaryData entry } /** - * Gets the ledger entry at the specified transaction id. A collection id may optionally be specified to indicate - * the collection from which to fetch the value. - * - * To return older ledger entries, the relevant sections of the ledger must be read from disk and validated. To - * prevent blocking within the enclave, the response will indicate whether the entry is ready and part of the - * response, or if the loading is still ongoing. + * Gets the ledger entry at the specified transaction id. A collection id may + * optionally be specified to indicate the collection from which to fetch the + * value. + * + * To return older ledger entries, the relevant sections of the ledger must be + * read from disk and validated. To prevent blocking within the enclave, the + * response will indicate whether the entry is ready and part of the response, or + * if the loading is still ongoing. *

Query Parameters

*
Query Parameters
* @@ -348,8 +418,8 @@ public Mono> createLedgerEntryWithResponse(BinaryData entry * @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 result of querying for a ledger entry from an older transaction id along with {@link Response} on - * successful completion of {@link Mono}. + * @return the ledger entry at the specified transaction id along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -500,7 +570,9 @@ public Mono> getTransactionStatusWithResponse(String transa * @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 an entry in the ledger along with {@link Response} on successful completion of {@link Mono}. + * @return the current value available in the ledger. + * + * A collection id may optionally be specified along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -517,7 +589,7 @@ public Mono> getCurrentLedgerEntryWithResponse(RequestOptio *
      * {@code
      * {
-     *     assignedRole: String(Administrator/Contributor/Reader) (Required)
+     *     assignedRole: String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     userId: String (Optional)
      * }
      * }
@@ -528,7 +600,9 @@ public Mono> getCurrentLedgerEntryWithResponse(RequestOptio
      * @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 paginated users returned in response to a query as paginated response with {@link PagedFlux}.
+     * @return details on a list of users.
+     * 
+     * All users' object IDs and single role per user will be returned as paginated response with {@link PagedFlux}.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.COLLECTION)
@@ -545,8 +619,8 @@ public PagedFlux listUsers(RequestOptions requestOptions) {
      * 
      * {@code
      * {
-     *     assignedRoles (Required): [
-     *         String(Administrator/Contributor/Reader) (Required)
+     *     assignedRoles (Optional, Required on create): [
+     *         String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     ]
      *     userId: String (Optional)
      * }
@@ -558,7 +632,9 @@ public PagedFlux listUsers(RequestOptions requestOptions) {
      * @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 paginated users returned in response to a query as paginated response with {@link PagedFlux}.
+     * @return details on a list of users.
+     * 
+     * All users' object IDs and multiple roles will be returned as paginated response with {@link PagedFlux}.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.COLLECTION)
@@ -590,7 +666,7 @@ public Mono> deleteUserWithResponse(String userId, RequestOptions
      * 
      * {@code
      * {
-     *     assignedRole: String(Administrator/Contributor/Reader) (Required)
+     *     assignedRole: String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     userId: String (Optional)
      * }
      * }
@@ -619,7 +695,7 @@ public Mono> getUserWithResponse(String userId, RequestOpti
      * 
      * {@code
      * {
-     *     assignedRole: String(Administrator/Contributor/Reader) (Required)
+     *     assignedRole: String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     userId: String (Optional)
      * }
      * }
@@ -630,7 +706,7 @@ public Mono> getUserWithResponse(String userId, RequestOpti
      * 
      * {@code
      * {
-     *     assignedRole: String(Administrator/Contributor/Reader) (Required)
+     *     assignedRole: String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     userId: String (Optional)
      * }
      * }
@@ -677,8 +753,8 @@ public Mono> deleteLedgerUserWithResponse(String userId, RequestO
      * 
      * {@code
      * {
-     *     assignedRoles (Required): [
-     *         String(Administrator/Contributor/Reader) (Required)
+     *     assignedRoles (Optional, Required on create): [
+     *         String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     ]
      *     userId: String (Optional)
      * }
@@ -708,8 +784,8 @@ public Mono> getLedgerUserWithResponse(String userId, Reque
      * 
      * {@code
      * {
-     *     assignedRoles (Required): [
-     *         String(Administrator/Contributor/Reader) (Required)
+     *     assignedRoles (Optional, Required on create): [
+     *         String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     ]
      *     userId: String (Optional)
      * }
@@ -721,8 +797,8 @@ public Mono> getLedgerUserWithResponse(String userId, Reque
      * 
      * {@code
      * {
-     *     assignedRoles (Required): [
-     *         String(Administrator/Contributor/Reader) (Required)
+     *     assignedRoles (Optional, Required on create): [
+     *         String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     ]
      *     userId: String (Optional)
      * }
@@ -760,7 +836,9 @@ public Mono> createOrUpdateLedgerUserWithResponse(String us
      *             String (Required): {
      *                 get (Optional): {
      *                     authn_policies (Required): [
-     *                         Object (Required)
+     *                          (Required){
+     *                             String: BinaryData (Required)
+     *                         }
      *                     ]
      *                     forwarding_required: String(sometimes/always/never) (Required)
      *                     interpreter_reuse (Optional): {
@@ -769,7 +847,9 @@ public Mono> createOrUpdateLedgerUserWithResponse(String us
      *                     js_function: String (Optional)
      *                     js_module: String (Optional)
      *                     mode: String(readwrite/readonly/historical) (Optional)
-     *                     openapi: Object (Optional)
+     *                     openapi (Optional): {
+     *                         String: BinaryData (Required)
+     *                     }
      *                     openapi_hidden: Boolean (Optional)
      *                     redirection_strategy: String(none/to_primary/to_backup) (Optional)
      *                 }
@@ -779,7 +859,12 @@ public Mono> createOrUpdateLedgerUserWithResponse(String us
      *             }
      *         }
      *     }
-     *     modules: Object (Required)
+     *     modules (Required): [
+     *          (Required){
+     *             module: String (Required)
+     *             name: String (Required)
+     *         }
+     *     ]
      * }
      * }
      * 
@@ -789,7 +874,9 @@ public Mono> createOrUpdateLedgerUserWithResponse(String us * @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 bundle for the user defined endpoints along with {@link Response} on successful completion of + * @return a user defined endpoint. + * + * Returns the user defined endpoint in the ACL instance along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @@ -812,7 +899,9 @@ public Mono> getUserDefinedEndpointWithResponse(RequestOpti * String (Required): { * get (Optional): { * authn_policies (Required): [ - * Object (Required) + * (Required){ + * String: BinaryData (Required) + * } * ] * forwarding_required: String(sometimes/always/never) (Required) * interpreter_reuse (Optional): { @@ -821,7 +910,9 @@ public Mono> getUserDefinedEndpointWithResponse(RequestOpti * js_function: String (Optional) * js_module: String (Optional) * mode: String(readwrite/readonly/historical) (Optional) - * openapi: Object (Optional) + * openapi (Optional): { + * String: BinaryData (Required) + * } * openapi_hidden: Boolean (Optional) * redirection_strategy: String(none/to_primary/to_backup) (Optional) * } @@ -831,12 +922,17 @@ public Mono> getUserDefinedEndpointWithResponse(RequestOpti * } * } * } - * modules: Object (Required) + * modules (Required): [ + * (Required){ + * module: String (Required) + * name: String (Required) + * } + * ] * } * } *
* - * @param bundle bundle parameter description. + * @param bundle Specify a user defined endpoint. * @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. @@ -918,7 +1014,7 @@ public Mono> getRuntimeOptionsWithResponse(RequestOptions r * } *
* - * @param jSRuntimeOptions JS runtime options. + * @param jsRuntimeOptions JS Runtime options. * @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. @@ -929,9 +1025,9 @@ public Mono> getRuntimeOptionsWithResponse(RequestOptions r */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateRuntimeOptionsWithResponse(BinaryData jSRuntimeOptions, + public Mono> updateRuntimeOptionsStableWithResponse(BinaryData jsRuntimeOptions, RequestOptions requestOptions) { - return this.serviceClient.updateRuntimeOptionsWithResponseAsync(jSRuntimeOptions, requestOptions); + return this.serviceClient.updateRuntimeOptionsStableWithResponseAsync(jsRuntimeOptions, requestOptions); } /** @@ -955,7 +1051,7 @@ public Mono> updateRuntimeOptionsWithResponse(BinaryData jS * @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 response body along with {@link Response} on successful completion of {@link Mono}. + * @return module definition along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -1032,8 +1128,10 @@ public Mono> deleteUserDefinedFunctionWithResponse(String functio * @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 user defined function in the ledger along with {@link Response} on successful completion of - * {@link Mono}. + * @return a user defined function. + * + * Returns the user defined function in the Confidential Ledger along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -1159,14 +1257,16 @@ public Mono> executeUserDefinedFunctionWithResponse(String * *
      * {@code
-     * [
-     *      (Required){
-     *         roleName: String (Optional)
-     *         roleActions (Optional): [
-     *             String (Optional)
-     *         ]
-     *     }
-     * ]
+     * {
+     *     role (Required): [
+     *          (Required){
+     *             roleName: String (Optional)
+     *             roleActions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     * }
      * }
      * 
* @@ -1176,7 +1276,10 @@ public Mono> executeUserDefinedFunctionWithResponse(String * @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 definition for roles along with {@link Response} on successful completion of {@link Mono}. + * @return role actions for user defined roles + * + * user defined roles allow users to define and manage app specific AuthZ policy along with {@link Response} on + * successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -1192,69 +1295,110 @@ public Mono> getUserDefinedRoleWithResponse(String roleName * *
      * {@code
-     * [
-     *      (Required){
-     *         roleName: String (Optional)
-     *         roleActions (Optional): [
-     *             String (Optional)
-     *         ]
-     *     }
-     * ]
+     * {
+     *     roles (Optional, Required on create): [
+     *          (Optional, Required on create){
+     *             roleName: String (Optional)
+     *             roleActions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     * }
      * }
      * 
* - * @param roles user defined role. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     roles (Optional, Required on create): [
+     *          (Optional, Required on create){
+     *             roleName: String (Optional)
+     *             roleActions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param body Request body. * @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 Response} on successful completion of {@link Mono}. + * @return roles along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createUserDefinedRoleWithResponse(BinaryData roles, RequestOptions requestOptions) { - return this.serviceClient.createUserDefinedRoleWithResponseAsync(roles, requestOptions); + public Mono> createUserDefinedRoleStableWithResponse(BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.createUserDefinedRoleStableWithResponseAsync(body, requestOptions); } /** - * Patch replaces the allowed action on existing roles,if the desire is to remove an existing action, the role must - * be deleted and recreated. + * Patch replaces the allowed action on existing roles,if the desire is to remove + * an existing action, the role must be deleted and recreated. * * User defined roles allow users to define and manage app specific AuthZ policy. *

Request Body Schema

* *
      * {@code
-     * [
-     *      (Required){
-     *         roleName: String (Optional)
-     *         roleActions (Optional): [
-     *             String (Optional)
-     *         ]
-     *     }
-     * ]
+     * {
+     *     roles (Optional, Required on create): [
+     *          (Optional, Required on create){
+     *             roleName: String (Optional)
+     *             roleActions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     roles (Optional, Required on create): [
+     *          (Optional, Required on create){
+     *             roleName: String (Optional)
+     *             roleActions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     * }
      * }
      * 
* - * @param roles user defined role. + * @param body Request body. * @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 Response} on successful completion of {@link Mono}. + * @return roles along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateUserDefinedRoleWithResponse(BinaryData roles, RequestOptions requestOptions) { - return this.serviceClient.updateUserDefinedRoleWithResponseAsync(roles, requestOptions); + public Mono> updateUserDefinedRoleStableWithResponse(BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.updateUserDefinedRoleStableWithResponseAsync(body, requestOptions); } /** * Deletes user defined roles * - * A user defined role allows the users to create and manage their own role actions using the API. + * A user defined role allows the users to create and manage their own role + * actions using the API. * * @param roleName user defined role name. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1266,7 +1410,1083 @@ public Mono> updateUserDefinedRoleWithResponse(BinaryData roles, */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteUserDefinedRoleWithResponse(String roleName, RequestOptions requestOptions) { - return this.serviceClient.deleteUserDefinedRoleWithResponseAsync(roleName, requestOptions); + public Mono> deleteUserDefinedRoleStableWithResponse(String roleName, + RequestOptions requestOptions) { + return this.serviceClient.deleteUserDefinedRoleStableWithResponseAsync(roleName, requestOptions); + } + + /** + * Gets the constitution used for governance. + * + * The constitution is a script that assesses and applies proposals from + * consortium members. + * + * @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 constitution used for governance. + * + * The constitution is a script that assesses and applies proposals from + * consortium members on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getConstitution() { + // Generated convenience method for getConstitutionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getConstitutionWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Constitution.class)); + } + + /** + * Lists the consortium members. + * + * Consortium members can manage the Confidential Ledger. + * + * @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 list of members in the consortium as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listConsortiumMembers() { + // Generated convenience method for listConsortiumMembers + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listConsortiumMembers(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(ConsortiumMember.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets quotes for all nodes of the Confidential Ledger. + * + * A quote is an SGX enclave measurement that can be used to verify the validity + * of a node and its enclave. + * + * @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 quotes for all nodes of the Confidential Ledger. + * + * A quote is an SGX enclave measurement that can be used to verify the validity + * of a node and its enclave on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getEnclaveQuotes() { + // Generated convenience method for getEnclaveQuotesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getEnclaveQuotesWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ConfidentialLedgerEnclaves.class)); + } + + /** + * Retrieves a list of collection ids present in the Confidential Ledger + * + * Collection ids are user-created collections of ledger entries. + * + * @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 paginated collections returned in response to a query as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listCollections() { + // Generated convenience method for listCollections + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listCollections(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(Collection.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets a list of tags for a collection. + * + * Retrieves the tags associated with a collection. + * + * @param collectionId The collection id. + * @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 tags for a collection. + * + * Retrieves the tags associated with a collection as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTags(String collectionId) { + // Generated convenience method for listTags + RequestOptions requestOptions = new RequestOptions(); + if (collectionId != null) { + requestOptions.addQueryParam("collectionId", collectionId, false); + } + PagedFlux pagedFluxResponse = listTags(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(String.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets a list of tags for a collection. + * + * Retrieves the tags associated with a collection. + * + * @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 tags for a collection. + * + * Retrieves the tags associated with a collection as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTags() { + // Generated convenience method for listTags + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listTags(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(String.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets ledger entries from a collection corresponding to a range. + * + * A collection id may optionally be specified. Only entries in the specified (or + * default) collection will be returned. + * + * @param collectionId The collection id. + * @param fromTransactionId Specify the first transaction ID in a range. + * @param toTransactionId Specify the last transaction ID in a range. + * @param tag Single tag. + * @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 ledger entries from a collection corresponding to a range. + * + * A collection id may optionally be specified as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listLedgerEntries(String collectionId, String fromTransactionId, + String toTransactionId, String tag) { + // Generated convenience method for listLedgerEntries + RequestOptions requestOptions = new RequestOptions(); + if (collectionId != null) { + requestOptions.addQueryParam("collectionId", collectionId, false); + } + if (fromTransactionId != null) { + requestOptions.addQueryParam("fromTransactionId", fromTransactionId, false); + } + if (toTransactionId != null) { + requestOptions.addQueryParam("toTransactionId", toTransactionId, false); + } + if (tag != null) { + requestOptions.addQueryParam("tag", tag, false); + } + PagedFlux pagedFluxResponse = listLedgerEntries(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(LedgerEntry.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets ledger entries from a collection corresponding to a range. + * + * A collection id may optionally be specified. Only entries in the specified (or + * default) collection will be returned. + * + * @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 ledger entries from a collection corresponding to a range. + * + * A collection id may optionally be specified as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listLedgerEntries() { + // Generated convenience method for listLedgerEntries + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listLedgerEntries(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(LedgerEntry.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Writes a ledger entry. + * + * A collection id may optionally be specified. + * + * @param entry Ledger entry. + * @param collectionId The collection id. + * @param tags Comma separated tags. + * @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 returned as a result of a write to the Confidential Ledger, the transaction id + * in the response indicates when the write will become durable on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createLedgerEntry(LedgerEntry entry, String collectionId, String tags) { + // Generated convenience method for createLedgerEntryWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (collectionId != null) { + requestOptions.addQueryParam("collectionId", collectionId, false); + } + if (tags != null) { + requestOptions.addQueryParam("tags", tags, false); + } + return createLedgerEntryWithResponse(BinaryData.fromObject(entry), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LedgerWriteResult.class)); + } + + /** + * Writes a ledger entry. + * + * A collection id may optionally be specified. + * + * @param entry Ledger entry. + * @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 returned as a result of a write to the Confidential Ledger, the transaction id + * in the response indicates when the write will become durable on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createLedgerEntry(LedgerEntry entry) { + // Generated convenience method for createLedgerEntryWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createLedgerEntryWithResponse(BinaryData.fromObject(entry), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LedgerWriteResult.class)); + } + + /** + * Gets the ledger entry at the specified transaction id. A collection id may + * optionally be specified to indicate the collection from which to fetch the + * value. + * + * To return older ledger entries, the relevant sections of the ledger must be + * read from disk and validated. To prevent blocking within the enclave, the + * response will indicate whether the entry is ready and part of the response, or + * if the loading is still ongoing. + * + * @param transactionId Identifies a write transaction. + * @param collectionId The collection id. + * @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 ledger entry at the specified transaction id on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getLedgerEntry(String transactionId, String collectionId) { + // Generated convenience method for getLedgerEntryWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (collectionId != null) { + requestOptions.addQueryParam("collectionId", collectionId, false); + } + return getLedgerEntryWithResponse(transactionId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LedgerQueryResult.class)); + } + + /** + * Gets the ledger entry at the specified transaction id. A collection id may + * optionally be specified to indicate the collection from which to fetch the + * value. + * + * To return older ledger entries, the relevant sections of the ledger must be + * read from disk and validated. To prevent blocking within the enclave, the + * response will indicate whether the entry is ready and part of the response, or + * if the loading is still ongoing. + * + * @param transactionId Identifies a write transaction. + * @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 ledger entry at the specified transaction id on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getLedgerEntry(String transactionId) { + // Generated convenience method for getLedgerEntryWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLedgerEntryWithResponse(transactionId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LedgerQueryResult.class)); + } + + /** + * Gets a receipt certifying ledger contents at a particular transaction id. + * + * @param transactionId Identifies a write transaction. + * @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 receipt certifying ledger contents at a particular transaction id on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getReceipt(String transactionId) { + // Generated convenience method for getReceiptWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getReceiptWithResponse(transactionId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TransactionReceipt.class)); + } + + /** + * Gets the status of an entry identified by a transaction id. + * + * @param transactionId Identifies a write transaction. + * @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 an entry identified by a transaction id on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTransactionStatus(String transactionId) { + // Generated convenience method for getTransactionStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTransactionStatusWithResponse(transactionId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TransactionStatus.class)); + } + + /** + * Gets the current value available in the ledger. + * + * A collection id may optionally be specified. + * + * @param collectionId The collection id. + * @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 current value available in the ledger. + * + * A collection id may optionally be specified on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getCurrentLedgerEntry(String collectionId) { + // Generated convenience method for getCurrentLedgerEntryWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (collectionId != null) { + requestOptions.addQueryParam("collectionId", collectionId, false); + } + return getCurrentLedgerEntryWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LedgerEntry.class)); + } + + /** + * Gets the current value available in the ledger. + * + * A collection id may optionally be specified. + * + * @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 current value available in the ledger. + * + * A collection id may optionally be specified on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getCurrentLedgerEntry() { + // Generated convenience method for getCurrentLedgerEntryWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getCurrentLedgerEntryWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LedgerEntry.class)); + } + + /** + * Gets details on a list of users. + * + * All users' object IDs and single role per user will be returned. + * + * @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 details on a list of users. + * + * All users' object IDs and single role per user will be returned as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listUsers() { + // Generated convenience method for listUsers + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listUsers(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(LedgerUser.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets details on a list of users. + * + * All users' object IDs and multiple roles will be returned. + * + * @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 details on a list of users. + * + * All users' object IDs and multiple roles will be returned as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listLedgerUsers() { + // Generated convenience method for listLedgerUsers + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listLedgerUsers(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(LedgerUserMultipleRoles.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Deletes a user from the Confidential Ledger. + * + * @param userId The user id, either an AAD object ID or certificate fingerprint. + * @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 {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteUser(String userId) { + // Generated convenience method for deleteUserWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteUserWithResponse(userId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Gets a user. + * + * @param userId The user id, either an AAD object ID or certificate fingerprint. + * @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 user on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getUser(String userId) { + // Generated convenience method for getUserWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getUserWithResponse(userId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LedgerUser.class)); + } + + /** + * Adds a user or updates a user's fields. + * + * A JSON merge patch is applied for existing users. + * + * @param userId The user id, either an AAD object ID or certificate fingerprint. + * @param userDetails Details about a Confidential Ledger user. + * @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 details about a Confidential Ledger user on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateUser(String userId, LedgerUser userDetails) { + // Generated convenience method for createOrUpdateUserWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getLedgerUserAccessor().prepareModelForJsonMergePatch(userDetails, true); + BinaryData userDetailsInBinaryData = BinaryData.fromObject(userDetails); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + userDetailsInBinaryData.getLength(); + JsonMergePatchHelper.getLedgerUserAccessor().prepareModelForJsonMergePatch(userDetails, false); + return createOrUpdateUserWithResponse(userId, userDetailsInBinaryData, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LedgerUser.class)); + } + + /** + * Deletes a user with multiple roles from the Confidential Ledger. + * + * @param userId The user id, either an AAD object ID or certificate fingerprint. + * @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 {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteLedgerUser(String userId) { + // Generated convenience method for deleteLedgerUserWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteLedgerUserWithResponse(userId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Gets a user with multiple roles. + * + * @param userId The user id, either an AAD object ID or certificate fingerprint. + * @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 user with multiple roles on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getLedgerUser(String userId) { + // Generated convenience method for getLedgerUserWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLedgerUserWithResponse(userId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LedgerUserMultipleRoles.class)); + } + + /** + * Adds a user or updates a user's fields. + * + * A JSON merge patch is applied for existing users. + * + * @param userId The user id, either an AAD object ID or certificate fingerprint. + * @param userMultipleRoles Details about a Confidential Ledger user with multiple roles. + * @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 details about a Confidential Ledger user on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateLedgerUser(String userId, + LedgerUserMultipleRoles userMultipleRoles) { + // Generated convenience method for createOrUpdateLedgerUserWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getLedgerUserMultipleRolesAccessor() + .prepareModelForJsonMergePatch(userMultipleRoles, true); + BinaryData userMultipleRolesInBinaryData = BinaryData.fromObject(userMultipleRoles); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + userMultipleRolesInBinaryData.getLength(); + JsonMergePatchHelper.getLedgerUserMultipleRolesAccessor() + .prepareModelForJsonMergePatch(userMultipleRoles, false); + return createOrUpdateLedgerUserWithResponse(userId, userMultipleRolesInBinaryData, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LedgerUserMultipleRoles.class)); + } + + /** + * Gets a user defined endpoint. + * + * Returns the user defined endpoint in the ACL instance. + * + * @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 user defined endpoint. + * + * Returns the user defined endpoint in the ACL instance on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getUserDefinedEndpoint() { + // Generated convenience method for getUserDefinedEndpointWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getUserDefinedEndpointWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Bundle.class)); + } + + /** + * Creates a user defined endpoint. + * + * Creates the user defined endpoint in the ACL instance. + * + * @param bundle Specify a user defined endpoint. + * @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 {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createUserDefinedEndpoint(Bundle bundle) { + // Generated convenience method for createUserDefinedEndpointWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createUserDefinedEndpointWithResponse(BinaryData.fromObject(bundle), requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * Runtime options for user defined endpoints. + * + * It returns the runtime options. + * + * @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 jS runtime options for user defined endpoints and functions on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getRuntimeOptions() { + // Generated convenience method for getRuntimeOptionsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getRuntimeOptionsWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(JsRuntimeOptions.class)); + } + + /** + * Runtime options for user defined endpoints. + * + * Updates the runtime options. + * + * @param jsRuntimeOptions JS Runtime options. + * @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 jS runtime options for user defined endpoints and functions on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateRuntimeOptionsStable(JsRuntimeOptions jsRuntimeOptions) { + // Generated convenience method for updateRuntimeOptionsStableWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getJsRuntimeOptionsAccessor().prepareModelForJsonMergePatch(jsRuntimeOptions, true); + BinaryData jsRuntimeOptionsInBinaryData = BinaryData.fromObject(jsRuntimeOptions); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + jsRuntimeOptionsInBinaryData.getLength(); + JsonMergePatchHelper.getJsRuntimeOptionsAccessor().prepareModelForJsonMergePatch(jsRuntimeOptions, false); + return updateRuntimeOptionsStableWithResponse(jsRuntimeOptionsInBinaryData, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(JsRuntimeOptions.class)); + } + + /** + * Module for user defined endpoints. + * + * It gets the module for the user defined endpoint. + * + * @param moduleName module name of the user defined endpoint. + * @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 module definition on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getUserDefinedEndpointsModule(String moduleName) { + // Generated convenience method for getUserDefinedEndpointsModuleWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getUserDefinedEndpointsModuleWithResponse(moduleName, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModuleDef.class)); + } + + /** + * Retrieves a list of user defined functions present in the Confidential Ledger + * + * User defined functions stored in the Confidential Ledger. + * + * @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 paginated user defined functions returned in response to a query as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listUserDefinedFunctions() { + // Generated convenience method for listUserDefinedFunctions + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listUserDefinedFunctions(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(UserDefinedFunction.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Deletes a user defined function from the Confidential Ledger. + * + * @param functionId Identifies a user defined function. + * @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 {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteUserDefinedFunction(String functionId) { + // Generated convenience method for deleteUserDefinedFunctionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteUserDefinedFunctionWithResponse(functionId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Gets a user defined function. + * + * Returns the user defined function in the Confidential Ledger. + * + * @param functionId Identifies a user defined function. + * @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 user defined function. + * + * Returns the user defined function in the Confidential Ledger on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getUserDefinedFunction(String functionId) { + // Generated convenience method for getUserDefinedFunctionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getUserDefinedFunctionWithResponse(functionId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(UserDefinedFunction.class)); + } + + /** + * Creates a user defined function. + * + * Creates the user defined function in the Confidential Ledger. + * + * @param functionId Identifies a user defined function. + * @param userDefinedFunction Specify a user defined function of a Confidential Ledger. + * @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 user defined function in the ledger on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createUserDefinedFunction(String functionId, + UserDefinedFunction userDefinedFunction) { + // Generated convenience method for createUserDefinedFunctionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createUserDefinedFunctionWithResponse(functionId, BinaryData.fromObject(userDefinedFunction), + requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(UserDefinedFunction.class)); + } + + /** + * Executes a user defined function. + * + * Executes the user defined function in the Confidential Ledger. + * + * @param functionId Identifies a user defined function. + * @param userDefinedFunctionExecutionProperties Specify user defined function execution properties. + * @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 result of a user defined function execution on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono executeUserDefinedFunction(String functionId, + UserDefinedFunctionExecutionProperties userDefinedFunctionExecutionProperties) { + // Generated convenience method for executeUserDefinedFunctionWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (userDefinedFunctionExecutionProperties != null) { + requestOptions.setBody(BinaryData.fromObject(userDefinedFunctionExecutionProperties)); + } + return executeUserDefinedFunctionWithResponse(functionId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(UserDefinedFunctionExecutionResponse.class)); + } + + /** + * Executes a user defined function. + * + * Executes the user defined function in the Confidential Ledger. + * + * @param functionId Identifies a user defined function. + * @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 result of a user defined function execution on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono executeUserDefinedFunction(String functionId) { + // Generated convenience method for executeUserDefinedFunctionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return executeUserDefinedFunctionWithResponse(functionId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(UserDefinedFunctionExecutionResponse.class)); + } + + /** + * Gets role actions for user defined roles + * + * user defined roles allow users to define and manage app specific AuthZ policy. + * + * @param roleName user defined role 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 role actions for user defined roles + * + * user defined roles allow users to define and manage app specific AuthZ policy on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getUserDefinedRole(String roleName) { + // Generated convenience method for getUserDefinedRoleWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getUserDefinedRoleWithResponse(roleName, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(UserDefinedRole.class)); + } + + /** + * Creates new roles and their actions + * + * User defined roles allow users to define and manage app specific AuthZ policy. + * + * @param body Request body. + * @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 roles on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createUserDefinedRoleStable(UserDefinedRoles body) { + // Generated convenience method for createUserDefinedRoleStableWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createUserDefinedRoleStableWithResponse(BinaryData.fromObject(body), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(UserDefinedRoles.class)); + } + + /** + * Patch replaces the allowed action on existing roles,if the desire is to remove + * an existing action, the role must be deleted and recreated. + * + * User defined roles allow users to define and manage app specific AuthZ policy. + * + * @param body Request body. + * @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 roles on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateUserDefinedRoleStable(UserDefinedRoles body) { + // Generated convenience method for updateUserDefinedRoleStableWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getUserDefinedRolesAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getUserDefinedRolesAccessor().prepareModelForJsonMergePatch(body, false); + return updateUserDefinedRoleStableWithResponse(bodyInBinaryData, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(UserDefinedRoles.class)); + } + + /** + * Deletes user defined roles + * + * A user defined role allows the users to create and manage their own role + * actions using the API. + * + * @param roleName user defined role 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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteUserDefinedRoleStable(String roleName) { + // Generated convenience method for deleteUserDefinedRoleStableWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteUserDefinedRoleStableWithResponse(roleName, requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/ConfidentialLedgerClient.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/ConfidentialLedgerClient.java index eabb327a1cf9..9c88d38e1709 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/ConfidentialLedgerClient.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/ConfidentialLedgerClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger; @@ -17,6 +17,26 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.security.confidentialledger.implementation.ConfidentialLedgerClientImpl; +import com.azure.security.confidentialledger.implementation.JsonMergePatchHelper; +import com.azure.security.confidentialledger.models.Bundle; +import com.azure.security.confidentialledger.models.Collection; +import com.azure.security.confidentialledger.models.ConfidentialLedgerEnclaves; +import com.azure.security.confidentialledger.models.ConsortiumMember; +import com.azure.security.confidentialledger.models.Constitution; +import com.azure.security.confidentialledger.models.JsRuntimeOptions; +import com.azure.security.confidentialledger.models.LedgerEntry; +import com.azure.security.confidentialledger.models.LedgerQueryResult; +import com.azure.security.confidentialledger.models.LedgerUser; +import com.azure.security.confidentialledger.models.LedgerUserMultipleRoles; +import com.azure.security.confidentialledger.models.LedgerWriteResult; +import com.azure.security.confidentialledger.models.ModuleDef; +import com.azure.security.confidentialledger.models.TransactionReceipt; +import com.azure.security.confidentialledger.models.TransactionStatus; +import com.azure.security.confidentialledger.models.UserDefinedFunction; +import com.azure.security.confidentialledger.models.UserDefinedFunctionExecutionProperties; +import com.azure.security.confidentialledger.models.UserDefinedFunctionExecutionResponse; +import com.azure.security.confidentialledger.models.UserDefinedRole; +import com.azure.security.confidentialledger.models.UserDefinedRoles; /** * Initializes a new instance of the synchronous ConfidentialLedgerClient type. @@ -39,7 +59,8 @@ public final class ConfidentialLedgerClient { /** * Gets the constitution used for governance. * - * The constitution is a script that assesses and applies proposals from consortium members. + * The constitution is a script that assesses and applies proposals from + * consortium members. *

Response Body Schema

* *
@@ -56,7 +77,10 @@ public final class ConfidentialLedgerClient {
      * @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 governance script for the application along with {@link Response}.
+     * @return the constitution used for governance.
+     * 
+     * The constitution is a script that assesses and applies proposals from
+     * consortium members along with {@link Response}.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -95,7 +119,8 @@ public PagedIterable listConsortiumMembers(RequestOptions requestOpt
     /**
      * Gets quotes for all nodes of the Confidential Ledger.
      * 
-     * A quote is an SGX enclave measurement that can be used to verify the validity of a node and its enclave.
+     * A quote is an SGX enclave measurement that can be used to verify the validity
+     * of a node and its enclave.
      * 

Response Body Schema

* *
@@ -119,7 +144,10 @@ public PagedIterable listConsortiumMembers(RequestOptions requestOpt
      * @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 information about the enclaves running the Confidential Ledger along with {@link Response}.
+     * @return quotes for all nodes of the Confidential Ledger.
+     * 
+     * A quote is an SGX enclave measurement that can be used to verify the validity
+     * of a node and its enclave along with {@link Response}.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
@@ -154,11 +182,45 @@ public PagedIterable listCollections(RequestOptions requestOptions)
         return this.serviceClient.listCollections(requestOptions);
     }
 
+    /**
+     * Gets a list of tags for a collection.
+     * 
+     * Retrieves the tags associated with a collection.
+     * 

Query Parameters

+ *
Query Parameters
+ * + * + * + *
Query Parameters
NameTypeRequiredDescription
collectionIdStringNoThe collection id.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * String
+     * }
+     * 
+ * + * @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 tags for a collection. + * + * Retrieves the tags associated with a collection as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTags(RequestOptions requestOptions) { + return this.serviceClient.listTags(requestOptions); + } + /** * Gets ledger entries from a collection corresponding to a range. * - * A collection id may optionally be specified. Only entries in the specified (or default) collection will be - * returned. + * A collection id may optionally be specified. Only entries in the specified (or + * default) collection will be returned. *

Query Parameters

* * @@ -209,8 +271,9 @@ public PagedIterable listCollections(RequestOptions requestOptions) * @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 paginated ledger entries returned in response to a query as paginated response with - * {@link PagedIterable}. + * @return ledger entries from a collection corresponding to a range. + * + * A collection id may optionally be specified as paginated response with {@link PagedIterable}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -280,8 +343,8 @@ public PagedIterable listLedgerEntries(RequestOptions requestOptions * @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 returned as a result of a write to the Confidential Ledger, the transaction id in the response indicates - * when the write will become durable along with {@link Response}. + * @return returned as a result of a write to the Confidential Ledger, the transaction id + * in the response indicates when the write will become durable along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -290,12 +353,14 @@ public Response createLedgerEntryWithResponse(BinaryData entry, Requ } /** - * Gets the ledger entry at the specified transaction id. A collection id may optionally be specified to indicate - * the collection from which to fetch the value. - * - * To return older ledger entries, the relevant sections of the ledger must be read from disk and validated. To - * prevent blocking within the enclave, the response will indicate whether the entry is ready and part of the - * response, or if the loading is still ongoing. + * Gets the ledger entry at the specified transaction id. A collection id may + * optionally be specified to indicate the collection from which to fetch the + * value. + * + * To return older ledger entries, the relevant sections of the ledger must be + * read from disk and validated. To prevent blocking within the enclave, the + * response will indicate whether the entry is ready and part of the response, or + * if the loading is still ongoing. *

Query Parameters

*
Query Parameters
* @@ -346,7 +411,7 @@ public Response createLedgerEntryWithResponse(BinaryData entry, Requ * @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 result of querying for a ledger entry from an older transaction id along with {@link Response}. + * @return the ledger entry at the specified transaction id along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -494,7 +559,9 @@ public Response getTransactionStatusWithResponse(String transactionI * @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 an entry in the ledger along with {@link Response}. + * @return the current value available in the ledger. + * + * A collection id may optionally be specified along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -511,7 +578,7 @@ public Response getCurrentLedgerEntryWithResponse(RequestOptions req *
      * {@code
      * {
-     *     assignedRole: String(Administrator/Contributor/Reader) (Required)
+     *     assignedRole: String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     userId: String (Optional)
      * }
      * }
@@ -522,7 +589,9 @@ public Response getCurrentLedgerEntryWithResponse(RequestOptions req
      * @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 paginated users returned in response to a query as paginated response with {@link PagedIterable}.
+     * @return details on a list of users.
+     * 
+     * All users' object IDs and single role per user will be returned as paginated response with {@link PagedIterable}.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.COLLECTION)
@@ -539,8 +608,8 @@ public PagedIterable listUsers(RequestOptions requestOptions) {
      * 
      * {@code
      * {
-     *     assignedRoles (Required): [
-     *         String(Administrator/Contributor/Reader) (Required)
+     *     assignedRoles (Optional, Required on create): [
+     *         String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     ]
      *     userId: String (Optional)
      * }
@@ -552,7 +621,9 @@ public PagedIterable listUsers(RequestOptions requestOptions) {
      * @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 paginated users returned in response to a query as paginated response with {@link PagedIterable}.
+     * @return details on a list of users.
+     * 
+     * All users' object IDs and multiple roles will be returned as paginated response with {@link PagedIterable}.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.COLLECTION)
@@ -584,7 +655,7 @@ public Response deleteUserWithResponse(String userId, RequestOptions reque
      * 
      * {@code
      * {
-     *     assignedRole: String(Administrator/Contributor/Reader) (Required)
+     *     assignedRole: String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     userId: String (Optional)
      * }
      * }
@@ -613,7 +684,7 @@ public Response getUserWithResponse(String userId, RequestOptions re
      * 
      * {@code
      * {
-     *     assignedRole: String(Administrator/Contributor/Reader) (Required)
+     *     assignedRole: String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     userId: String (Optional)
      * }
      * }
@@ -624,7 +695,7 @@ public Response getUserWithResponse(String userId, RequestOptions re
      * 
      * {@code
      * {
-     *     assignedRole: String(Administrator/Contributor/Reader) (Required)
+     *     assignedRole: String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     userId: String (Optional)
      * }
      * }
@@ -670,8 +741,8 @@ public Response deleteLedgerUserWithResponse(String userId, RequestOptions
      * 
      * {@code
      * {
-     *     assignedRoles (Required): [
-     *         String(Administrator/Contributor/Reader) (Required)
+     *     assignedRoles (Optional, Required on create): [
+     *         String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     ]
      *     userId: String (Optional)
      * }
@@ -701,8 +772,8 @@ public Response getLedgerUserWithResponse(String userId, RequestOpti
      * 
      * {@code
      * {
-     *     assignedRoles (Required): [
-     *         String(Administrator/Contributor/Reader) (Required)
+     *     assignedRoles (Optional, Required on create): [
+     *         String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     ]
      *     userId: String (Optional)
      * }
@@ -714,8 +785,8 @@ public Response getLedgerUserWithResponse(String userId, RequestOpti
      * 
      * {@code
      * {
-     *     assignedRoles (Required): [
-     *         String(Administrator/Contributor/Reader) (Required)
+     *     assignedRoles (Optional, Required on create): [
+     *         String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     ]
      *     userId: String (Optional)
      * }
@@ -752,7 +823,9 @@ public Response createOrUpdateLedgerUserWithResponse(String userId,
      *             String (Required): {
      *                 get (Optional): {
      *                     authn_policies (Required): [
-     *                         Object (Required)
+     *                          (Required){
+     *                             String: BinaryData (Required)
+     *                         }
      *                     ]
      *                     forwarding_required: String(sometimes/always/never) (Required)
      *                     interpreter_reuse (Optional): {
@@ -761,7 +834,9 @@ public Response createOrUpdateLedgerUserWithResponse(String userId,
      *                     js_function: String (Optional)
      *                     js_module: String (Optional)
      *                     mode: String(readwrite/readonly/historical) (Optional)
-     *                     openapi: Object (Optional)
+     *                     openapi (Optional): {
+     *                         String: BinaryData (Required)
+     *                     }
      *                     openapi_hidden: Boolean (Optional)
      *                     redirection_strategy: String(none/to_primary/to_backup) (Optional)
      *                 }
@@ -771,7 +846,12 @@ public Response createOrUpdateLedgerUserWithResponse(String userId,
      *             }
      *         }
      *     }
-     *     modules: Object (Required)
+     *     modules (Required): [
+     *          (Required){
+     *             module: String (Required)
+     *             name: String (Required)
+     *         }
+     *     ]
      * }
      * }
      * 
@@ -781,7 +861,9 @@ public Response createOrUpdateLedgerUserWithResponse(String userId, * @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 bundle for the user defined endpoints along with {@link Response}. + * @return a user defined endpoint. + * + * Returns the user defined endpoint in the ACL instance along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -803,7 +885,9 @@ public Response getUserDefinedEndpointWithResponse(RequestOptions re * String (Required): { * get (Optional): { * authn_policies (Required): [ - * Object (Required) + * (Required){ + * String: BinaryData (Required) + * } * ] * forwarding_required: String(sometimes/always/never) (Required) * interpreter_reuse (Optional): { @@ -812,7 +896,9 @@ public Response getUserDefinedEndpointWithResponse(RequestOptions re * js_function: String (Optional) * js_module: String (Optional) * mode: String(readwrite/readonly/historical) (Optional) - * openapi: Object (Optional) + * openapi (Optional): { + * String: BinaryData (Required) + * } * openapi_hidden: Boolean (Optional) * redirection_strategy: String(none/to_primary/to_backup) (Optional) * } @@ -822,12 +908,17 @@ public Response getUserDefinedEndpointWithResponse(RequestOptions re * } * } * } - * modules: Object (Required) + * modules (Required): [ + * (Required){ + * module: String (Required) + * name: String (Required) + * } + * ] * } * } *
* - * @param bundle bundle parameter description. + * @param bundle Specify a user defined endpoint. * @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. @@ -907,7 +998,7 @@ public Response getRuntimeOptionsWithResponse(RequestOptions request * } *
* - * @param jSRuntimeOptions JS runtime options. + * @param jsRuntimeOptions JS Runtime options. * @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. @@ -917,9 +1008,9 @@ public Response getRuntimeOptionsWithResponse(RequestOptions request */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateRuntimeOptionsWithResponse(BinaryData jSRuntimeOptions, + public Response updateRuntimeOptionsStableWithResponse(BinaryData jsRuntimeOptions, RequestOptions requestOptions) { - return this.serviceClient.updateRuntimeOptionsWithResponse(jSRuntimeOptions, requestOptions); + return this.serviceClient.updateRuntimeOptionsStableWithResponse(jsRuntimeOptions, requestOptions); } /** @@ -943,7 +1034,7 @@ public Response updateRuntimeOptionsWithResponse(BinaryData jSRuntim * @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 response body along with {@link Response}. + * @return module definition along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -1019,7 +1110,9 @@ public Response deleteUserDefinedFunctionWithResponse(String functionId, R * @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 user defined function in the ledger along with {@link Response}. + * @return a user defined function. + * + * Returns the user defined function in the Confidential Ledger along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -1142,14 +1235,16 @@ public Response executeUserDefinedFunctionWithResponse(String functi * *
      * {@code
-     * [
-     *      (Required){
-     *         roleName: String (Optional)
-     *         roleActions (Optional): [
-     *             String (Optional)
-     *         ]
-     *     }
-     * ]
+     * {
+     *     role (Required): [
+     *          (Required){
+     *             roleName: String (Optional)
+     *             roleActions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     * }
      * }
      * 
* @@ -1159,7 +1254,9 @@ public Response executeUserDefinedFunctionWithResponse(String functi * @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 definition for roles along with {@link Response}. + * @return role actions for user defined roles + * + * user defined roles allow users to define and manage app specific AuthZ policy along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -1175,69 +1272,110 @@ public Response getUserDefinedRoleWithResponse(String roleName, Requ * *
      * {@code
-     * [
-     *      (Required){
-     *         roleName: String (Optional)
-     *         roleActions (Optional): [
-     *             String (Optional)
-     *         ]
-     *     }
-     * ]
+     * {
+     *     roles (Optional, Required on create): [
+     *          (Optional, Required on create){
+     *             roleName: String (Optional)
+     *             roleActions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     roles (Optional, Required on create): [
+     *          (Optional, Required on create){
+     *             roleName: String (Optional)
+     *             roleActions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     * }
      * }
      * 
* - * @param roles user defined role. + * @param body Request body. * @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 Response}. + * @return roles along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response createUserDefinedRoleWithResponse(BinaryData roles, RequestOptions requestOptions) { - return this.serviceClient.createUserDefinedRoleWithResponse(roles, requestOptions); + public Response createUserDefinedRoleStableWithResponse(BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.createUserDefinedRoleStableWithResponse(body, requestOptions); } /** - * Patch replaces the allowed action on existing roles,if the desire is to remove an existing action, the role must - * be deleted and recreated. + * Patch replaces the allowed action on existing roles,if the desire is to remove + * an existing action, the role must be deleted and recreated. * * User defined roles allow users to define and manage app specific AuthZ policy. *

Request Body Schema

* *
      * {@code
-     * [
-     *      (Required){
-     *         roleName: String (Optional)
-     *         roleActions (Optional): [
-     *             String (Optional)
-     *         ]
-     *     }
-     * ]
+     * {
+     *     roles (Optional, Required on create): [
+     *          (Optional, Required on create){
+     *             roleName: String (Optional)
+     *             roleActions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     roles (Optional, Required on create): [
+     *          (Optional, Required on create){
+     *             roleName: String (Optional)
+     *             roleActions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     * }
      * }
      * 
* - * @param roles user defined role. + * @param body Request body. * @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 Response}. + * @return roles along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateUserDefinedRoleWithResponse(BinaryData roles, RequestOptions requestOptions) { - return this.serviceClient.updateUserDefinedRoleWithResponse(roles, requestOptions); + public Response updateUserDefinedRoleStableWithResponse(BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.updateUserDefinedRoleStableWithResponse(body, requestOptions); } /** * Deletes user defined roles * - * A user defined role allows the users to create and manage their own role actions using the API. + * A user defined role allows the users to create and manage their own role + * actions using the API. * * @param roleName user defined role name. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1249,7 +1387,953 @@ public Response updateUserDefinedRoleWithResponse(BinaryData roles, Reques */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteUserDefinedRoleWithResponse(String roleName, RequestOptions requestOptions) { - return this.serviceClient.deleteUserDefinedRoleWithResponse(roleName, requestOptions); + public Response deleteUserDefinedRoleStableWithResponse(String roleName, RequestOptions requestOptions) { + return this.serviceClient.deleteUserDefinedRoleStableWithResponse(roleName, requestOptions); + } + + /** + * Gets the constitution used for governance. + * + * The constitution is a script that assesses and applies proposals from + * consortium members. + * + * @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 constitution used for governance. + * + * The constitution is a script that assesses and applies proposals from + * consortium members. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Constitution getConstitution() { + // Generated convenience method for getConstitutionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getConstitutionWithResponse(requestOptions).getValue().toObject(Constitution.class); + } + + /** + * Lists the consortium members. + * + * Consortium members can manage the Confidential Ledger. + * + * @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 list of members in the consortium as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listConsortiumMembers() { + // Generated convenience method for listConsortiumMembers + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listConsortiumMembers(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(ConsortiumMember.class)); + } + + /** + * Gets quotes for all nodes of the Confidential Ledger. + * + * A quote is an SGX enclave measurement that can be used to verify the validity + * of a node and its enclave. + * + * @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 quotes for all nodes of the Confidential Ledger. + * + * A quote is an SGX enclave measurement that can be used to verify the validity + * of a node and its enclave. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfidentialLedgerEnclaves getEnclaveQuotes() { + // Generated convenience method for getEnclaveQuotesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getEnclaveQuotesWithResponse(requestOptions).getValue().toObject(ConfidentialLedgerEnclaves.class); + } + + /** + * Retrieves a list of collection ids present in the Confidential Ledger + * + * Collection ids are user-created collections of ledger entries. + * + * @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 paginated collections returned in response to a query as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCollections() { + // Generated convenience method for listCollections + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listCollections(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(Collection.class)); + } + + /** + * Gets a list of tags for a collection. + * + * Retrieves the tags associated with a collection. + * + * @param collectionId The collection id. + * @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 tags for a collection. + * + * Retrieves the tags associated with a collection as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTags(String collectionId) { + // Generated convenience method for listTags + RequestOptions requestOptions = new RequestOptions(); + if (collectionId != null) { + requestOptions.addQueryParam("collectionId", collectionId, false); + } + return serviceClient.listTags(requestOptions).mapPage(bodyItemValue -> bodyItemValue.toObject(String.class)); + } + + /** + * Gets a list of tags for a collection. + * + * Retrieves the tags associated with a collection. + * + * @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 tags for a collection. + * + * Retrieves the tags associated with a collection as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTags() { + // Generated convenience method for listTags + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listTags(requestOptions).mapPage(bodyItemValue -> bodyItemValue.toObject(String.class)); + } + + /** + * Gets ledger entries from a collection corresponding to a range. + * + * A collection id may optionally be specified. Only entries in the specified (or + * default) collection will be returned. + * + * @param collectionId The collection id. + * @param fromTransactionId Specify the first transaction ID in a range. + * @param toTransactionId Specify the last transaction ID in a range. + * @param tag Single tag. + * @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 ledger entries from a collection corresponding to a range. + * + * A collection id may optionally be specified as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLedgerEntries(String collectionId, String fromTransactionId, + String toTransactionId, String tag) { + // Generated convenience method for listLedgerEntries + RequestOptions requestOptions = new RequestOptions(); + if (collectionId != null) { + requestOptions.addQueryParam("collectionId", collectionId, false); + } + if (fromTransactionId != null) { + requestOptions.addQueryParam("fromTransactionId", fromTransactionId, false); + } + if (toTransactionId != null) { + requestOptions.addQueryParam("toTransactionId", toTransactionId, false); + } + if (tag != null) { + requestOptions.addQueryParam("tag", tag, false); + } + return serviceClient.listLedgerEntries(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(LedgerEntry.class)); + } + + /** + * Gets ledger entries from a collection corresponding to a range. + * + * A collection id may optionally be specified. Only entries in the specified (or + * default) collection will be returned. + * + * @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 ledger entries from a collection corresponding to a range. + * + * A collection id may optionally be specified as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLedgerEntries() { + // Generated convenience method for listLedgerEntries + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listLedgerEntries(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(LedgerEntry.class)); + } + + /** + * Writes a ledger entry. + * + * A collection id may optionally be specified. + * + * @param entry Ledger entry. + * @param collectionId The collection id. + * @param tags Comma separated tags. + * @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 returned as a result of a write to the Confidential Ledger, the transaction id + * in the response indicates when the write will become durable. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LedgerWriteResult createLedgerEntry(LedgerEntry entry, String collectionId, String tags) { + // Generated convenience method for createLedgerEntryWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (collectionId != null) { + requestOptions.addQueryParam("collectionId", collectionId, false); + } + if (tags != null) { + requestOptions.addQueryParam("tags", tags, false); + } + return createLedgerEntryWithResponse(BinaryData.fromObject(entry), requestOptions).getValue() + .toObject(LedgerWriteResult.class); + } + + /** + * Writes a ledger entry. + * + * A collection id may optionally be specified. + * + * @param entry Ledger entry. + * @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 returned as a result of a write to the Confidential Ledger, the transaction id + * in the response indicates when the write will become durable. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LedgerWriteResult createLedgerEntry(LedgerEntry entry) { + // Generated convenience method for createLedgerEntryWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createLedgerEntryWithResponse(BinaryData.fromObject(entry), requestOptions).getValue() + .toObject(LedgerWriteResult.class); + } + + /** + * Gets the ledger entry at the specified transaction id. A collection id may + * optionally be specified to indicate the collection from which to fetch the + * value. + * + * To return older ledger entries, the relevant sections of the ledger must be + * read from disk and validated. To prevent blocking within the enclave, the + * response will indicate whether the entry is ready and part of the response, or + * if the loading is still ongoing. + * + * @param transactionId Identifies a write transaction. + * @param collectionId The collection id. + * @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 ledger entry at the specified transaction id. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LedgerQueryResult getLedgerEntry(String transactionId, String collectionId) { + // Generated convenience method for getLedgerEntryWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (collectionId != null) { + requestOptions.addQueryParam("collectionId", collectionId, false); + } + return getLedgerEntryWithResponse(transactionId, requestOptions).getValue().toObject(LedgerQueryResult.class); + } + + /** + * Gets the ledger entry at the specified transaction id. A collection id may + * optionally be specified to indicate the collection from which to fetch the + * value. + * + * To return older ledger entries, the relevant sections of the ledger must be + * read from disk and validated. To prevent blocking within the enclave, the + * response will indicate whether the entry is ready and part of the response, or + * if the loading is still ongoing. + * + * @param transactionId Identifies a write transaction. + * @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 ledger entry at the specified transaction id. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LedgerQueryResult getLedgerEntry(String transactionId) { + // Generated convenience method for getLedgerEntryWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLedgerEntryWithResponse(transactionId, requestOptions).getValue().toObject(LedgerQueryResult.class); + } + + /** + * Gets a receipt certifying ledger contents at a particular transaction id. + * + * @param transactionId Identifies a write transaction. + * @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 receipt certifying ledger contents at a particular transaction id. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TransactionReceipt getReceipt(String transactionId) { + // Generated convenience method for getReceiptWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getReceiptWithResponse(transactionId, requestOptions).getValue().toObject(TransactionReceipt.class); + } + + /** + * Gets the status of an entry identified by a transaction id. + * + * @param transactionId Identifies a write transaction. + * @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 an entry identified by a transaction id. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TransactionStatus getTransactionStatus(String transactionId) { + // Generated convenience method for getTransactionStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTransactionStatusWithResponse(transactionId, requestOptions).getValue() + .toObject(TransactionStatus.class); + } + + /** + * Gets the current value available in the ledger. + * + * A collection id may optionally be specified. + * + * @param collectionId The collection id. + * @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 current value available in the ledger. + * + * A collection id may optionally be specified. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LedgerEntry getCurrentLedgerEntry(String collectionId) { + // Generated convenience method for getCurrentLedgerEntryWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (collectionId != null) { + requestOptions.addQueryParam("collectionId", collectionId, false); + } + return getCurrentLedgerEntryWithResponse(requestOptions).getValue().toObject(LedgerEntry.class); + } + + /** + * Gets the current value available in the ledger. + * + * A collection id may optionally be specified. + * + * @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 current value available in the ledger. + * + * A collection id may optionally be specified. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LedgerEntry getCurrentLedgerEntry() { + // Generated convenience method for getCurrentLedgerEntryWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getCurrentLedgerEntryWithResponse(requestOptions).getValue().toObject(LedgerEntry.class); + } + + /** + * Gets details on a list of users. + * + * All users' object IDs and single role per user will be returned. + * + * @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 details on a list of users. + * + * All users' object IDs and single role per user will be returned as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listUsers() { + // Generated convenience method for listUsers + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listUsers(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(LedgerUser.class)); + } + + /** + * Gets details on a list of users. + * + * All users' object IDs and multiple roles will be returned. + * + * @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 details on a list of users. + * + * All users' object IDs and multiple roles will be returned as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLedgerUsers() { + // Generated convenience method for listLedgerUsers + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listLedgerUsers(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(LedgerUserMultipleRoles.class)); + } + + /** + * Deletes a user from the Confidential Ledger. + * + * @param userId The user id, either an AAD object ID or certificate fingerprint. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteUser(String userId) { + // Generated convenience method for deleteUserWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteUserWithResponse(userId, requestOptions).getValue(); + } + + /** + * Gets a user. + * + * @param userId The user id, either an AAD object ID or certificate fingerprint. + * @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 user. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LedgerUser getUser(String userId) { + // Generated convenience method for getUserWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getUserWithResponse(userId, requestOptions).getValue().toObject(LedgerUser.class); + } + + /** + * Adds a user or updates a user's fields. + * + * A JSON merge patch is applied for existing users. + * + * @param userId The user id, either an AAD object ID or certificate fingerprint. + * @param userDetails Details about a Confidential Ledger user. + * @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 details about a Confidential Ledger user. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LedgerUser createOrUpdateUser(String userId, LedgerUser userDetails) { + // Generated convenience method for createOrUpdateUserWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getLedgerUserAccessor().prepareModelForJsonMergePatch(userDetails, true); + BinaryData userDetailsInBinaryData = BinaryData.fromObject(userDetails); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + userDetailsInBinaryData.getLength(); + JsonMergePatchHelper.getLedgerUserAccessor().prepareModelForJsonMergePatch(userDetails, false); + return createOrUpdateUserWithResponse(userId, userDetailsInBinaryData, requestOptions).getValue() + .toObject(LedgerUser.class); + } + + /** + * Deletes a user with multiple roles from the Confidential Ledger. + * + * @param userId The user id, either an AAD object ID or certificate fingerprint. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteLedgerUser(String userId) { + // Generated convenience method for deleteLedgerUserWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteLedgerUserWithResponse(userId, requestOptions).getValue(); + } + + /** + * Gets a user with multiple roles. + * + * @param userId The user id, either an AAD object ID or certificate fingerprint. + * @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 user with multiple roles. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LedgerUserMultipleRoles getLedgerUser(String userId) { + // Generated convenience method for getLedgerUserWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLedgerUserWithResponse(userId, requestOptions).getValue().toObject(LedgerUserMultipleRoles.class); + } + + /** + * Adds a user or updates a user's fields. + * + * A JSON merge patch is applied for existing users. + * + * @param userId The user id, either an AAD object ID or certificate fingerprint. + * @param userMultipleRoles Details about a Confidential Ledger user with multiple roles. + * @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 details about a Confidential Ledger user. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LedgerUserMultipleRoles createOrUpdateLedgerUser(String userId, LedgerUserMultipleRoles userMultipleRoles) { + // Generated convenience method for createOrUpdateLedgerUserWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getLedgerUserMultipleRolesAccessor() + .prepareModelForJsonMergePatch(userMultipleRoles, true); + BinaryData userMultipleRolesInBinaryData = BinaryData.fromObject(userMultipleRoles); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + userMultipleRolesInBinaryData.getLength(); + JsonMergePatchHelper.getLedgerUserMultipleRolesAccessor() + .prepareModelForJsonMergePatch(userMultipleRoles, false); + return createOrUpdateLedgerUserWithResponse(userId, userMultipleRolesInBinaryData, requestOptions).getValue() + .toObject(LedgerUserMultipleRoles.class); + } + + /** + * Gets a user defined endpoint. + * + * Returns the user defined endpoint in the ACL instance. + * + * @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 user defined endpoint. + * + * Returns the user defined endpoint in the ACL instance. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Bundle getUserDefinedEndpoint() { + // Generated convenience method for getUserDefinedEndpointWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getUserDefinedEndpointWithResponse(requestOptions).getValue().toObject(Bundle.class); + } + + /** + * Creates a user defined endpoint. + * + * Creates the user defined endpoint in the ACL instance. + * + * @param bundle Specify a user defined endpoint. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void createUserDefinedEndpoint(Bundle bundle) { + // Generated convenience method for createUserDefinedEndpointWithResponse + RequestOptions requestOptions = new RequestOptions(); + createUserDefinedEndpointWithResponse(BinaryData.fromObject(bundle), requestOptions).getValue(); + } + + /** + * Runtime options for user defined endpoints. + * + * It returns the runtime options. + * + * @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 jS runtime options for user defined endpoints and functions. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public JsRuntimeOptions getRuntimeOptions() { + // Generated convenience method for getRuntimeOptionsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getRuntimeOptionsWithResponse(requestOptions).getValue().toObject(JsRuntimeOptions.class); + } + + /** + * Runtime options for user defined endpoints. + * + * Updates the runtime options. + * + * @param jsRuntimeOptions JS Runtime options. + * @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 jS runtime options for user defined endpoints and functions. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public JsRuntimeOptions updateRuntimeOptionsStable(JsRuntimeOptions jsRuntimeOptions) { + // Generated convenience method for updateRuntimeOptionsStableWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getJsRuntimeOptionsAccessor().prepareModelForJsonMergePatch(jsRuntimeOptions, true); + BinaryData jsRuntimeOptionsInBinaryData = BinaryData.fromObject(jsRuntimeOptions); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + jsRuntimeOptionsInBinaryData.getLength(); + JsonMergePatchHelper.getJsRuntimeOptionsAccessor().prepareModelForJsonMergePatch(jsRuntimeOptions, false); + return updateRuntimeOptionsStableWithResponse(jsRuntimeOptionsInBinaryData, requestOptions).getValue() + .toObject(JsRuntimeOptions.class); + } + + /** + * Module for user defined endpoints. + * + * It gets the module for the user defined endpoint. + * + * @param moduleName module name of the user defined endpoint. + * @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 module definition. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModuleDef getUserDefinedEndpointsModule(String moduleName) { + // Generated convenience method for getUserDefinedEndpointsModuleWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getUserDefinedEndpointsModuleWithResponse(moduleName, requestOptions).getValue() + .toObject(ModuleDef.class); + } + + /** + * Retrieves a list of user defined functions present in the Confidential Ledger + * + * User defined functions stored in the Confidential Ledger. + * + * @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 paginated user defined functions returned in response to a query as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listUserDefinedFunctions() { + // Generated convenience method for listUserDefinedFunctions + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listUserDefinedFunctions(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(UserDefinedFunction.class)); + } + + /** + * Deletes a user defined function from the Confidential Ledger. + * + * @param functionId Identifies a user defined function. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteUserDefinedFunction(String functionId) { + // Generated convenience method for deleteUserDefinedFunctionWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteUserDefinedFunctionWithResponse(functionId, requestOptions).getValue(); + } + + /** + * Gets a user defined function. + * + * Returns the user defined function in the Confidential Ledger. + * + * @param functionId Identifies a user defined function. + * @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 user defined function. + * + * Returns the user defined function in the Confidential Ledger. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public UserDefinedFunction getUserDefinedFunction(String functionId) { + // Generated convenience method for getUserDefinedFunctionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getUserDefinedFunctionWithResponse(functionId, requestOptions).getValue() + .toObject(UserDefinedFunction.class); + } + + /** + * Creates a user defined function. + * + * Creates the user defined function in the Confidential Ledger. + * + * @param functionId Identifies a user defined function. + * @param userDefinedFunction Specify a user defined function of a Confidential Ledger. + * @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 user defined function in the ledger. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public UserDefinedFunction createUserDefinedFunction(String functionId, UserDefinedFunction userDefinedFunction) { + // Generated convenience method for createUserDefinedFunctionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createUserDefinedFunctionWithResponse(functionId, BinaryData.fromObject(userDefinedFunction), + requestOptions).getValue().toObject(UserDefinedFunction.class); + } + + /** + * Executes a user defined function. + * + * Executes the user defined function in the Confidential Ledger. + * + * @param functionId Identifies a user defined function. + * @param userDefinedFunctionExecutionProperties Specify user defined function execution properties. + * @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 result of a user defined function execution. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public UserDefinedFunctionExecutionResponse executeUserDefinedFunction(String functionId, + UserDefinedFunctionExecutionProperties userDefinedFunctionExecutionProperties) { + // Generated convenience method for executeUserDefinedFunctionWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (userDefinedFunctionExecutionProperties != null) { + requestOptions.setBody(BinaryData.fromObject(userDefinedFunctionExecutionProperties)); + } + return executeUserDefinedFunctionWithResponse(functionId, requestOptions).getValue() + .toObject(UserDefinedFunctionExecutionResponse.class); + } + + /** + * Executes a user defined function. + * + * Executes the user defined function in the Confidential Ledger. + * + * @param functionId Identifies a user defined function. + * @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 result of a user defined function execution. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public UserDefinedFunctionExecutionResponse executeUserDefinedFunction(String functionId) { + // Generated convenience method for executeUserDefinedFunctionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return executeUserDefinedFunctionWithResponse(functionId, requestOptions).getValue() + .toObject(UserDefinedFunctionExecutionResponse.class); + } + + /** + * Gets role actions for user defined roles + * + * user defined roles allow users to define and manage app specific AuthZ policy. + * + * @param roleName user defined role 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 role actions for user defined roles + * + * user defined roles allow users to define and manage app specific AuthZ policy. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public UserDefinedRole getUserDefinedRole(String roleName) { + // Generated convenience method for getUserDefinedRoleWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getUserDefinedRoleWithResponse(roleName, requestOptions).getValue().toObject(UserDefinedRole.class); + } + + /** + * Creates new roles and their actions + * + * User defined roles allow users to define and manage app specific AuthZ policy. + * + * @param body Request body. + * @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 roles. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public UserDefinedRoles createUserDefinedRoleStable(UserDefinedRoles body) { + // Generated convenience method for createUserDefinedRoleStableWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createUserDefinedRoleStableWithResponse(BinaryData.fromObject(body), requestOptions).getValue() + .toObject(UserDefinedRoles.class); + } + + /** + * Patch replaces the allowed action on existing roles,if the desire is to remove + * an existing action, the role must be deleted and recreated. + * + * User defined roles allow users to define and manage app specific AuthZ policy. + * + * @param body Request body. + * @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 roles. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public UserDefinedRoles updateUserDefinedRoleStable(UserDefinedRoles body) { + // Generated convenience method for updateUserDefinedRoleStableWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getUserDefinedRolesAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getUserDefinedRolesAccessor().prepareModelForJsonMergePatch(body, false); + return updateUserDefinedRoleStableWithResponse(bodyInBinaryData, requestOptions).getValue() + .toObject(UserDefinedRoles.class); + } + + /** + * Deletes user defined roles + * + * A user defined role allows the users to create and manage their own role + * actions using the API. + * + * @param roleName user defined role 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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteUserDefinedRoleStable(String roleName) { + // Generated convenience method for deleteUserDefinedRoleStableWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteUserDefinedRoleStableWithResponse(roleName, requestOptions).getValue(); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/ConfidentialLedgerClientBuilder.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/ConfidentialLedgerClientBuilder.java index b17d39a26ec3..f6024a7422d0 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/ConfidentialLedgerClientBuilder.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/ConfidentialLedgerClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger; @@ -8,8 +8,6 @@ import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; 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; @@ -18,7 +16,6 @@ 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; @@ -43,17 +40,14 @@ * A builder for creating a new instance of the ConfidentialLedgerClient type. */ @ServiceClientBuilder(serviceClients = { ConfidentialLedgerClient.class, ConfidentialLedgerAsyncClient.class }) -public final class ConfidentialLedgerClientBuilder implements HttpTrait, - ConfigurationTrait, TokenCredentialTrait { +public final class ConfidentialLedgerClientBuilder + implements HttpTrait, ConfigurationTrait { @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://confidential-ledger.azure.com/.default" }; - @Generated private static final Map PROPERTIES = CoreUtils.getProperties("azure-security-confidentialledger.properties"); @@ -70,37 +64,37 @@ public ConfidentialLedgerClientBuilder() { } /* - * The HTTP pipeline to send requests through. + * The HTTP client used to send the request. */ @Generated - private HttpPipeline pipeline; + private HttpClient httpClient; /** * {@inheritDoc}. */ @Generated @Override - public ConfidentialLedgerClientBuilder 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; + public ConfidentialLedgerClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; return this; } /* - * The HTTP client used to send the request. + * The HTTP pipeline to send requests through. */ @Generated - private HttpClient httpClient; + private HttpPipeline pipeline; /** * {@inheritDoc}. */ @Generated @Override - public ConfidentialLedgerClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; + public ConfidentialLedgerClientBuilder 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; } @@ -180,23 +174,7 @@ public ConfidentialLedgerClientBuilder configuration(Configuration configuration } /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public ConfidentialLedgerClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The Confidential Ledger URL, for example https://contoso.confidentialledger.azure.com + * The Confidential Ledger URL, for example https://contoso.confidentialledger.azure.com. */ @Generated private String ledgerEndpoint; @@ -295,10 +273,6 @@ private HttpPipeline createHttpPipeline() { 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)); - } - policies.add(new ConfidentialLedgerRedirectPolicy()); this.pipelinePolicies.stream() .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) .forEach(p -> policies.add(p)); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/ConfidentialLedgerServiceVersion.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/ConfidentialLedgerServiceVersion.java index b860e60755b0..e341e82f4ecc 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/ConfidentialLedgerServiceVersion.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/ConfidentialLedgerServiceVersion.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger; @@ -11,13 +11,9 @@ */ public enum ConfidentialLedgerServiceVersion implements ServiceVersion { /** - * Enum value 2022-05-13. + * Enum value 2026-02-23. */ - V2022_05_13("2022-05-13"), - /** - * Enum value 2024-12-09-preview. - */ - V2024_12_09_PREVIEW("2024-12-09-preview"); + V2026_02_23("2026-02-23"); private final String version; @@ -39,6 +35,6 @@ public String getVersion() { * @return The latest {@link ConfidentialLedgerServiceVersion}. */ public static ConfidentialLedgerServiceVersion getLatest() { - return V2024_12_09_PREVIEW; + return V2026_02_23; } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/implementation/ConfidentialLedgerClientImpl.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/implementation/ConfidentialLedgerClientImpl.java index 5f0685887f26..2c4140f5816f 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/implementation/ConfidentialLedgerClientImpl.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/implementation/ConfidentialLedgerClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.implementation; @@ -158,7 +158,7 @@ public ConfidentialLedgerClientImpl(HttpPipeline httpPipeline, SerializerAdapter * REST calls. */ @Host("{ledgerEndpoint}") - @ServiceInterface(name = "ConfidentialLedgerCl") + @ServiceInterface(name = "ConfidentialLedgerClient") public interface ConfidentialLedgerClientService { @Get("/app/governance/constitution") @ExpectedResponses({ 200 }) @@ -240,6 +240,26 @@ Response listCollectionsSync(@HostParam("ledgerEndpoint") String led @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @Get("/app/collections/tags") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listTags(@HostParam("ledgerEndpoint") String ledgerEndpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/app/collections/tags") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listTagsSync(@HostParam("ledgerEndpoint") String ledgerEndpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + @Get("/app/transactions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -267,8 +287,9 @@ Response listLedgerEntriesSync(@HostParam("ledgerEndpoint") String l @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createLedgerEntry(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") BinaryData entry, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData entry, + RequestOptions requestOptions, Context context); @Post("/app/transactions") @ExpectedResponses({ 200 }) @@ -277,8 +298,9 @@ Mono> createLedgerEntry(@HostParam("ledgerEndpoint") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createLedgerEntrySync(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") BinaryData entry, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData entry, + RequestOptions requestOptions, Context context); @Get("/app/transactions/{transactionId}") @ExpectedResponses({ 200 }) @@ -407,8 +429,8 @@ Response listLedgerUsersSync(@HostParam("ledgerEndpoint") String led @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteUser(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "userId", encoded = true) String userId, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("userId") String userId, + RequestOptions requestOptions, Context context); @Delete("/app/users/{userId}") @ExpectedResponses({ 204 }) @@ -417,8 +439,8 @@ Mono> deleteUser(@HostParam("ledgerEndpoint") String ledgerEndpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteUserSync(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "userId", encoded = true) String userId, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("userId") String userId, + RequestOptions requestOptions, Context context); @Get("/app/users/{userId}") @ExpectedResponses({ 200 }) @@ -427,7 +449,7 @@ Response deleteUserSync(@HostParam("ledgerEndpoint") String ledgerEndpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getUser(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "userId", encoded = true) String userId, + @QueryParam("api-version") String apiVersion, @PathParam("userId") String userId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/app/users/{userId}") @@ -437,7 +459,7 @@ Mono> getUser(@HostParam("ledgerEndpoint") String ledgerEnd @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getUserSync(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "userId", encoded = true) String userId, + @QueryParam("api-version") String apiVersion, @PathParam("userId") String userId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/app/users/{userId}") @@ -447,9 +469,10 @@ Response getUserSync(@HostParam("ledgerEndpoint") String ledgerEndpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrUpdateUser(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "userId", encoded = true) String userId, - @BodyParam("application/merge-patch+json") BinaryData userDetails, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @PathParam("userId") String userId, @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData userDetails, RequestOptions requestOptions, + Context context); @Patch("/app/users/{userId}") @ExpectedResponses({ 200 }) @@ -458,9 +481,10 @@ Mono> createOrUpdateUser(@HostParam("ledgerEndpoint") Strin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrUpdateUserSync(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "userId", encoded = true) String userId, - @BodyParam("application/merge-patch+json") BinaryData userDetails, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @PathParam("userId") String userId, @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData userDetails, RequestOptions requestOptions, + Context context); @Delete("/app/ledgerUsers/{userId}") @ExpectedResponses({ 204 }) @@ -469,8 +493,8 @@ Response createOrUpdateUserSync(@HostParam("ledgerEndpoint") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteLedgerUser(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "userId", encoded = true) String userId, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("userId") String userId, + RequestOptions requestOptions, Context context); @Delete("/app/ledgerUsers/{userId}") @ExpectedResponses({ 204 }) @@ -479,8 +503,8 @@ Mono> deleteLedgerUser(@HostParam("ledgerEndpoint") String ledger @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteLedgerUserSync(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "userId", encoded = true) String userId, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("userId") String userId, + RequestOptions requestOptions, Context context); @Get("/app/ledgerUsers/{userId}") @ExpectedResponses({ 200 }) @@ -489,7 +513,7 @@ Response deleteLedgerUserSync(@HostParam("ledgerEndpoint") String ledgerEn @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getLedgerUser(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "userId", encoded = true) String userId, + @QueryParam("api-version") String apiVersion, @PathParam("userId") String userId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/app/ledgerUsers/{userId}") @@ -499,7 +523,7 @@ Mono> getLedgerUser(@HostParam("ledgerEndpoint") String led @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getLedgerUserSync(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "userId", encoded = true) String userId, + @QueryParam("api-version") String apiVersion, @PathParam("userId") String userId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Patch("/app/ledgerUsers/{userId}") @@ -509,9 +533,10 @@ Response getLedgerUserSync(@HostParam("ledgerEndpoint") String ledge @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrUpdateLedgerUser(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "userId", encoded = true) String userId, - @BodyParam("application/merge-patch+json") BinaryData userMultipleRoles, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @PathParam("userId") String userId, @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData userMultipleRoles, RequestOptions requestOptions, + Context context); @Patch("/app/ledgerUsers/{userId}") @ExpectedResponses({ 200 }) @@ -520,9 +545,10 @@ Mono> createOrUpdateLedgerUser(@HostParam("ledgerEndpoint") @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrUpdateLedgerUserSync(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "userId", encoded = true) String userId, - @BodyParam("application/merge-patch+json") BinaryData userMultipleRoles, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @PathParam("userId") String userId, @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData userMultipleRoles, RequestOptions requestOptions, + Context context); @Get("/app/userDefinedEndpoints") @ExpectedResponses({ 200 }) @@ -551,8 +577,8 @@ Response getUserDefinedEndpointSync(@HostParam("ledgerEndpoint") Str @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createUserDefinedEndpoint(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") BinaryData bundle, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData bundle, RequestOptions requestOptions, Context context); @Put("/app/userDefinedEndpoints") @ExpectedResponses({ 201 }) @@ -561,8 +587,8 @@ Mono> createUserDefinedEndpoint(@HostParam("ledgerEndpoint") Stri @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createUserDefinedEndpointSync(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") BinaryData bundle, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") BinaryData bundle, RequestOptions requestOptions, Context context); @Get("/app/userDefinedEndpoints/runtimeOptions") @ExpectedResponses({ 200 }) @@ -590,9 +616,11 @@ Response getRuntimeOptionsSync(@HostParam("ledgerEndpoint") String l @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> updateRuntimeOptions(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") BinaryData jSRuntimeOptions, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Mono> updateRuntimeOptionsStable(@HostParam("ledgerEndpoint") String ledgerEndpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData jsRuntimeOptions, RequestOptions requestOptions, + Context context); @Patch("/app/userDefinedEndpoints/runtimeOptions") @ExpectedResponses({ 200 }) @@ -600,9 +628,11 @@ Mono> updateRuntimeOptions(@HostParam("ledgerEndpoint") Str @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response updateRuntimeOptionsSync(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") BinaryData jSRuntimeOptions, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Response updateRuntimeOptionsStableSync(@HostParam("ledgerEndpoint") String ledgerEndpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData jsRuntimeOptions, RequestOptions requestOptions, + Context context); @Get("/app/userDefinedEndpoints/modules") @ExpectedResponses({ 200 }) @@ -611,9 +641,8 @@ Response updateRuntimeOptionsSync(@HostParam("ledgerEndpoint") Strin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getUserDefinedEndpointsModule(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, - @QueryParam(value = "module_name", encoded = true) String moduleName, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @QueryParam("module_name") String moduleName, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/app/userDefinedEndpoints/modules") @ExpectedResponses({ 200 }) @@ -622,9 +651,8 @@ Mono> getUserDefinedEndpointsModule(@HostParam("ledgerEndpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getUserDefinedEndpointsModuleSync(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, - @QueryParam(value = "module_name", encoded = true) String moduleName, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @QueryParam("module_name") String moduleName, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/app/userDefinedFunctions") @ExpectedResponses({ 200 }) @@ -654,7 +682,7 @@ Response listUserDefinedFunctionsSync(@HostParam("ledgerEndpoint") S @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteUserDefinedFunction(@HostParam("ledgerEndpoint") String ledgerEndpoint, @QueryParam("api-version") String apiVersion, @PathParam("functionId") String functionId, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Delete("/app/userDefinedFunctions/{functionId}") @ExpectedResponses({ 204 }) @@ -664,7 +692,7 @@ Mono> deleteUserDefinedFunction(@HostParam("ledgerEndpoint") Stri @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteUserDefinedFunctionSync(@HostParam("ledgerEndpoint") String ledgerEndpoint, @QueryParam("api-version") String apiVersion, @PathParam("functionId") String functionId, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Get("/app/userDefinedFunctions/{functionId}") @ExpectedResponses({ 200 }) @@ -694,8 +722,9 @@ Response getUserDefinedFunctionSync(@HostParam("ledgerEndpoint") Str @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createUserDefinedFunction(@HostParam("ledgerEndpoint") String ledgerEndpoint, @QueryParam("api-version") String apiVersion, @PathParam("functionId") String functionId, - @BodyParam("application/json") BinaryData userDefinedFunction, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData userDefinedFunction, RequestOptions requestOptions, + Context context); @Put("/app/userDefinedFunctions/{functionId}") @ExpectedResponses({ 200, 201 }) @@ -705,8 +734,9 @@ Mono> createUserDefinedFunction(@HostParam("ledgerEndpoint" @UnexpectedResponseExceptionType(HttpResponseException.class) Response createUserDefinedFunctionSync(@HostParam("ledgerEndpoint") String ledgerEndpoint, @QueryParam("api-version") String apiVersion, @PathParam("functionId") String functionId, - @BodyParam("application/json") BinaryData userDefinedFunction, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData userDefinedFunction, RequestOptions requestOptions, + Context context); @Post("/app/userDefinedFunctions/{functionId}:execute") @ExpectedResponses({ 200 }) @@ -754,9 +784,10 @@ Response getUserDefinedRoleSync(@HostParam("ledgerEndpoint") String @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createUserDefinedRole(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") BinaryData roles, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Mono> createUserDefinedRoleStable(@HostParam("ledgerEndpoint") String ledgerEndpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Put("/app/roles") @ExpectedResponses({ 200 }) @@ -764,9 +795,10 @@ Mono> createUserDefinedRole(@HostParam("ledgerEndpoint") String l @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createUserDefinedRoleSync(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") BinaryData roles, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Response createUserDefinedRoleStableSync(@HostParam("ledgerEndpoint") String ledgerEndpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/app/roles") @ExpectedResponses({ 200 }) @@ -774,9 +806,10 @@ Response createUserDefinedRoleSync(@HostParam("ledgerEndpoint") String led @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> updateUserDefinedRole(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") BinaryData roles, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Mono> updateUserDefinedRoleStable(@HostParam("ledgerEndpoint") String ledgerEndpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Patch("/app/roles") @ExpectedResponses({ 200 }) @@ -784,29 +817,30 @@ Mono> updateUserDefinedRole(@HostParam("ledgerEndpoint") String l @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response updateUserDefinedRoleSync(@HostParam("ledgerEndpoint") String ledgerEndpoint, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") BinaryData roles, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Response updateUserDefinedRoleStableSync(@HostParam("ledgerEndpoint") String ledgerEndpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/merge-patch+json") BinaryData body, + RequestOptions requestOptions, Context context); @Delete("/app/roles") - @ExpectedResponses({ 200 }) + @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteUserDefinedRole(@HostParam("ledgerEndpoint") String ledgerEndpoint, + Mono> deleteUserDefinedRoleStable(@HostParam("ledgerEndpoint") String ledgerEndpoint, @QueryParam("api-version") String apiVersion, @QueryParam("roleName") String roleName, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Delete("/app/roles") - @ExpectedResponses({ 200 }) + @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteUserDefinedRoleSync(@HostParam("ledgerEndpoint") String ledgerEndpoint, + Response deleteUserDefinedRoleStableSync(@HostParam("ledgerEndpoint") String ledgerEndpoint, @QueryParam("api-version") String apiVersion, @QueryParam("roleName") String roleName, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -850,6 +884,26 @@ Response listCollectionsNextSync(@PathParam(value = "nextLink", enco @HostParam("ledgerEndpoint") String ledgerEndpoint, @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) + Mono> listTagsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("ledgerEndpoint") String ledgerEndpoint, @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 listTagsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("ledgerEndpoint") String ledgerEndpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -936,7 +990,8 @@ Response listUserDefinedFunctionsNextSync( /** * Gets the constitution used for governance. * - * The constitution is a script that assesses and applies proposals from consortium members. + * The constitution is a script that assesses and applies proposals from + * consortium members. *

Response Body Schema

* *
@@ -953,8 +1008,10 @@ Response listUserDefinedFunctionsNextSync(
      * @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 governance script for the application along with {@link Response} on successful completion of
-     * {@link Mono}.
+     * @return the constitution used for governance.
+     * 
+     * The constitution is a script that assesses and applies proposals from
+     * consortium members along with {@link Response} on successful completion of {@link Mono}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> getConstitutionWithResponseAsync(RequestOptions requestOptions) {
@@ -966,7 +1023,8 @@ public Mono> getConstitutionWithResponseAsync(RequestOption
     /**
      * Gets the constitution used for governance.
      * 
-     * The constitution is a script that assesses and applies proposals from consortium members.
+     * The constitution is a script that assesses and applies proposals from
+     * consortium members.
      * 

Response Body Schema

* *
@@ -983,7 +1041,10 @@ public Mono> getConstitutionWithResponseAsync(RequestOption
      * @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 governance script for the application along with {@link Response}.
+     * @return the constitution used for governance.
+     * 
+     * The constitution is a script that assesses and applies proposals from
+     * consortium members along with {@link Response}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response getConstitutionWithResponse(RequestOptions requestOptions) {
@@ -1121,7 +1182,8 @@ public PagedIterable listConsortiumMembers(RequestOptions requestOpt
     /**
      * Gets quotes for all nodes of the Confidential Ledger.
      * 
-     * A quote is an SGX enclave measurement that can be used to verify the validity of a node and its enclave.
+     * A quote is an SGX enclave measurement that can be used to verify the validity
+     * of a node and its enclave.
      * 

Response Body Schema

* *
@@ -1145,8 +1207,10 @@ public PagedIterable listConsortiumMembers(RequestOptions requestOpt
      * @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 information about the enclaves running the Confidential Ledger along with {@link Response} on successful
-     * completion of {@link Mono}.
+     * @return quotes for all nodes of the Confidential Ledger.
+     * 
+     * A quote is an SGX enclave measurement that can be used to verify the validity
+     * of a node and its enclave along with {@link Response} on successful completion of {@link Mono}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> getEnclaveQuotesWithResponseAsync(RequestOptions requestOptions) {
@@ -1158,7 +1222,8 @@ public Mono> getEnclaveQuotesWithResponseAsync(RequestOptio
     /**
      * Gets quotes for all nodes of the Confidential Ledger.
      * 
-     * A quote is an SGX enclave measurement that can be used to verify the validity of a node and its enclave.
+     * A quote is an SGX enclave measurement that can be used to verify the validity
+     * of a node and its enclave.
      * 

Response Body Schema

* *
@@ -1182,7 +1247,10 @@ public Mono> getEnclaveQuotesWithResponseAsync(RequestOptio
      * @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 information about the enclaves running the Confidential Ledger along with {@link Response}.
+     * @return quotes for all nodes of the Confidential Ledger.
+     * 
+     * A quote is an SGX enclave measurement that can be used to verify the validity
+     * of a node and its enclave along with {@link Response}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response getEnclaveQuotesWithResponse(RequestOptions requestOptions) {
@@ -1313,11 +1381,161 @@ public PagedIterable listCollections(RequestOptions requestOptions)
             nextLink -> listCollectionsNextSinglePage(nextLink, requestOptionsForNextPage));
     }
 
+    /**
+     * Gets a list of tags for a collection.
+     * 
+     * Retrieves the tags associated with a collection.
+     * 

Query Parameters

+ *
Query Parameters
+ * + * + * + *
Query Parameters
NameTypeRequiredDescription
collectionIdStringNoThe collection id.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * String
+     * }
+     * 
+ * + * @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 tags for a collection. + * + * Retrieves the tags associated with a collection along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTagsSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listTags(this.getLedgerEndpoint(), this.getServiceVersion().getVersion(), + accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "tags"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Gets a list of tags for a collection. + * + * Retrieves the tags associated with a collection. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
collectionIdStringNoThe collection id.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * String
+     * }
+     * 
+ * + * @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 tags for a collection. + * + * Retrieves the tags associated with a collection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTagsAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>(() -> listTagsSinglePageAsync(requestOptions), + nextLink -> listTagsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Gets a list of tags for a collection. + * + * Retrieves the tags associated with a collection. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
collectionIdStringNoThe collection id.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * String
+     * }
+     * 
+ * + * @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 tags for a collection. + * + * Retrieves the tags associated with a collection along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listTagsSinglePage(RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listTagsSync(this.getLedgerEndpoint(), this.getServiceVersion().getVersion(), + accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "tags"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Gets a list of tags for a collection. + * + * Retrieves the tags associated with a collection. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
collectionIdStringNoThe collection id.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * String
+     * }
+     * 
+ * + * @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 tags for a collection. + * + * Retrieves the tags associated with a collection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTags(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>(() -> listTagsSinglePage(requestOptions), + nextLink -> listTagsNextSinglePage(nextLink, requestOptionsForNextPage)); + } + /** * Gets ledger entries from a collection corresponding to a range. * - * A collection id may optionally be specified. Only entries in the specified (or default) collection will be - * returned. + * A collection id may optionally be specified. Only entries in the specified (or + * default) collection will be returned. *

Query Parameters

* * @@ -1368,8 +1586,10 @@ public PagedIterable listCollections(RequestOptions requestOptions) * @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 paginated ledger entries returned in response to a query along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return ledger entries from a collection corresponding to a range. + * + * A collection id may optionally be specified along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listLedgerEntriesSinglePageAsync(RequestOptions requestOptions) { @@ -1384,8 +1604,8 @@ private Mono> listLedgerEntriesSinglePageAsync(Request /** * Gets ledger entries from a collection corresponding to a range. * - * A collection id may optionally be specified. Only entries in the specified (or default) collection will be - * returned. + * A collection id may optionally be specified. Only entries in the specified (or + * default) collection will be returned. *

Query Parameters

*
Query Parameters
* @@ -1436,7 +1656,9 @@ private Mono> listLedgerEntriesSinglePageAsync(Request * @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 paginated ledger entries returned in response to a query as paginated response with {@link PagedFlux}. + * @return ledger entries from a collection corresponding to a range. + * + * A collection id may optionally be specified as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listLedgerEntriesAsync(RequestOptions requestOptions) { @@ -1450,8 +1672,8 @@ public PagedFlux listLedgerEntriesAsync(RequestOptions requestOption /** * Gets ledger entries from a collection corresponding to a range. * - * A collection id may optionally be specified. Only entries in the specified (or default) collection will be - * returned. + * A collection id may optionally be specified. Only entries in the specified (or + * default) collection will be returned. *

Query Parameters

*
Query Parameters
* @@ -1502,7 +1724,9 @@ public PagedFlux listLedgerEntriesAsync(RequestOptions requestOption * @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 paginated ledger entries returned in response to a query along with {@link PagedResponse}. + * @return ledger entries from a collection corresponding to a range. + * + * A collection id may optionally be specified along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listLedgerEntriesSinglePage(RequestOptions requestOptions) { @@ -1516,8 +1740,8 @@ private PagedResponse listLedgerEntriesSinglePage(RequestOptions req /** * Gets ledger entries from a collection corresponding to a range. * - * A collection id may optionally be specified. Only entries in the specified (or default) collection will be - * returned. + * A collection id may optionally be specified. Only entries in the specified (or + * default) collection will be returned. *

Query Parameters

*
Query Parameters
* @@ -1568,8 +1792,9 @@ private PagedResponse listLedgerEntriesSinglePage(RequestOptions req * @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 paginated ledger entries returned in response to a query as paginated response with - * {@link PagedIterable}. + * @return ledger entries from a collection corresponding to a range. + * + * A collection id may optionally be specified as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listLedgerEntries(RequestOptions requestOptions) { @@ -1642,15 +1867,17 @@ public PagedIterable listLedgerEntries(RequestOptions requestOptions * @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 returned as a result of a write to the Confidential Ledger, the transaction id in the response indicates - * when the write will become durable along with {@link Response} on successful completion of {@link Mono}. + * @return returned as a result of a write to the Confidential Ledger, the transaction id + * in the response indicates when the write will become durable along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createLedgerEntryWithResponseAsync(BinaryData entry, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.createLedgerEntry(this.getLedgerEndpoint(), - this.getServiceVersion().getVersion(), entry, accept, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, accept, entry, requestOptions, context)); } /** @@ -1715,23 +1942,26 @@ public Mono> createLedgerEntryWithResponseAsync(BinaryData * @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 returned as a result of a write to the Confidential Ledger, the transaction id in the response indicates - * when the write will become durable along with {@link Response}. + * @return returned as a result of a write to the Confidential Ledger, the transaction id + * in the response indicates when the write will become durable along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createLedgerEntryWithResponse(BinaryData entry, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createLedgerEntrySync(this.getLedgerEndpoint(), this.getServiceVersion().getVersion(), entry, - accept, requestOptions, Context.NONE); + return service.createLedgerEntrySync(this.getLedgerEndpoint(), this.getServiceVersion().getVersion(), + contentType, accept, entry, requestOptions, Context.NONE); } /** - * Gets the ledger entry at the specified transaction id. A collection id may optionally be specified to indicate - * the collection from which to fetch the value. - * - * To return older ledger entries, the relevant sections of the ledger must be read from disk and validated. To - * prevent blocking within the enclave, the response will indicate whether the entry is ready and part of the - * response, or if the loading is still ongoing. + * Gets the ledger entry at the specified transaction id. A collection id may + * optionally be specified to indicate the collection from which to fetch the + * value. + * + * To return older ledger entries, the relevant sections of the ledger must be + * read from disk and validated. To prevent blocking within the enclave, the + * response will indicate whether the entry is ready and part of the response, or + * if the loading is still ongoing. *

Query Parameters

*
Query Parameters
* @@ -1782,8 +2012,8 @@ public Response createLedgerEntryWithResponse(BinaryData entry, Requ * @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 result of querying for a ledger entry from an older transaction id along with {@link Response} on - * successful completion of {@link Mono}. + * @return the ledger entry at the specified transaction id along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getLedgerEntryWithResponseAsync(String transactionId, @@ -1794,12 +2024,14 @@ public Mono> getLedgerEntryWithResponseAsync(String transac } /** - * Gets the ledger entry at the specified transaction id. A collection id may optionally be specified to indicate - * the collection from which to fetch the value. - * - * To return older ledger entries, the relevant sections of the ledger must be read from disk and validated. To - * prevent blocking within the enclave, the response will indicate whether the entry is ready and part of the - * response, or if the loading is still ongoing. + * Gets the ledger entry at the specified transaction id. A collection id may + * optionally be specified to indicate the collection from which to fetch the + * value. + * + * To return older ledger entries, the relevant sections of the ledger must be + * read from disk and validated. To prevent blocking within the enclave, the + * response will indicate whether the entry is ready and part of the response, or + * if the loading is still ongoing. *

Query Parameters

*
Query Parameters
* @@ -1850,7 +2082,7 @@ public Mono> getLedgerEntryWithResponseAsync(String transac * @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 result of querying for a ledger entry from an older transaction id along with {@link Response}. + * @return the ledger entry at the specified transaction id along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getLedgerEntryWithResponse(String transactionId, RequestOptions requestOptions) { @@ -2096,7 +2328,9 @@ public Response getTransactionStatusWithResponse(String transactionI * @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 an entry in the ledger along with {@link Response} on successful completion of {@link Mono}. + * @return the current value available in the ledger. + * + * A collection id may optionally be specified along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getCurrentLedgerEntryWithResponseAsync(RequestOptions requestOptions) { @@ -2155,7 +2389,9 @@ public Mono> getCurrentLedgerEntryWithResponseAsync(Request * @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 an entry in the ledger along with {@link Response}. + * @return the current value available in the ledger. + * + * A collection id may optionally be specified along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getCurrentLedgerEntryWithResponse(RequestOptions requestOptions) { @@ -2173,7 +2409,7 @@ public Response getCurrentLedgerEntryWithResponse(RequestOptions req *
      * {@code
      * {
-     *     assignedRole: String(Administrator/Contributor/Reader) (Required)
+     *     assignedRole: String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     userId: String (Optional)
      * }
      * }
@@ -2184,8 +2420,10 @@ public Response getCurrentLedgerEntryWithResponse(RequestOptions req
      * @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 paginated users returned in response to a query along with {@link PagedResponse} on successful completion
-     * of {@link Mono}.
+     * @return details on a list of users.
+     * 
+     * All users' object IDs and single role per user will be returned along with {@link PagedResponse} on successful
+     * completion of {@link Mono}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     private Mono> listUsersSinglePageAsync(RequestOptions requestOptions) {
@@ -2206,7 +2444,7 @@ private Mono> listUsersSinglePageAsync(RequestOptions
      * 
      * {@code
      * {
-     *     assignedRole: String(Administrator/Contributor/Reader) (Required)
+     *     assignedRole: String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     userId: String (Optional)
      * }
      * }
@@ -2217,7 +2455,9 @@ private Mono> listUsersSinglePageAsync(RequestOptions
      * @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 paginated users returned in response to a query as paginated response with {@link PagedFlux}.
+     * @return details on a list of users.
+     * 
+     * All users' object IDs and single role per user will be returned as paginated response with {@link PagedFlux}.
      */
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public PagedFlux listUsersAsync(RequestOptions requestOptions) {
@@ -2237,7 +2477,7 @@ public PagedFlux listUsersAsync(RequestOptions requestOptions) {
      * 
      * {@code
      * {
-     *     assignedRole: String(Administrator/Contributor/Reader) (Required)
+     *     assignedRole: String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     userId: String (Optional)
      * }
      * }
@@ -2248,7 +2488,9 @@ public PagedFlux listUsersAsync(RequestOptions requestOptions) {
      * @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 paginated users returned in response to a query along with {@link PagedResponse}.
+     * @return details on a list of users.
+     * 
+     * All users' object IDs and single role per user will be returned along with {@link PagedResponse}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     private PagedResponse listUsersSinglePage(RequestOptions requestOptions) {
@@ -2268,7 +2510,7 @@ private PagedResponse listUsersSinglePage(RequestOptions requestOpti
      * 
      * {@code
      * {
-     *     assignedRole: String(Administrator/Contributor/Reader) (Required)
+     *     assignedRole: String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     userId: String (Optional)
      * }
      * }
@@ -2279,7 +2521,9 @@ private PagedResponse listUsersSinglePage(RequestOptions requestOpti
      * @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 paginated users returned in response to a query as paginated response with {@link PagedIterable}.
+     * @return details on a list of users.
+     * 
+     * All users' object IDs and single role per user will be returned as paginated response with {@link PagedIterable}.
      */
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public PagedIterable listUsers(RequestOptions requestOptions) {
@@ -2299,8 +2543,8 @@ public PagedIterable listUsers(RequestOptions requestOptions) {
      * 
      * {@code
      * {
-     *     assignedRoles (Required): [
-     *         String(Administrator/Contributor/Reader) (Required)
+     *     assignedRoles (Optional, Required on create): [
+     *         String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     ]
      *     userId: String (Optional)
      * }
@@ -2312,8 +2556,10 @@ public PagedIterable listUsers(RequestOptions requestOptions) {
      * @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 paginated users returned in response to a query along with {@link PagedResponse} on successful completion
-     * of {@link Mono}.
+     * @return details on a list of users.
+     * 
+     * All users' object IDs and multiple roles will be returned along with {@link PagedResponse} on successful
+     * completion of {@link Mono}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     private Mono> listLedgerUsersSinglePageAsync(RequestOptions requestOptions) {
@@ -2334,8 +2580,8 @@ private Mono> listLedgerUsersSinglePageAsync(RequestOp
      * 
      * {@code
      * {
-     *     assignedRoles (Required): [
-     *         String(Administrator/Contributor/Reader) (Required)
+     *     assignedRoles (Optional, Required on create): [
+     *         String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     ]
      *     userId: String (Optional)
      * }
@@ -2347,7 +2593,9 @@ private Mono> listLedgerUsersSinglePageAsync(RequestOp
      * @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 paginated users returned in response to a query as paginated response with {@link PagedFlux}.
+     * @return details on a list of users.
+     * 
+     * All users' object IDs and multiple roles will be returned as paginated response with {@link PagedFlux}.
      */
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public PagedFlux listLedgerUsersAsync(RequestOptions requestOptions) {
@@ -2367,8 +2615,8 @@ public PagedFlux listLedgerUsersAsync(RequestOptions requestOptions)
      * 
      * {@code
      * {
-     *     assignedRoles (Required): [
-     *         String(Administrator/Contributor/Reader) (Required)
+     *     assignedRoles (Optional, Required on create): [
+     *         String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     ]
      *     userId: String (Optional)
      * }
@@ -2380,7 +2628,9 @@ public PagedFlux listLedgerUsersAsync(RequestOptions requestOptions)
      * @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 paginated users returned in response to a query along with {@link PagedResponse}.
+     * @return details on a list of users.
+     * 
+     * All users' object IDs and multiple roles will be returned along with {@link PagedResponse}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     private PagedResponse listLedgerUsersSinglePage(RequestOptions requestOptions) {
@@ -2400,8 +2650,8 @@ private PagedResponse listLedgerUsersSinglePage(RequestOptions reque
      * 
      * {@code
      * {
-     *     assignedRoles (Required): [
-     *         String(Administrator/Contributor/Reader) (Required)
+     *     assignedRoles (Optional, Required on create): [
+     *         String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     ]
      *     userId: String (Optional)
      * }
@@ -2413,7 +2663,9 @@ private PagedResponse listLedgerUsersSinglePage(RequestOptions reque
      * @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 paginated users returned in response to a query as paginated response with {@link PagedIterable}.
+     * @return details on a list of users.
+     * 
+     * All users' object IDs and multiple roles will be returned as paginated response with {@link PagedIterable}.
      */
     @ServiceMethod(returns = ReturnType.COLLECTION)
     public PagedIterable listLedgerUsers(RequestOptions requestOptions) {
@@ -2437,9 +2689,8 @@ public PagedIterable listLedgerUsers(RequestOptions requestOptions)
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> deleteUserWithResponseAsync(String userId, RequestOptions requestOptions) {
-        final String accept = "application/json";
         return FluxUtil.withContext(context -> service.deleteUser(this.getLedgerEndpoint(),
-            this.getServiceVersion().getVersion(), userId, accept, requestOptions, context));
+            this.getServiceVersion().getVersion(), userId, requestOptions, context));
     }
 
     /**
@@ -2455,8 +2706,7 @@ public Mono> deleteUserWithResponseAsync(String userId, RequestOp
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response deleteUserWithResponse(String userId, RequestOptions requestOptions) {
-        final String accept = "application/json";
-        return service.deleteUserSync(this.getLedgerEndpoint(), this.getServiceVersion().getVersion(), userId, accept,
+        return service.deleteUserSync(this.getLedgerEndpoint(), this.getServiceVersion().getVersion(), userId,
             requestOptions, Context.NONE);
     }
 
@@ -2467,7 +2717,7 @@ public Response deleteUserWithResponse(String userId, RequestOptions reque
      * 
      * {@code
      * {
-     *     assignedRole: String(Administrator/Contributor/Reader) (Required)
+     *     assignedRole: String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     userId: String (Optional)
      * }
      * }
@@ -2495,7 +2745,7 @@ public Mono> getUserWithResponseAsync(String userId, Reques
      * 
      * {@code
      * {
-     *     assignedRole: String(Administrator/Contributor/Reader) (Required)
+     *     assignedRole: String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     userId: String (Optional)
      * }
      * }
@@ -2525,7 +2775,7 @@ public Response getUserWithResponse(String userId, RequestOptions re
      * 
      * {@code
      * {
-     *     assignedRole: String(Administrator/Contributor/Reader) (Required)
+     *     assignedRole: String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     userId: String (Optional)
      * }
      * }
@@ -2536,7 +2786,7 @@ public Response getUserWithResponse(String userId, RequestOptions re
      * 
      * {@code
      * {
-     *     assignedRole: String(Administrator/Contributor/Reader) (Required)
+     *     assignedRole: String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     userId: String (Optional)
      * }
      * }
@@ -2555,9 +2805,10 @@ public Response getUserWithResponse(String userId, RequestOptions re
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> createOrUpdateUserWithResponseAsync(String userId, BinaryData userDetails,
         RequestOptions requestOptions) {
+        final String contentType = "application/merge-patch+json";
         final String accept = "application/json";
         return FluxUtil.withContext(context -> service.createOrUpdateUser(this.getLedgerEndpoint(),
-            this.getServiceVersion().getVersion(), userId, userDetails, accept, requestOptions, context));
+            this.getServiceVersion().getVersion(), contentType, userId, accept, userDetails, requestOptions, context));
     }
 
     /**
@@ -2569,7 +2820,7 @@ public Mono> createOrUpdateUserWithResponseAsync(String use
      * 
      * {@code
      * {
-     *     assignedRole: String(Administrator/Contributor/Reader) (Required)
+     *     assignedRole: String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     userId: String (Optional)
      * }
      * }
@@ -2580,7 +2831,7 @@ public Mono> createOrUpdateUserWithResponseAsync(String use
      * 
      * {@code
      * {
-     *     assignedRole: String(Administrator/Contributor/Reader) (Required)
+     *     assignedRole: String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     userId: String (Optional)
      * }
      * }
@@ -2598,9 +2849,10 @@ public Mono> createOrUpdateUserWithResponseAsync(String use
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response createOrUpdateUserWithResponse(String userId, BinaryData userDetails,
         RequestOptions requestOptions) {
+        final String contentType = "application/merge-patch+json";
         final String accept = "application/json";
-        return service.createOrUpdateUserSync(this.getLedgerEndpoint(), this.getServiceVersion().getVersion(), userId,
-            userDetails, accept, requestOptions, Context.NONE);
+        return service.createOrUpdateUserSync(this.getLedgerEndpoint(), this.getServiceVersion().getVersion(),
+            contentType, userId, accept, userDetails, requestOptions, Context.NONE);
     }
 
     /**
@@ -2616,9 +2868,8 @@ public Response createOrUpdateUserWithResponse(String userId, Binary
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> deleteLedgerUserWithResponseAsync(String userId, RequestOptions requestOptions) {
-        final String accept = "application/json";
         return FluxUtil.withContext(context -> service.deleteLedgerUser(this.getLedgerEndpoint(),
-            this.getServiceVersion().getVersion(), userId, accept, requestOptions, context));
+            this.getServiceVersion().getVersion(), userId, requestOptions, context));
     }
 
     /**
@@ -2634,9 +2885,8 @@ public Mono> deleteLedgerUserWithResponseAsync(String userId, Req
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response deleteLedgerUserWithResponse(String userId, RequestOptions requestOptions) {
-        final String accept = "application/json";
         return service.deleteLedgerUserSync(this.getLedgerEndpoint(), this.getServiceVersion().getVersion(), userId,
-            accept, requestOptions, Context.NONE);
+            requestOptions, Context.NONE);
     }
 
     /**
@@ -2646,8 +2896,8 @@ public Response deleteLedgerUserWithResponse(String userId, RequestOptions
      * 
      * {@code
      * {
-     *     assignedRoles (Required): [
-     *         String(Administrator/Contributor/Reader) (Required)
+     *     assignedRoles (Optional, Required on create): [
+     *         String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     ]
      *     userId: String (Optional)
      * }
@@ -2676,8 +2926,8 @@ public Mono> getLedgerUserWithResponseAsync(String userId,
      * 
      * {@code
      * {
-     *     assignedRoles (Required): [
-     *         String(Administrator/Contributor/Reader) (Required)
+     *     assignedRoles (Optional, Required on create): [
+     *         String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     ]
      *     userId: String (Optional)
      * }
@@ -2708,8 +2958,8 @@ public Response getLedgerUserWithResponse(String userId, RequestOpti
      * 
      * {@code
      * {
-     *     assignedRoles (Required): [
-     *         String(Administrator/Contributor/Reader) (Required)
+     *     assignedRoles (Optional, Required on create): [
+     *         String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     ]
      *     userId: String (Optional)
      * }
@@ -2721,8 +2971,8 @@ public Response getLedgerUserWithResponse(String userId, RequestOpti
      * 
      * {@code
      * {
-     *     assignedRoles (Required): [
-     *         String(Administrator/Contributor/Reader) (Required)
+     *     assignedRoles (Optional, Required on create): [
+     *         String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     ]
      *     userId: String (Optional)
      * }
@@ -2742,9 +2992,11 @@ public Response getLedgerUserWithResponse(String userId, RequestOpti
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Mono> createOrUpdateLedgerUserWithResponseAsync(String userId,
         BinaryData userMultipleRoles, RequestOptions requestOptions) {
+        final String contentType = "application/merge-patch+json";
         final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.createOrUpdateLedgerUser(this.getLedgerEndpoint(),
-            this.getServiceVersion().getVersion(), userId, userMultipleRoles, accept, requestOptions, context));
+        return FluxUtil.withContext(
+            context -> service.createOrUpdateLedgerUser(this.getLedgerEndpoint(), this.getServiceVersion().getVersion(),
+                contentType, userId, accept, userMultipleRoles, requestOptions, context));
     }
 
     /**
@@ -2756,8 +3008,8 @@ public Mono> createOrUpdateLedgerUserWithResponseAsync(Stri
      * 
      * {@code
      * {
-     *     assignedRoles (Required): [
-     *         String(Administrator/Contributor/Reader) (Required)
+     *     assignedRoles (Optional, Required on create): [
+     *         String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     ]
      *     userId: String (Optional)
      * }
@@ -2769,8 +3021,8 @@ public Mono> createOrUpdateLedgerUserWithResponseAsync(Stri
      * 
      * {@code
      * {
-     *     assignedRoles (Required): [
-     *         String(Administrator/Contributor/Reader) (Required)
+     *     assignedRoles (Optional, Required on create): [
+     *         String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     ]
      *     userId: String (Optional)
      * }
@@ -2789,9 +3041,10 @@ public Mono> createOrUpdateLedgerUserWithResponseAsync(Stri
     @ServiceMethod(returns = ReturnType.SINGLE)
     public Response createOrUpdateLedgerUserWithResponse(String userId, BinaryData userMultipleRoles,
         RequestOptions requestOptions) {
+        final String contentType = "application/merge-patch+json";
         final String accept = "application/json";
         return service.createOrUpdateLedgerUserSync(this.getLedgerEndpoint(), this.getServiceVersion().getVersion(),
-            userId, userMultipleRoles, accept, requestOptions, Context.NONE);
+            contentType, userId, accept, userMultipleRoles, requestOptions, Context.NONE);
     }
 
     /**
@@ -2808,7 +3061,9 @@ public Response createOrUpdateLedgerUserWithResponse(String userId,
      *             String (Required): {
      *                 get (Optional): {
      *                     authn_policies (Required): [
-     *                         Object (Required)
+     *                          (Required){
+     *                             String: BinaryData (Required)
+     *                         }
      *                     ]
      *                     forwarding_required: String(sometimes/always/never) (Required)
      *                     interpreter_reuse (Optional): {
@@ -2817,7 +3072,9 @@ public Response createOrUpdateLedgerUserWithResponse(String userId,
      *                     js_function: String (Optional)
      *                     js_module: String (Optional)
      *                     mode: String(readwrite/readonly/historical) (Optional)
-     *                     openapi: Object (Optional)
+     *                     openapi (Optional): {
+     *                         String: BinaryData (Required)
+     *                     }
      *                     openapi_hidden: Boolean (Optional)
      *                     redirection_strategy: String(none/to_primary/to_backup) (Optional)
      *                 }
@@ -2827,7 +3084,12 @@ public Response createOrUpdateLedgerUserWithResponse(String userId,
      *             }
      *         }
      *     }
-     *     modules: Object (Required)
+     *     modules (Required): [
+     *          (Required){
+     *             module: String (Required)
+     *             name: String (Required)
+     *         }
+     *     ]
      * }
      * }
      * 
@@ -2837,7 +3099,9 @@ public Response createOrUpdateLedgerUserWithResponse(String userId, * @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 bundle for the user defined endpoints along with {@link Response} on successful completion of + * @return a user defined endpoint. + * + * Returns the user defined endpoint in the ACL instance along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -2861,7 +3125,9 @@ public Mono> getUserDefinedEndpointWithResponseAsync(Reques * String (Required): { * get (Optional): { * authn_policies (Required): [ - * Object (Required) + * (Required){ + * String: BinaryData (Required) + * } * ] * forwarding_required: String(sometimes/always/never) (Required) * interpreter_reuse (Optional): { @@ -2870,7 +3136,9 @@ public Mono> getUserDefinedEndpointWithResponseAsync(Reques * js_function: String (Optional) * js_module: String (Optional) * mode: String(readwrite/readonly/historical) (Optional) - * openapi: Object (Optional) + * openapi (Optional): { + * String: BinaryData (Required) + * } * openapi_hidden: Boolean (Optional) * redirection_strategy: String(none/to_primary/to_backup) (Optional) * } @@ -2880,7 +3148,12 @@ public Mono> getUserDefinedEndpointWithResponseAsync(Reques * } * } * } - * modules: Object (Required) + * modules (Required): [ + * (Required){ + * module: String (Required) + * name: String (Required) + * } + * ] * } * } *
@@ -2890,7 +3163,9 @@ public Mono> getUserDefinedEndpointWithResponseAsync(Reques * @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 bundle for the user defined endpoints along with {@link Response}. + * @return a user defined endpoint. + * + * Returns the user defined endpoint in the ACL instance along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getUserDefinedEndpointWithResponse(RequestOptions requestOptions) { @@ -2913,7 +3188,9 @@ public Response getUserDefinedEndpointWithResponse(RequestOptions re * String (Required): { * get (Optional): { * authn_policies (Required): [ - * Object (Required) + * (Required){ + * String: BinaryData (Required) + * } * ] * forwarding_required: String(sometimes/always/never) (Required) * interpreter_reuse (Optional): { @@ -2922,7 +3199,9 @@ public Response getUserDefinedEndpointWithResponse(RequestOptions re * js_function: String (Optional) * js_module: String (Optional) * mode: String(readwrite/readonly/historical) (Optional) - * openapi: Object (Optional) + * openapi (Optional): { + * String: BinaryData (Required) + * } * openapi_hidden: Boolean (Optional) * redirection_strategy: String(none/to_primary/to_backup) (Optional) * } @@ -2932,12 +3211,17 @@ public Response getUserDefinedEndpointWithResponse(RequestOptions re * } * } * } - * modules: Object (Required) + * modules (Required): [ + * (Required){ + * module: String (Required) + * name: String (Required) + * } + * ] * } * } *
* - * @param bundle bundle parameter description. + * @param bundle Specify a user defined endpoint. * @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. @@ -2948,9 +3232,9 @@ public Response getUserDefinedEndpointWithResponse(RequestOptions re @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createUserDefinedEndpointWithResponseAsync(BinaryData bundle, RequestOptions requestOptions) { - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil.withContext(context -> service.createUserDefinedEndpoint(this.getLedgerEndpoint(), - this.getServiceVersion().getVersion(), bundle, accept, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, bundle, requestOptions, context)); } /** @@ -2967,7 +3251,9 @@ public Mono> createUserDefinedEndpointWithResponseAsync(BinaryDat * String (Required): { * get (Optional): { * authn_policies (Required): [ - * Object (Required) + * (Required){ + * String: BinaryData (Required) + * } * ] * forwarding_required: String(sometimes/always/never) (Required) * interpreter_reuse (Optional): { @@ -2976,7 +3262,9 @@ public Mono> createUserDefinedEndpointWithResponseAsync(BinaryDat * js_function: String (Optional) * js_module: String (Optional) * mode: String(readwrite/readonly/historical) (Optional) - * openapi: Object (Optional) + * openapi (Optional): { + * String: BinaryData (Required) + * } * openapi_hidden: Boolean (Optional) * redirection_strategy: String(none/to_primary/to_backup) (Optional) * } @@ -2986,12 +3274,17 @@ public Mono> createUserDefinedEndpointWithResponseAsync(BinaryDat * } * } * } - * modules: Object (Required) + * modules (Required): [ + * (Required){ + * module: String (Required) + * name: String (Required) + * } + * ] * } * } *
* - * @param bundle bundle parameter description. + * @param bundle Specify a user defined endpoint. * @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. @@ -3001,9 +3294,9 @@ public Mono> createUserDefinedEndpointWithResponseAsync(BinaryDat */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createUserDefinedEndpointWithResponse(BinaryData bundle, RequestOptions requestOptions) { - final String accept = "application/json"; + final String contentType = "application/json"; return service.createUserDefinedEndpointSync(this.getLedgerEndpoint(), this.getServiceVersion().getVersion(), - bundle, accept, requestOptions, Context.NONE); + contentType, bundle, requestOptions, Context.NONE); } /** @@ -3107,7 +3400,7 @@ public Response getRuntimeOptionsWithResponse(RequestOptions request * } *
* - * @param jSRuntimeOptions JS runtime options. + * @param jsRuntimeOptions JS Runtime options. * @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. @@ -3117,11 +3410,12 @@ public Response getRuntimeOptionsWithResponse(RequestOptions request * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateRuntimeOptionsWithResponseAsync(BinaryData jSRuntimeOptions, + public Mono> updateRuntimeOptionsStableWithResponseAsync(BinaryData jsRuntimeOptions, RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateRuntimeOptions(this.getLedgerEndpoint(), - this.getServiceVersion().getVersion(), jSRuntimeOptions, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.updateRuntimeOptionsStable(this.getLedgerEndpoint(), + this.getServiceVersion().getVersion(), contentType, accept, jsRuntimeOptions, requestOptions, context)); } /** @@ -3158,7 +3452,7 @@ public Mono> updateRuntimeOptionsWithResponseAsync(BinaryDa * } *
* - * @param jSRuntimeOptions JS runtime options. + * @param jsRuntimeOptions JS Runtime options. * @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. @@ -3167,11 +3461,12 @@ public Mono> updateRuntimeOptionsWithResponseAsync(BinaryDa * @return jS runtime options for user defined endpoints and functions along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateRuntimeOptionsWithResponse(BinaryData jSRuntimeOptions, + public Response updateRuntimeOptionsStableWithResponse(BinaryData jsRuntimeOptions, RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; final String accept = "application/json"; - return service.updateRuntimeOptionsSync(this.getLedgerEndpoint(), this.getServiceVersion().getVersion(), - jSRuntimeOptions, accept, requestOptions, Context.NONE); + return service.updateRuntimeOptionsStableSync(this.getLedgerEndpoint(), this.getServiceVersion().getVersion(), + contentType, accept, jsRuntimeOptions, requestOptions, Context.NONE); } /** @@ -3195,7 +3490,7 @@ public Response updateRuntimeOptionsWithResponse(BinaryData jSRuntim * @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 response body along with {@link Response} on successful completion of {@link Mono}. + * @return module definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getUserDefinedEndpointsModuleWithResponseAsync(String moduleName, @@ -3226,7 +3521,7 @@ public Mono> getUserDefinedEndpointsModuleWithResponseAsync * @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 response body along with {@link Response}. + * @return module definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getUserDefinedEndpointsModuleWithResponse(String moduleName, @@ -3378,9 +3673,8 @@ public PagedIterable listUserDefinedFunctions(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteUserDefinedFunctionWithResponseAsync(String functionId, RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext(context -> service.deleteUserDefinedFunction(this.getLedgerEndpoint(), - this.getServiceVersion().getVersion(), functionId, accept, requestOptions, context)); + this.getServiceVersion().getVersion(), functionId, requestOptions, context)); } /** @@ -3396,9 +3690,8 @@ public Mono> deleteUserDefinedFunctionWithResponseAsync(String fu */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteUserDefinedFunctionWithResponse(String functionId, RequestOptions requestOptions) { - final String accept = "application/json"; return service.deleteUserDefinedFunctionSync(this.getLedgerEndpoint(), this.getServiceVersion().getVersion(), - functionId, accept, requestOptions, Context.NONE); + functionId, requestOptions, Context.NONE); } /** @@ -3422,8 +3715,10 @@ public Response deleteUserDefinedFunctionWithResponse(String functionId, R * @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 user defined function in the ledger along with {@link Response} on successful completion of - * {@link Mono}. + * @return a user defined function. + * + * Returns the user defined function in the Confidential Ledger along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getUserDefinedFunctionWithResponseAsync(String functionId, @@ -3454,7 +3749,9 @@ public Mono> getUserDefinedFunctionWithResponseAsync(String * @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 user defined function in the ledger along with {@link Response}. + * @return a user defined function. + * + * Returns the user defined function in the Confidential Ledger along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getUserDefinedFunctionWithResponse(String functionId, RequestOptions requestOptions) { @@ -3502,9 +3799,11 @@ public Response getUserDefinedFunctionWithResponse(String functionId @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createUserDefinedFunctionWithResponseAsync(String functionId, BinaryData userDefinedFunction, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.createUserDefinedFunction(this.getLedgerEndpoint(), - this.getServiceVersion().getVersion(), functionId, userDefinedFunction, accept, requestOptions, context)); + this.getServiceVersion().getVersion(), functionId, contentType, accept, userDefinedFunction, requestOptions, + context)); } /** @@ -3545,9 +3844,10 @@ public Mono> createUserDefinedFunctionWithResponseAsync(Str @ServiceMethod(returns = ReturnType.SINGLE) public Response createUserDefinedFunctionWithResponse(String functionId, BinaryData userDefinedFunction, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return service.createUserDefinedFunctionSync(this.getLedgerEndpoint(), this.getServiceVersion().getVersion(), - functionId, userDefinedFunction, accept, requestOptions, Context.NONE); + functionId, contentType, accept, userDefinedFunction, requestOptions, Context.NONE); } /** @@ -3701,14 +4001,16 @@ public Response executeUserDefinedFunctionWithResponse(String functi * *
      * {@code
-     * [
-     *      (Required){
-     *         roleName: String (Optional)
-     *         roleActions (Optional): [
-     *             String (Optional)
-     *         ]
-     *     }
-     * ]
+     * {
+     *     role (Required): [
+     *          (Required){
+     *             roleName: String (Optional)
+     *             roleActions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     * }
      * }
      * 
* @@ -3718,7 +4020,10 @@ public Response executeUserDefinedFunctionWithResponse(String functi * @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 definition for roles along with {@link Response} on successful completion of {@link Mono}. + * @return role actions for user defined roles + * + * user defined roles allow users to define and manage app specific AuthZ policy along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getUserDefinedRoleWithResponseAsync(String roleName, @@ -3736,14 +4041,16 @@ public Mono> getUserDefinedRoleWithResponseAsync(String rol * *
      * {@code
-     * [
-     *      (Required){
-     *         roleName: String (Optional)
-     *         roleActions (Optional): [
-     *             String (Optional)
-     *         ]
-     *     }
-     * ]
+     * {
+     *     role (Required): [
+     *          (Required){
+     *             roleName: String (Optional)
+     *             roleActions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     * }
      * }
      * 
* @@ -3753,7 +4060,9 @@ public Mono> getUserDefinedRoleWithResponseAsync(String rol * @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 definition for roles along with {@link Response}. + * @return role actions for user defined roles + * + * user defined roles allow users to define and manage app specific AuthZ policy along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getUserDefinedRoleWithResponse(String roleName, RequestOptions requestOptions) { @@ -3770,31 +4079,51 @@ public Response getUserDefinedRoleWithResponse(String roleName, Requ * *
      * {@code
-     * [
-     *      (Required){
-     *         roleName: String (Optional)
-     *         roleActions (Optional): [
-     *             String (Optional)
-     *         ]
-     *     }
-     * ]
+     * {
+     *     roles (Optional, Required on create): [
+     *          (Optional, Required on create){
+     *             roleName: String (Optional)
+     *             roleActions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     * }
      * }
      * 
* - * @param roles user defined role. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     roles (Optional, Required on create): [
+     *          (Optional, Required on create){
+     *             roleName: String (Optional)
+     *             roleActions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param body Request body. * @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 Response} on successful completion of {@link Mono}. + * @return roles along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createUserDefinedRoleWithResponseAsync(BinaryData roles, + public Mono> createUserDefinedRoleStableWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createUserDefinedRole(this.getLedgerEndpoint(), - this.getServiceVersion().getVersion(), roles, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.createUserDefinedRoleStable(this.getLedgerEndpoint(), + this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context)); } /** @@ -3805,107 +4134,170 @@ public Mono> createUserDefinedRoleWithResponseAsync(BinaryData ro * *
      * {@code
-     * [
-     *      (Required){
-     *         roleName: String (Optional)
-     *         roleActions (Optional): [
-     *             String (Optional)
-     *         ]
-     *     }
-     * ]
+     * {
+     *     roles (Optional, Required on create): [
+     *          (Optional, Required on create){
+     *             roleName: String (Optional)
+     *             roleActions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     * }
      * }
      * 
* - * @param roles user defined role. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     roles (Optional, Required on create): [
+     *          (Optional, Required on create){
+     *             roleName: String (Optional)
+     *             roleActions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param body Request body. * @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 Response}. + * @return roles along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createUserDefinedRoleWithResponse(BinaryData roles, RequestOptions requestOptions) { + public Response createUserDefinedRoleStableWithResponse(BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.createUserDefinedRoleSync(this.getLedgerEndpoint(), this.getServiceVersion().getVersion(), roles, - accept, requestOptions, Context.NONE); + return service.createUserDefinedRoleStableSync(this.getLedgerEndpoint(), this.getServiceVersion().getVersion(), + contentType, accept, body, requestOptions, Context.NONE); } /** - * Patch replaces the allowed action on existing roles,if the desire is to remove an existing action, the role must - * be deleted and recreated. + * Patch replaces the allowed action on existing roles,if the desire is to remove + * an existing action, the role must be deleted and recreated. * * User defined roles allow users to define and manage app specific AuthZ policy. *

Request Body Schema

* *
      * {@code
-     * [
-     *      (Required){
-     *         roleName: String (Optional)
-     *         roleActions (Optional): [
-     *             String (Optional)
-     *         ]
-     *     }
-     * ]
+     * {
+     *     roles (Optional, Required on create): [
+     *          (Optional, Required on create){
+     *             roleName: String (Optional)
+     *             roleActions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     roles (Optional, Required on create): [
+     *          (Optional, Required on create){
+     *             roleName: String (Optional)
+     *             roleActions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     * }
      * }
      * 
* - * @param roles user defined role. + * @param body Request body. * @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 Response} on successful completion of {@link Mono}. + * @return roles along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateUserDefinedRoleWithResponseAsync(BinaryData roles, + public Mono> updateUserDefinedRoleStableWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateUserDefinedRole(this.getLedgerEndpoint(), - this.getServiceVersion().getVersion(), roles, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.updateUserDefinedRoleStable(this.getLedgerEndpoint(), + this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context)); } /** - * Patch replaces the allowed action on existing roles,if the desire is to remove an existing action, the role must - * be deleted and recreated. + * Patch replaces the allowed action on existing roles,if the desire is to remove + * an existing action, the role must be deleted and recreated. * * User defined roles allow users to define and manage app specific AuthZ policy. *

Request Body Schema

* *
      * {@code
-     * [
-     *      (Required){
-     *         roleName: String (Optional)
-     *         roleActions (Optional): [
-     *             String (Optional)
-     *         ]
-     *     }
-     * ]
+     * {
+     *     roles (Optional, Required on create): [
+     *          (Optional, Required on create){
+     *             roleName: String (Optional)
+     *             roleActions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     * }
      * }
      * 
* - * @param roles user defined role. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     roles (Optional, Required on create): [
+     *          (Optional, Required on create){
+     *             roleName: String (Optional)
+     *             roleActions (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param body Request body. * @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 Response}. + * @return roles along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateUserDefinedRoleWithResponse(BinaryData roles, RequestOptions requestOptions) { + public Response updateUserDefinedRoleStableWithResponse(BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; final String accept = "application/json"; - return service.updateUserDefinedRoleSync(this.getLedgerEndpoint(), this.getServiceVersion().getVersion(), roles, - accept, requestOptions, Context.NONE); + return service.updateUserDefinedRoleStableSync(this.getLedgerEndpoint(), this.getServiceVersion().getVersion(), + contentType, accept, body, requestOptions, Context.NONE); } /** * Deletes user defined roles * - * A user defined role allows the users to create and manage their own role actions using the API. + * A user defined role allows the users to create and manage their own role + * actions using the API. * * @param roleName user defined role name. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -3916,16 +4308,17 @@ public Response updateUserDefinedRoleWithResponse(BinaryData roles, Reques * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteUserDefinedRoleWithResponseAsync(String roleName, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.deleteUserDefinedRole(this.getLedgerEndpoint(), - this.getServiceVersion().getVersion(), roleName, accept, requestOptions, context)); + public Mono> deleteUserDefinedRoleStableWithResponseAsync(String roleName, + RequestOptions requestOptions) { + return FluxUtil.withContext(context -> service.deleteUserDefinedRoleStable(this.getLedgerEndpoint(), + this.getServiceVersion().getVersion(), roleName, requestOptions, context)); } /** * Deletes user defined roles * - * A user defined role allows the users to create and manage their own role actions using the API. + * A user defined role allows the users to create and manage their own role + * actions using the API. * * @param roleName user defined role name. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -3936,13 +4329,14 @@ public Mono> deleteUserDefinedRoleWithResponseAsync(String roleNa * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteUserDefinedRoleWithResponse(String roleName, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.deleteUserDefinedRoleSync(this.getLedgerEndpoint(), this.getServiceVersion().getVersion(), - roleName, accept, requestOptions, Context.NONE); + public Response deleteUserDefinedRoleStableWithResponse(String roleName, RequestOptions requestOptions) { + return service.deleteUserDefinedRoleStableSync(this.getLedgerEndpoint(), this.getServiceVersion().getVersion(), + roleName, requestOptions, Context.NONE); } /** + * Lists the consortium members. + * * Get the next page of items. *

Response Body Schema

* @@ -3976,6 +4370,8 @@ private Mono> listConsortiumMembersNextSinglePageAsync } /** + * Lists the consortium members. + * * Get the next page of items. *

Response Body Schema

* @@ -4007,6 +4403,8 @@ private PagedResponse listConsortiumMembersNextSinglePage(String nex } /** + * Retrieves a list of collection ids present in the Confidential Ledger + * * Get the next page of items. *

Response Body Schema

* @@ -4038,6 +4436,8 @@ private Mono> listCollectionsNextSinglePageAsync(Strin } /** + * Retrieves a list of collection ids present in the Confidential Ledger + * * Get the next page of items. *

Response Body Schema

* @@ -4067,6 +4467,73 @@ private PagedResponse listCollectionsNextSinglePage(String nextLink, } /** + * Gets a list of tags for a collection. + * + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * String
+     * }
+     * 
+ * + * @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 a list of tags for a collection. + * + * Retrieves the tags associated with a collection along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTagsNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listTagsNext(nextLink, this.getLedgerEndpoint(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "tags"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Gets a list of tags for a collection. + * + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * String
+     * }
+     * 
+ * + * @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 a list of tags for a collection. + * + * Retrieves the tags associated with a collection along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listTagsNextSinglePage(String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + Response res + = service.listTagsNextSync(nextLink, this.getLedgerEndpoint(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "tags"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Gets ledger entries from a collection corresponding to a range. + * * Get the next page of items. *

Response Body Schema

* @@ -4108,8 +4575,10 @@ private PagedResponse listCollectionsNextSinglePage(String nextLink, * @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 paginated ledger entries returned in response to a query along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return ledger entries from a collection corresponding to a range. + * + * A collection id may optionally be specified along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listLedgerEntriesNextSinglePageAsync(String nextLink, @@ -4123,6 +4592,8 @@ private Mono> listLedgerEntriesNextSinglePageAsync(Str } /** + * Gets ledger entries from a collection corresponding to a range. + * * Get the next page of items. *

Response Body Schema

* @@ -4164,7 +4635,9 @@ private Mono> listLedgerEntriesNextSinglePageAsync(Str * @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 paginated ledger entries returned in response to a query along with {@link PagedResponse}. + * @return ledger entries from a collection corresponding to a range. + * + * A collection id may optionally be specified along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listLedgerEntriesNextSinglePage(String nextLink, RequestOptions requestOptions) { @@ -4176,13 +4649,15 @@ private PagedResponse listLedgerEntriesNextSinglePage(String nextLin } /** + * Gets details on a list of users. + * * Get the next page of items. *

Response Body Schema

* *
      * {@code
      * {
-     *     assignedRole: String(Administrator/Contributor/Reader) (Required)
+     *     assignedRole: String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     userId: String (Optional)
      * }
      * }
@@ -4194,8 +4669,10 @@ private PagedResponse listLedgerEntriesNextSinglePage(String nextLin
      * @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 paginated users returned in response to a query along with {@link PagedResponse} on successful completion
-     * of {@link Mono}.
+     * @return details on a list of users.
+     * 
+     * All users' object IDs and single role per user will be returned along with {@link PagedResponse} on successful
+     * completion of {@link Mono}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     private Mono> listUsersNextSinglePageAsync(String nextLink,
@@ -4209,13 +4686,15 @@ private Mono> listUsersNextSinglePageAsync(String next
     }
 
     /**
+     * Gets details on a list of users.
+     * 
      * Get the next page of items.
      * 

Response Body Schema

* *
      * {@code
      * {
-     *     assignedRole: String(Administrator/Contributor/Reader) (Required)
+     *     assignedRole: String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     userId: String (Optional)
      * }
      * }
@@ -4227,7 +4706,9 @@ private Mono> listUsersNextSinglePageAsync(String next
      * @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 paginated users returned in response to a query along with {@link PagedResponse}.
+     * @return details on a list of users.
+     * 
+     * All users' object IDs and single role per user will be returned along with {@link PagedResponse}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     private PagedResponse listUsersNextSinglePage(String nextLink, RequestOptions requestOptions) {
@@ -4239,14 +4720,16 @@ private PagedResponse listUsersNextSinglePage(String nextLink, Reque
     }
 
     /**
+     * Gets details on a list of users.
+     * 
      * Get the next page of items.
      * 

Response Body Schema

* *
      * {@code
      * {
-     *     assignedRoles (Required): [
-     *         String(Administrator/Contributor/Reader) (Required)
+     *     assignedRoles (Optional, Required on create): [
+     *         String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     ]
      *     userId: String (Optional)
      * }
@@ -4259,8 +4742,10 @@ private PagedResponse listUsersNextSinglePage(String nextLink, Reque
      * @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 paginated users returned in response to a query along with {@link PagedResponse} on successful completion
-     * of {@link Mono}.
+     * @return details on a list of users.
+     * 
+     * All users' object IDs and multiple roles will be returned along with {@link PagedResponse} on successful
+     * completion of {@link Mono}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     private Mono> listLedgerUsersNextSinglePageAsync(String nextLink,
@@ -4273,14 +4758,16 @@ private Mono> listLedgerUsersNextSinglePageAsync(Strin
     }
 
     /**
+     * Gets details on a list of users.
+     * 
      * Get the next page of items.
      * 

Response Body Schema

* *
      * {@code
      * {
-     *     assignedRoles (Required): [
-     *         String(Administrator/Contributor/Reader) (Required)
+     *     assignedRoles (Optional, Required on create): [
+     *         String(Administrator/Contributor/Reader) (Optional, Required on create)
      *     ]
      *     userId: String (Optional)
      * }
@@ -4293,7 +4780,9 @@ private Mono> listLedgerUsersNextSinglePageAsync(Strin
      * @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 paginated users returned in response to a query along with {@link PagedResponse}.
+     * @return details on a list of users.
+     * 
+     * All users' object IDs and multiple roles will be returned along with {@link PagedResponse}.
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     private PagedResponse listLedgerUsersNextSinglePage(String nextLink, RequestOptions requestOptions) {
@@ -4305,6 +4794,8 @@ private PagedResponse listLedgerUsersNextSinglePage(String nextLink,
     }
 
     /**
+     * Retrieves a list of user defined functions present in the Confidential Ledger
+     * 
      * Get the next page of items.
      * 

Response Body Schema

* @@ -4338,6 +4829,8 @@ private Mono> listUserDefinedFunctionsNextSinglePageAs } /** + * Retrieves a list of user defined functions present in the Confidential Ledger + * * Get the next page of items. *

Response Body Schema

* diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/implementation/JsonMergePatchHelper.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/implementation/JsonMergePatchHelper.java new file mode 100644 index 000000000000..f5096617f06f --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/implementation/JsonMergePatchHelper.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.implementation; + +import com.azure.security.confidentialledger.models.JsRuntimeOptions; +import com.azure.security.confidentialledger.models.LedgerUser; +import com.azure.security.confidentialledger.models.LedgerUserMultipleRoles; +import com.azure.security.confidentialledger.models.Role; +import com.azure.security.confidentialledger.models.UserDefinedRoles; + +/** + * This is the Helper class to enable json merge patch serialization for a model. + */ +public class JsonMergePatchHelper { + private static JsRuntimeOptionsAccessor jsRuntimeOptionsAccessor; + + public interface JsRuntimeOptionsAccessor { + JsRuntimeOptions prepareModelForJsonMergePatch(JsRuntimeOptions jsRuntimeOptions, + boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(JsRuntimeOptions jsRuntimeOptions); + } + + public static void setJsRuntimeOptionsAccessor(JsRuntimeOptionsAccessor accessor) { + jsRuntimeOptionsAccessor = accessor; + } + + public static JsRuntimeOptionsAccessor getJsRuntimeOptionsAccessor() { + return jsRuntimeOptionsAccessor; + } + + private static LedgerUserAccessor ledgerUserAccessor; + + public interface LedgerUserAccessor { + LedgerUser prepareModelForJsonMergePatch(LedgerUser ledgerUser, boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(LedgerUser ledgerUser); + } + + public static void setLedgerUserAccessor(LedgerUserAccessor accessor) { + ledgerUserAccessor = accessor; + } + + public static LedgerUserAccessor getLedgerUserAccessor() { + return ledgerUserAccessor; + } + + private static LedgerUserMultipleRolesAccessor ledgerUserMultipleRolesAccessor; + + public interface LedgerUserMultipleRolesAccessor { + LedgerUserMultipleRoles prepareModelForJsonMergePatch(LedgerUserMultipleRoles ledgerUserMultipleRoles, + boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(LedgerUserMultipleRoles ledgerUserMultipleRoles); + } + + public static void setLedgerUserMultipleRolesAccessor(LedgerUserMultipleRolesAccessor accessor) { + ledgerUserMultipleRolesAccessor = accessor; + } + + public static LedgerUserMultipleRolesAccessor getLedgerUserMultipleRolesAccessor() { + return ledgerUserMultipleRolesAccessor; + } + + private static RoleAccessor roleAccessor; + + public interface RoleAccessor { + Role prepareModelForJsonMergePatch(Role role, boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(Role role); + } + + public static void setRoleAccessor(RoleAccessor accessor) { + roleAccessor = accessor; + } + + public static RoleAccessor getRoleAccessor() { + return roleAccessor; + } + + private static UserDefinedRolesAccessor userDefinedRolesAccessor; + + public interface UserDefinedRolesAccessor { + UserDefinedRoles prepareModelForJsonMergePatch(UserDefinedRoles userDefinedRoles, + boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(UserDefinedRoles userDefinedRoles); + } + + public static void setUserDefinedRolesAccessor(UserDefinedRolesAccessor accessor) { + userDefinedRolesAccessor = accessor; + } + + public static UserDefinedRolesAccessor getUserDefinedRolesAccessor() { + return userDefinedRolesAccessor; + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/implementation/package-info.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/implementation/package-info.java index b1ce94686412..c73da36827cc 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/implementation/package-info.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/implementation/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for ConfidentialLedgerClient. - * The ConfidentialLedgerClient writes and retrieves ledger entries against the Confidential Ledger service. + * Package containing the implementations for ConfidentialLedger. + * Write and retrieve ledger entries against the Confidential Ledger service. */ package com.azure.security.confidentialledger.implementation; diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ApplicationClaim.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ApplicationClaim.java new file mode 100644 index 000000000000..5b19dbd8f26f --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ApplicationClaim.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A claim of a ledger application. + */ +@Immutable +public final class ApplicationClaim implements JsonSerializable { + /* + * An application claim in digested form. + */ + @Generated + private ClaimDigest digest; + + /* + * Represents the kind of an application claim. + */ + @Generated + private final ApplicationClaimKind kind; + + /* + * An application claim derived from ledger entry data. + */ + @Generated + private LedgerEntryClaim ledgerEntry; + + /** + * Creates an instance of ApplicationClaim class. + * + * @param kind the kind value to set. + */ + @Generated + private ApplicationClaim(ApplicationClaimKind kind) { + this.kind = kind; + } + + /** + * Get the digest property: An application claim in digested form. + * + * @return the digest value. + */ + @Generated + public ClaimDigest getDigest() { + return this.digest; + } + + /** + * Get the kind property: Represents the kind of an application claim. + * + * @return the kind value. + */ + @Generated + public ApplicationClaimKind getKind() { + return this.kind; + } + + /** + * Get the ledgerEntry property: An application claim derived from ledger entry data. + * + * @return the ledgerEntry value. + */ + @Generated + public LedgerEntryClaim getLedgerEntry() { + return this.ledgerEntry; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("digest", this.digest); + jsonWriter.writeJsonField("ledgerEntry", this.ledgerEntry); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationClaim from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationClaim if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationClaim. + */ + @Generated + public static ApplicationClaim fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationClaimKind kind = null; + ClaimDigest digest = null; + LedgerEntryClaim ledgerEntry = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + kind = ApplicationClaimKind.fromString(reader.getString()); + } else if ("digest".equals(fieldName)) { + digest = ClaimDigest.fromJson(reader); + } else if ("ledgerEntry".equals(fieldName)) { + ledgerEntry = LedgerEntryClaim.fromJson(reader); + } else { + reader.skipChildren(); + } + } + ApplicationClaim deserializedApplicationClaim = new ApplicationClaim(kind); + deserializedApplicationClaim.digest = digest; + deserializedApplicationClaim.ledgerEntry = ledgerEntry; + + return deserializedApplicationClaim; + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ApplicationClaimKind.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ApplicationClaimKind.java new file mode 100644 index 000000000000..2defdf941f60 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ApplicationClaimKind.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Represents the kind of an application claim. + */ +public final class ApplicationClaimKind extends ExpandableStringEnum { + /** + * Claim derived from a ledger entry. + */ + @Generated + public static final ApplicationClaimKind LEDGER_ENTRY = fromString("LedgerEntry"); + + /** + * Claim in digested form. + */ + @Generated + public static final ApplicationClaimKind CLAIM_DIGEST = fromString("ClaimDigest"); + + /** + * Creates a new instance of ApplicationClaimKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ApplicationClaimKind() { + } + + /** + * Creates or finds a ApplicationClaimKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationClaimKind. + */ + @Generated + public static ApplicationClaimKind fromString(String name) { + return fromString(name, ApplicationClaimKind.class); + } + + /** + * Gets known ApplicationClaimKind values. + * + * @return known ApplicationClaimKind values. + */ + @Generated + public static Collection values() { + return values(ApplicationClaimKind.class); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ApplicationClaimProtocol.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ApplicationClaimProtocol.java new file mode 100644 index 000000000000..70a96cf2bc9c --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ApplicationClaimProtocol.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Represents the protocol to be used to compute the digest of a claim from the + * given claim data. + */ +public final class ApplicationClaimProtocol extends ExpandableStringEnum { + /** + * Ledger Entry V1 protocol. + */ + @Generated + public static final ApplicationClaimProtocol LEDGER_ENTRY_V1 = fromString("LedgerEntryV1"); + + /** + * Creates a new instance of ApplicationClaimProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ApplicationClaimProtocol() { + } + + /** + * Creates or finds a ApplicationClaimProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationClaimProtocol. + */ + @Generated + public static ApplicationClaimProtocol fromString(String name) { + return fromString(name, ApplicationClaimProtocol.class); + } + + /** + * Gets known ApplicationClaimProtocol values. + * + * @return known ApplicationClaimProtocol values. + */ + @Generated + public static Collection values() { + return values(ApplicationClaimProtocol.class); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/Bundle.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/Bundle.java new file mode 100644 index 000000000000..590141d1cb30 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/Bundle.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * bundle for the user defined endpoints. + */ +@Immutable +public final class Bundle implements JsonSerializable { + /* + * Metadata information for the bundle. + */ + @Generated + private final Metadata metadata; + + /* + * Any object + */ + @Generated + private final List modules; + + /** + * Creates an instance of Bundle class. + * + * @param metadata the metadata value to set. + * @param modules the modules value to set. + */ + @Generated + public Bundle(Metadata metadata, List modules) { + this.metadata = metadata; + this.modules = modules; + } + + /** + * Get the metadata property: Metadata information for the bundle. + * + * @return the metadata value. + */ + @Generated + public Metadata getMetadata() { + return this.metadata; + } + + /** + * Get the modules property: Any object. + * + * @return the modules value. + */ + @Generated + public List getModules() { + return this.modules; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("metadata", this.metadata); + jsonWriter.writeArrayField("modules", this.modules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Bundle from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Bundle if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Bundle. + */ + @Generated + public static Bundle fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Metadata metadata = null; + List modules = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metadata".equals(fieldName)) { + metadata = Metadata.fromJson(reader); + } else if ("modules".equals(fieldName)) { + modules = reader.readArray(reader1 -> ModuleDef.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new Bundle(metadata, modules); + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ClaimDigest.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ClaimDigest.java new file mode 100644 index 000000000000..8cb742a91fc5 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ClaimDigest.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An application claim in digested form. + */ +@Immutable +public final class ClaimDigest implements JsonSerializable { + /* + * The digest of the application claim, in hexadecimal form. + */ + @Generated + private String value; + + /* + * Represents the protocol to be used to compute the digest of a claim from the + * given claim data. + */ + @Generated + private final ApplicationClaimProtocol protocol; + + /** + * Creates an instance of ClaimDigest class. + * + * @param protocol the protocol value to set. + */ + @Generated + private ClaimDigest(ApplicationClaimProtocol protocol) { + this.protocol = protocol; + } + + /** + * Get the value property: The digest of the application claim, in hexadecimal form. + * + * @return the value value. + */ + @Generated + public String getValue() { + return this.value; + } + + /** + * Get the protocol property: Represents the protocol to be used to compute the digest of a claim from the + * given claim data. + * + * @return the protocol value. + */ + @Generated + public ApplicationClaimProtocol getProtocol() { + return this.protocol; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClaimDigest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClaimDigest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ClaimDigest. + */ + @Generated + public static ClaimDigest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationClaimProtocol protocol = null; + String value = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protocol".equals(fieldName)) { + protocol = ApplicationClaimProtocol.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + value = reader.getString(); + } else { + reader.skipChildren(); + } + } + ClaimDigest deserializedClaimDigest = new ClaimDigest(protocol); + deserializedClaimDigest.value = value; + + return deserializedClaimDigest; + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/Collection.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/Collection.java new file mode 100644 index 000000000000..e1c417fbfbb6 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/Collection.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Identifier for collections. + */ +@Immutable +public final class Collection implements JsonSerializable { + /* + * Identifier for the collection. + */ + @Generated + private final String collectionId; + + /** + * Creates an instance of Collection class. + * + * @param collectionId the collectionId value to set. + */ + @Generated + private Collection(String collectionId) { + this.collectionId = collectionId; + } + + /** + * Get the collectionId property: Identifier for the collection. + * + * @return the collectionId value. + */ + @Generated + public String getCollectionId() { + return this.collectionId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("collectionId", this.collectionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Collection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Collection if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Collection. + */ + @Generated + public static Collection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String collectionId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("collectionId".equals(fieldName)) { + collectionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new Collection(collectionId); + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ConfidentialLedgerEnclaves.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ConfidentialLedgerEnclaves.java new file mode 100644 index 000000000000..10433797505b --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ConfidentialLedgerEnclaves.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Information about the enclaves running the Confidential Ledger. + */ +@Immutable +public final class ConfidentialLedgerEnclaves implements JsonSerializable { + /* + * Id of the Confidential Ledger node responding to the request. + */ + @Generated + private final String currentNodeId; + + /* + * Dictionary of enclave quotes, indexed by node id. + */ + @Generated + private final Map enclaveQuotes; + + /** + * Creates an instance of ConfidentialLedgerEnclaves class. + * + * @param currentNodeId the currentNodeId value to set. + * @param enclaveQuotes the enclaveQuotes value to set. + */ + @Generated + private ConfidentialLedgerEnclaves(String currentNodeId, Map enclaveQuotes) { + this.currentNodeId = currentNodeId; + this.enclaveQuotes = enclaveQuotes; + } + + /** + * Get the currentNodeId property: Id of the Confidential Ledger node responding to the request. + * + * @return the currentNodeId value. + */ + @Generated + public String getCurrentNodeId() { + return this.currentNodeId; + } + + /** + * Get the enclaveQuotes property: Dictionary of enclave quotes, indexed by node id. + * + * @return the enclaveQuotes value. + */ + @Generated + public Map getEnclaveQuotes() { + return this.enclaveQuotes; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("currentNodeId", this.currentNodeId); + jsonWriter.writeMapField("enclaveQuotes", this.enclaveQuotes, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfidentialLedgerEnclaves from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfidentialLedgerEnclaves if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConfidentialLedgerEnclaves. + */ + @Generated + public static ConfidentialLedgerEnclaves fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String currentNodeId = null; + Map enclaveQuotes = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("currentNodeId".equals(fieldName)) { + currentNodeId = reader.getString(); + } else if ("enclaveQuotes".equals(fieldName)) { + enclaveQuotes = reader.readMap(reader1 -> EnclaveQuote.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new ConfidentialLedgerEnclaves(currentNodeId, enclaveQuotes); + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ConfidentialLedgerQueryState.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ConfidentialLedgerQueryState.java new file mode 100644 index 000000000000..f107561426c2 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ConfidentialLedgerQueryState.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * State of a ledger query. + */ +public final class ConfidentialLedgerQueryState extends ExpandableStringEnum { + /** + * The query is still loading. + */ + @Generated + public static final ConfidentialLedgerQueryState LOADING = fromString("Loading"); + + /** + * The query is ready. + */ + @Generated + public static final ConfidentialLedgerQueryState READY = fromString("Ready"); + + /** + * Creates a new instance of ConfidentialLedgerQueryState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ConfidentialLedgerQueryState() { + } + + /** + * Creates or finds a ConfidentialLedgerQueryState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConfidentialLedgerQueryState. + */ + @Generated + public static ConfidentialLedgerQueryState fromString(String name) { + return fromString(name, ConfidentialLedgerQueryState.class); + } + + /** + * Gets known ConfidentialLedgerQueryState values. + * + * @return known ConfidentialLedgerQueryState values. + */ + @Generated + public static Collection values() { + return values(ConfidentialLedgerQueryState.class); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ConfidentialLedgerUserRoleName.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ConfidentialLedgerUserRoleName.java new file mode 100644 index 000000000000..b18313d5bbd9 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ConfidentialLedgerUserRoleName.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Represents an assignable role. + */ +public final class ConfidentialLedgerUserRoleName extends ExpandableStringEnum { + /** + * Administrator role. + */ + @Generated + public static final ConfidentialLedgerUserRoleName ADMINISTRATOR = fromString("Administrator"); + + /** + * Contributor role. + */ + @Generated + public static final ConfidentialLedgerUserRoleName CONTRIBUTOR = fromString("Contributor"); + + /** + * Reader role. + */ + @Generated + public static final ConfidentialLedgerUserRoleName READER = fromString("Reader"); + + /** + * Creates a new instance of ConfidentialLedgerUserRoleName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ConfidentialLedgerUserRoleName() { + } + + /** + * Creates or finds a ConfidentialLedgerUserRoleName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConfidentialLedgerUserRoleName. + */ + @Generated + public static ConfidentialLedgerUserRoleName fromString(String name) { + return fromString(name, ConfidentialLedgerUserRoleName.class); + } + + /** + * Gets known ConfidentialLedgerUserRoleName values. + * + * @return known ConfidentialLedgerUserRoleName values. + */ + @Generated + public static Collection values() { + return values(ConfidentialLedgerUserRoleName.class); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ConsortiumMember.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ConsortiumMember.java new file mode 100644 index 000000000000..c0643e90168b --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ConsortiumMember.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a member of the consortium. + */ +@Immutable +public final class ConsortiumMember implements JsonSerializable { + /* + * PEM-encoded certificate associated with the member. + */ + @Generated + private final String certificate; + + /* + * Identifier assigned to the member. + */ + @Generated + private final String id; + + /** + * Creates an instance of ConsortiumMember class. + * + * @param certificate the certificate value to set. + * @param id the id value to set. + */ + @Generated + private ConsortiumMember(String certificate, String id) { + this.certificate = certificate; + this.id = id; + } + + /** + * Get the certificate property: PEM-encoded certificate associated with the member. + * + * @return the certificate value. + */ + @Generated + public String getCertificate() { + return this.certificate; + } + + /** + * Get the id property: Identifier assigned to the member. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("certificate", this.certificate); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConsortiumMember from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConsortiumMember if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConsortiumMember. + */ + @Generated + public static ConsortiumMember fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String certificate = null; + String id = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("certificate".equals(fieldName)) { + certificate = reader.getString(); + } else if ("id".equals(fieldName)) { + id = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new ConsortiumMember(certificate, id); + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/Constitution.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/Constitution.java new file mode 100644 index 000000000000..55ab48fda206 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/Constitution.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The governance script for the application. + */ +@Immutable +public final class Constitution implements JsonSerializable { + /* + * SHA256 digest of the constitution script. + */ + @Generated + private final String digest; + + /* + * Contents of the constitution. + */ + @Generated + private final String script; + + /** + * Creates an instance of Constitution class. + * + * @param digest the digest value to set. + * @param script the script value to set. + */ + @Generated + private Constitution(String digest, String script) { + this.digest = digest; + this.script = script; + } + + /** + * Get the digest property: SHA256 digest of the constitution script. + * + * @return the digest value. + */ + @Generated + public String getDigest() { + return this.digest; + } + + /** + * Get the script property: Contents of the constitution. + * + * @return the script value. + */ + @Generated + public String getScript() { + return this.script; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("digest", this.digest); + jsonWriter.writeStringField("script", this.script); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Constitution from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Constitution if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Constitution. + */ + @Generated + public static Constitution fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String digest = null; + String script = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("digest".equals(fieldName)) { + digest = reader.getString(); + } else if ("script".equals(fieldName)) { + script = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new Constitution(digest, script); + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/EnclaveQuote.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/EnclaveQuote.java new file mode 100644 index 000000000000..7f3918452620 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/EnclaveQuote.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Contains the enclave quote. + */ +@Immutable +public final class EnclaveQuote implements JsonSerializable { + /* + * ID assigned to this node. + */ + @Generated + private final String nodeId; + + /* + * MRENCLAVE value of the code running in the enclave. + */ + @Generated + private String mrenclave; + + /* + * Version of the quote presented. + */ + @Generated + private final String quoteVersion; + + /* + * Raw SGX quote, parsable by tools like Open Enclave's oeverify. + */ + @Generated + private final String raw; + + /** + * Creates an instance of EnclaveQuote class. + * + * @param nodeId the nodeId value to set. + * @param quoteVersion the quoteVersion value to set. + * @param raw the raw value to set. + */ + @Generated + private EnclaveQuote(String nodeId, String quoteVersion, String raw) { + this.nodeId = nodeId; + this.quoteVersion = quoteVersion; + this.raw = raw; + } + + /** + * Get the nodeId property: ID assigned to this node. + * + * @return the nodeId value. + */ + @Generated + public String getNodeId() { + return this.nodeId; + } + + /** + * Get the mrenclave property: MRENCLAVE value of the code running in the enclave. + * + * @return the mrenclave value. + */ + @Generated + public String getMrenclave() { + return this.mrenclave; + } + + /** + * Get the quoteVersion property: Version of the quote presented. + * + * @return the quoteVersion value. + */ + @Generated + public String getQuoteVersion() { + return this.quoteVersion; + } + + /** + * Get the raw property: Raw SGX quote, parsable by tools like Open Enclave's oeverify. + * + * @return the raw value. + */ + @Generated + public String getRaw() { + return this.raw; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nodeId", this.nodeId); + jsonWriter.writeStringField("quoteVersion", this.quoteVersion); + jsonWriter.writeStringField("raw", this.raw); + jsonWriter.writeStringField("mrenclave", this.mrenclave); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnclaveQuote from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnclaveQuote if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EnclaveQuote. + */ + @Generated + public static EnclaveQuote fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String nodeId = null; + String quoteVersion = null; + String raw = null; + String mrenclave = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nodeId".equals(fieldName)) { + nodeId = reader.getString(); + } else if ("quoteVersion".equals(fieldName)) { + quoteVersion = reader.getString(); + } else if ("raw".equals(fieldName)) { + raw = reader.getString(); + } else if ("mrenclave".equals(fieldName)) { + mrenclave = reader.getString(); + } else { + reader.skipChildren(); + } + } + EnclaveQuote deserializedEnclaveQuote = new EnclaveQuote(nodeId, quoteVersion, raw); + deserializedEnclaveQuote.mrenclave = mrenclave; + + return deserializedEnclaveQuote; + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/EndpointProperties.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/EndpointProperties.java new file mode 100644 index 000000000000..c6edcbdcb835 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/EndpointProperties.java @@ -0,0 +1,359 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Endpoint properties. + */ +@Fluent +public final class EndpointProperties implements JsonSerializable { + /* + * Authentication policies for the endpoint. + */ + @Generated + private final List> authnPolicies; + + /* + * Indicates whether request forwarding is required for this endpoint. + */ + @Generated + private final ForwardingRequired forwardingRequired; + + /* + * Policy for interpreter reuse. + */ + @Generated + private InterpreterReusePolicy interpreterReuse; + + /* + * The JavaScript function. + */ + @Generated + private String jsFunction; + + /* + * The JavaScript module. + */ + @Generated + private String jsModule; + + /* + * The operation mode for this endpoint. + */ + @Generated + private Mode mode; + + /* + * Anything + */ + @Generated + private Map openapi; + + /* + * Openapi hidden + */ + @Generated + private Boolean openapiHidden; + + /* + * Redirection strategy + */ + @Generated + private RedirectionStrategy redirectionStrategy; + + /** + * Creates an instance of EndpointProperties class. + * + * @param authnPolicies the authnPolicies value to set. + * @param forwardingRequired the forwardingRequired value to set. + */ + @Generated + public EndpointProperties(List> authnPolicies, ForwardingRequired forwardingRequired) { + this.authnPolicies = authnPolicies; + this.forwardingRequired = forwardingRequired; + } + + /** + * Get the authnPolicies property: Authentication policies for the endpoint. + * + * @return the authnPolicies value. + */ + @Generated + public List> getAuthnPolicies() { + return this.authnPolicies; + } + + /** + * Get the forwardingRequired property: Indicates whether request forwarding is required for this endpoint. + * + * @return the forwardingRequired value. + */ + @Generated + public ForwardingRequired getForwardingRequired() { + return this.forwardingRequired; + } + + /** + * Get the interpreterReuse property: Policy for interpreter reuse. + * + * @return the interpreterReuse value. + */ + @Generated + public InterpreterReusePolicy getInterpreterReuse() { + return this.interpreterReuse; + } + + /** + * Set the interpreterReuse property: Policy for interpreter reuse. + * + * @param interpreterReuse the interpreterReuse value to set. + * @return the EndpointProperties object itself. + */ + @Generated + public EndpointProperties setInterpreterReuse(InterpreterReusePolicy interpreterReuse) { + this.interpreterReuse = interpreterReuse; + return this; + } + + /** + * Get the jsFunction property: The JavaScript function. + * + * @return the jsFunction value. + */ + @Generated + public String getJsFunction() { + return this.jsFunction; + } + + /** + * Set the jsFunction property: The JavaScript function. + * + * @param jsFunction the jsFunction value to set. + * @return the EndpointProperties object itself. + */ + @Generated + public EndpointProperties setJsFunction(String jsFunction) { + this.jsFunction = jsFunction; + return this; + } + + /** + * Get the jsModule property: The JavaScript module. + * + * @return the jsModule value. + */ + @Generated + public String getJsModule() { + return this.jsModule; + } + + /** + * Set the jsModule property: The JavaScript module. + * + * @param jsModule the jsModule value to set. + * @return the EndpointProperties object itself. + */ + @Generated + public EndpointProperties setJsModule(String jsModule) { + this.jsModule = jsModule; + return this; + } + + /** + * Get the mode property: The operation mode for this endpoint. + * + * @return the mode value. + */ + @Generated + public Mode getMode() { + return this.mode; + } + + /** + * Set the mode property: The operation mode for this endpoint. + * + * @param mode the mode value to set. + * @return the EndpointProperties object itself. + */ + @Generated + public EndpointProperties setMode(Mode mode) { + this.mode = mode; + return this; + } + + /** + * Get the openapi property: Anything. + * + * @return the openapi value. + */ + @Generated + public Map getOpenapi() { + return this.openapi; + } + + /** + * Set the openapi property: Anything. + * + * @param openapi the openapi value to set. + * @return the EndpointProperties object itself. + */ + @Generated + public EndpointProperties setOpenapi(Map openapi) { + this.openapi = openapi; + return this; + } + + /** + * Get the openapiHidden property: Openapi hidden. + * + * @return the openapiHidden value. + */ + @Generated + public Boolean isOpenapiHidden() { + return this.openapiHidden; + } + + /** + * Set the openapiHidden property: Openapi hidden. + * + * @param openapiHidden the openapiHidden value to set. + * @return the EndpointProperties object itself. + */ + @Generated + public EndpointProperties setOpenapiHidden(Boolean openapiHidden) { + this.openapiHidden = openapiHidden; + return this; + } + + /** + * Get the redirectionStrategy property: Redirection strategy. + * + * @return the redirectionStrategy value. + */ + @Generated + public RedirectionStrategy getRedirectionStrategy() { + return this.redirectionStrategy; + } + + /** + * Set the redirectionStrategy property: Redirection strategy. + * + * @param redirectionStrategy the redirectionStrategy value to set. + * @return the EndpointProperties object itself. + */ + @Generated + public EndpointProperties setRedirectionStrategy(RedirectionStrategy redirectionStrategy) { + this.redirectionStrategy = redirectionStrategy; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("authn_policies", this.authnPolicies, + (writer, element) -> writer.writeMap(element, (writer1, element1) -> { + if (element1 == null) { + writer1.writeNull(); + } else { + element1.writeTo(writer1); + } + })); + jsonWriter.writeStringField("forwarding_required", + this.forwardingRequired == null ? null : this.forwardingRequired.toString()); + jsonWriter.writeJsonField("interpreter_reuse", this.interpreterReuse); + jsonWriter.writeStringField("js_function", this.jsFunction); + jsonWriter.writeStringField("js_module", this.jsModule); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeMapField("openapi", this.openapi, (writer, element) -> { + if (element == null) { + writer.writeNull(); + } else { + element.writeTo(writer); + } + }); + jsonWriter.writeBooleanField("openapi_hidden", this.openapiHidden); + jsonWriter.writeStringField("redirection_strategy", + this.redirectionStrategy == null ? null : this.redirectionStrategy.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EndpointProperties. + */ + @Generated + public static EndpointProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List> authnPolicies = null; + ForwardingRequired forwardingRequired = null; + InterpreterReusePolicy interpreterReuse = null; + String jsFunction = null; + String jsModule = null; + Mode mode = null; + Map openapi = null; + Boolean openapiHidden = null; + RedirectionStrategy redirectionStrategy = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authn_policies".equals(fieldName)) { + authnPolicies = reader.readArray(reader1 -> reader1.readMap(reader2 -> reader2 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())))); + } else if ("forwarding_required".equals(fieldName)) { + forwardingRequired = ForwardingRequired.fromString(reader.getString()); + } else if ("interpreter_reuse".equals(fieldName)) { + interpreterReuse = InterpreterReusePolicy.fromJson(reader); + } else if ("js_function".equals(fieldName)) { + jsFunction = reader.getString(); + } else if ("js_module".equals(fieldName)) { + jsModule = reader.getString(); + } else if ("mode".equals(fieldName)) { + mode = Mode.fromString(reader.getString()); + } else if ("openapi".equals(fieldName)) { + openapi = reader.readMap(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); + } else if ("openapi_hidden".equals(fieldName)) { + openapiHidden = reader.getNullable(JsonReader::getBoolean); + } else if ("redirection_strategy".equals(fieldName)) { + redirectionStrategy = RedirectionStrategy.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + EndpointProperties deserializedEndpointProperties + = new EndpointProperties(authnPolicies, forwardingRequired); + deserializedEndpointProperties.interpreterReuse = interpreterReuse; + deserializedEndpointProperties.jsFunction = jsFunction; + deserializedEndpointProperties.jsModule = jsModule; + deserializedEndpointProperties.mode = mode; + deserializedEndpointProperties.openapi = openapi; + deserializedEndpointProperties.openapiHidden = openapiHidden; + deserializedEndpointProperties.redirectionStrategy = redirectionStrategy; + + return deserializedEndpointProperties; + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ForwardingRequired.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ForwardingRequired.java new file mode 100644 index 000000000000..b2f118c71794 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ForwardingRequired.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates whether request forwarding is required for this operation. + */ +public final class ForwardingRequired extends ExpandableStringEnum { + /** + * Forwarding is required sometimes. + */ + @Generated + public static final ForwardingRequired SOMETIMES = fromString("sometimes"); + + /** + * Forwarding is always required. + */ + @Generated + public static final ForwardingRequired ALWAYS = fromString("always"); + + /** + * Forwarding is never required. + */ + @Generated + public static final ForwardingRequired NEVER = fromString("never"); + + /** + * Creates a new instance of ForwardingRequired value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ForwardingRequired() { + } + + /** + * Creates or finds a ForwardingRequired from its string representation. + * + * @param name a name to look for. + * @return the corresponding ForwardingRequired. + */ + @Generated + public static ForwardingRequired fromString(String name) { + return fromString(name, ForwardingRequired.class); + } + + /** + * Gets known ForwardingRequired values. + * + * @return known ForwardingRequired values. + */ + @Generated + public static Collection values() { + return values(ForwardingRequired.class); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/InterpreterReusePolicy.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/InterpreterReusePolicy.java new file mode 100644 index 000000000000..ccb47dce1d86 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/InterpreterReusePolicy.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Policy for interpreter reuse. + */ +@Immutable +public final class InterpreterReusePolicy implements JsonSerializable { + /* + * Key for the interpreter reuse policy. + */ + @Generated + private final String key; + + /** + * Creates an instance of InterpreterReusePolicy class. + * + * @param key the key value to set. + */ + @Generated + public InterpreterReusePolicy(String key) { + this.key = key; + } + + /** + * Get the key property: Key for the interpreter reuse policy. + * + * @return the key value. + */ + @Generated + public String getKey() { + return this.key; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InterpreterReusePolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InterpreterReusePolicy if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the InterpreterReusePolicy. + */ + @Generated + public static InterpreterReusePolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String key = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + key = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new InterpreterReusePolicy(key); + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/JsRuntimeOptions.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/JsRuntimeOptions.java new file mode 100644 index 000000000000..e71fe9bb87d3 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/JsRuntimeOptions.java @@ -0,0 +1,338 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.security.confidentialledger.implementation.JsonMergePatchHelper; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * JS runtime options for user defined endpoints and functions. + */ +@Fluent +public final class JsRuntimeOptions implements JsonSerializable { + /* + * Whether to log exception details in the runtime. + */ + @Generated + private Boolean logExceptionDetails; + + /* + * Maximum number of cached interpreters. + */ + @Generated + private Long maxCachedInterpreters; + + /* + * Maximum execution time in milliseconds. + */ + @Generated + private Long maxExecutionTimeMs; + + /* + * Maximum heap size in bytes. + */ + @Generated + private Long maxHeapBytes; + + /* + * Maximum stack size in bytes. + */ + @Generated + private Long maxStackBytes; + + /* + * Whether to return exception details in the response. + */ + @Generated + private Boolean returnExceptionDetails; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setJsRuntimeOptionsAccessor(new JsonMergePatchHelper.JsRuntimeOptionsAccessor() { + @Override + public JsRuntimeOptions prepareModelForJsonMergePatch(JsRuntimeOptions model, + boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(JsRuntimeOptions model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of JsRuntimeOptions class. + */ + @Generated + public JsRuntimeOptions() { + } + + /** + * Get the logExceptionDetails property: Whether to log exception details in the runtime. + * + * @return the logExceptionDetails value. + */ + @Generated + public Boolean isLogExceptionDetails() { + return this.logExceptionDetails; + } + + /** + * Set the logExceptionDetails property: Whether to log exception details in the runtime. + * + * @param logExceptionDetails the logExceptionDetails value to set. + * @return the JsRuntimeOptions object itself. + */ + @Generated + public JsRuntimeOptions setLogExceptionDetails(Boolean logExceptionDetails) { + this.logExceptionDetails = logExceptionDetails; + this.updatedProperties.add("logExceptionDetails"); + return this; + } + + /** + * Get the maxCachedInterpreters property: Maximum number of cached interpreters. + * + * @return the maxCachedInterpreters value. + */ + @Generated + public Long getMaxCachedInterpreters() { + return this.maxCachedInterpreters; + } + + /** + * Set the maxCachedInterpreters property: Maximum number of cached interpreters. + * + * @param maxCachedInterpreters the maxCachedInterpreters value to set. + * @return the JsRuntimeOptions object itself. + */ + @Generated + public JsRuntimeOptions setMaxCachedInterpreters(Long maxCachedInterpreters) { + this.maxCachedInterpreters = maxCachedInterpreters; + this.updatedProperties.add("maxCachedInterpreters"); + return this; + } + + /** + * Get the maxExecutionTimeMs property: Maximum execution time in milliseconds. + * + * @return the maxExecutionTimeMs value. + */ + @Generated + public Long getMaxExecutionTimeMs() { + return this.maxExecutionTimeMs; + } + + /** + * Set the maxExecutionTimeMs property: Maximum execution time in milliseconds. + * + * @param maxExecutionTimeMs the maxExecutionTimeMs value to set. + * @return the JsRuntimeOptions object itself. + */ + @Generated + public JsRuntimeOptions setMaxExecutionTimeMs(Long maxExecutionTimeMs) { + this.maxExecutionTimeMs = maxExecutionTimeMs; + this.updatedProperties.add("maxExecutionTimeMs"); + return this; + } + + /** + * Get the maxHeapBytes property: Maximum heap size in bytes. + * + * @return the maxHeapBytes value. + */ + @Generated + public Long getMaxHeapBytes() { + return this.maxHeapBytes; + } + + /** + * Set the maxHeapBytes property: Maximum heap size in bytes. + * + * @param maxHeapBytes the maxHeapBytes value to set. + * @return the JsRuntimeOptions object itself. + */ + @Generated + public JsRuntimeOptions setMaxHeapBytes(Long maxHeapBytes) { + this.maxHeapBytes = maxHeapBytes; + this.updatedProperties.add("maxHeapBytes"); + return this; + } + + /** + * Get the maxStackBytes property: Maximum stack size in bytes. + * + * @return the maxStackBytes value. + */ + @Generated + public Long getMaxStackBytes() { + return this.maxStackBytes; + } + + /** + * Set the maxStackBytes property: Maximum stack size in bytes. + * + * @param maxStackBytes the maxStackBytes value to set. + * @return the JsRuntimeOptions object itself. + */ + @Generated + public JsRuntimeOptions setMaxStackBytes(Long maxStackBytes) { + this.maxStackBytes = maxStackBytes; + this.updatedProperties.add("maxStackBytes"); + return this; + } + + /** + * Get the returnExceptionDetails property: Whether to return exception details in the response. + * + * @return the returnExceptionDetails value. + */ + @Generated + public Boolean isReturnExceptionDetails() { + return this.returnExceptionDetails; + } + + /** + * Set the returnExceptionDetails property: Whether to return exception details in the response. + * + * @param returnExceptionDetails the returnExceptionDetails value to set. + * @return the JsRuntimeOptions object itself. + */ + @Generated + public JsRuntimeOptions setReturnExceptionDetails(Boolean returnExceptionDetails) { + this.returnExceptionDetails = returnExceptionDetails; + this.updatedProperties.add("returnExceptionDetails"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("log_exception_details", this.logExceptionDetails); + jsonWriter.writeNumberField("max_cached_interpreters", this.maxCachedInterpreters); + jsonWriter.writeNumberField("max_execution_time_ms", this.maxExecutionTimeMs); + jsonWriter.writeNumberField("max_heap_bytes", this.maxHeapBytes); + jsonWriter.writeNumberField("max_stack_bytes", this.maxStackBytes); + jsonWriter.writeBooleanField("return_exception_details", this.returnExceptionDetails); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("logExceptionDetails")) { + if (this.logExceptionDetails == null) { + jsonWriter.writeNullField("log_exception_details"); + } else { + jsonWriter.writeBooleanField("log_exception_details", this.logExceptionDetails); + } + } + if (updatedProperties.contains("maxCachedInterpreters")) { + if (this.maxCachedInterpreters == null) { + jsonWriter.writeNullField("max_cached_interpreters"); + } else { + jsonWriter.writeNumberField("max_cached_interpreters", this.maxCachedInterpreters); + } + } + if (updatedProperties.contains("maxExecutionTimeMs")) { + if (this.maxExecutionTimeMs == null) { + jsonWriter.writeNullField("max_execution_time_ms"); + } else { + jsonWriter.writeNumberField("max_execution_time_ms", this.maxExecutionTimeMs); + } + } + if (updatedProperties.contains("maxHeapBytes")) { + if (this.maxHeapBytes == null) { + jsonWriter.writeNullField("max_heap_bytes"); + } else { + jsonWriter.writeNumberField("max_heap_bytes", this.maxHeapBytes); + } + } + if (updatedProperties.contains("maxStackBytes")) { + if (this.maxStackBytes == null) { + jsonWriter.writeNullField("max_stack_bytes"); + } else { + jsonWriter.writeNumberField("max_stack_bytes", this.maxStackBytes); + } + } + if (updatedProperties.contains("returnExceptionDetails")) { + if (this.returnExceptionDetails == null) { + jsonWriter.writeNullField("return_exception_details"); + } else { + jsonWriter.writeBooleanField("return_exception_details", this.returnExceptionDetails); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JsRuntimeOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JsRuntimeOptions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the JsRuntimeOptions. + */ + @Generated + public static JsRuntimeOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JsRuntimeOptions deserializedJsRuntimeOptions = new JsRuntimeOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("log_exception_details".equals(fieldName)) { + deserializedJsRuntimeOptions.logExceptionDetails = reader.getNullable(JsonReader::getBoolean); + } else if ("max_cached_interpreters".equals(fieldName)) { + deserializedJsRuntimeOptions.maxCachedInterpreters = reader.getNullable(JsonReader::getLong); + } else if ("max_execution_time_ms".equals(fieldName)) { + deserializedJsRuntimeOptions.maxExecutionTimeMs = reader.getNullable(JsonReader::getLong); + } else if ("max_heap_bytes".equals(fieldName)) { + deserializedJsRuntimeOptions.maxHeapBytes = reader.getNullable(JsonReader::getLong); + } else if ("max_stack_bytes".equals(fieldName)) { + deserializedJsRuntimeOptions.maxStackBytes = reader.getNullable(JsonReader::getLong); + } else if ("return_exception_details".equals(fieldName)) { + deserializedJsRuntimeOptions.returnExceptionDetails = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedJsRuntimeOptions; + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/LedgerEntry.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/LedgerEntry.java new file mode 100644 index 000000000000..03e3f92200af --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/LedgerEntry.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * An entry in the ledger. + */ +@Fluent +public final class LedgerEntry implements JsonSerializable { + /* + * Contents of the ledger entry. + */ + @Generated + private final String contents; + + /* + * The collection identifier for this ledger entry. + */ + @Generated + private String collectionId; + + /* + * A unique identifier for the state of the ledger. If returned as part of a + * LedgerEntry, it indicates the state from which the entry was read. + */ + @Generated + private String transactionId; + + /* + * List of user defined function hooks to be executed before the ledger entry is + * written. + */ + @Generated + private List preHooks; + + /* + * List of user defined function hooks to be executed after the ledger entry is + * written. + */ + @Generated + private List postHooks; + + /** + * Creates an instance of LedgerEntry class. + * + * @param contents the contents value to set. + */ + @Generated + public LedgerEntry(String contents) { + this.contents = contents; + } + + /** + * Get the contents property: Contents of the ledger entry. + * + * @return the contents value. + */ + @Generated + public String getContents() { + return this.contents; + } + + /** + * Get the collectionId property: The collection identifier for this ledger entry. + * + * @return the collectionId value. + */ + @Generated + public String getCollectionId() { + return this.collectionId; + } + + /** + * Get the transactionId property: A unique identifier for the state of the ledger. If returned as part of a + * LedgerEntry, it indicates the state from which the entry was read. + * + * @return the transactionId value. + */ + @Generated + public String getTransactionId() { + return this.transactionId; + } + + /** + * Get the preHooks property: List of user defined function hooks to be executed before the ledger entry is + * written. + * + * @return the preHooks value. + */ + @Generated + public List getPreHooks() { + return this.preHooks; + } + + /** + * Set the preHooks property: List of user defined function hooks to be executed before the ledger entry is + * written. + * + * @param preHooks the preHooks value to set. + * @return the LedgerEntry object itself. + */ + @Generated + public LedgerEntry setPreHooks(List preHooks) { + this.preHooks = preHooks; + return this; + } + + /** + * Get the postHooks property: List of user defined function hooks to be executed after the ledger entry is + * written. + * + * @return the postHooks value. + */ + @Generated + public List getPostHooks() { + return this.postHooks; + } + + /** + * Set the postHooks property: List of user defined function hooks to be executed after the ledger entry is + * written. + * + * @param postHooks the postHooks value to set. + * @return the LedgerEntry object itself. + */ + @Generated + public LedgerEntry setPostHooks(List postHooks) { + this.postHooks = postHooks; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("contents", this.contents); + jsonWriter.writeArrayField("preHooks", this.preHooks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("postHooks", this.postHooks, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LedgerEntry from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LedgerEntry if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LedgerEntry. + */ + @Generated + public static LedgerEntry fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String contents = null; + String collectionId = null; + String transactionId = null; + List preHooks = null; + List postHooks = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("contents".equals(fieldName)) { + contents = reader.getString(); + } else if ("collectionId".equals(fieldName)) { + collectionId = reader.getString(); + } else if ("transactionId".equals(fieldName)) { + transactionId = reader.getString(); + } else if ("preHooks".equals(fieldName)) { + preHooks = reader.readArray(reader1 -> UserDefinedFunctionHook.fromJson(reader1)); + } else if ("postHooks".equals(fieldName)) { + postHooks = reader.readArray(reader1 -> UserDefinedFunctionHook.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + LedgerEntry deserializedLedgerEntry = new LedgerEntry(contents); + deserializedLedgerEntry.collectionId = collectionId; + deserializedLedgerEntry.transactionId = transactionId; + deserializedLedgerEntry.preHooks = preHooks; + deserializedLedgerEntry.postHooks = postHooks; + + return deserializedLedgerEntry; + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/LedgerEntryClaim.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/LedgerEntryClaim.java new file mode 100644 index 000000000000..c45cebddd44c --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/LedgerEntryClaim.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An application claim derived from ledger entry data. + */ +@Immutable +public final class LedgerEntryClaim implements JsonSerializable { + /* + * Identifier of a collection. + */ + @Generated + private String collectionId; + + /* + * Contents of a ledger entry. + */ + @Generated + private String contents; + + /* + * Base64-encoded secret key. + */ + @Generated + private String secretKey; + + /* + * Represents the protocol to be used to compute the digest of a claim from the + * given claim data. + */ + @Generated + private final ApplicationClaimProtocol protocol; + + /** + * Creates an instance of LedgerEntryClaim class. + * + * @param protocol the protocol value to set. + */ + @Generated + private LedgerEntryClaim(ApplicationClaimProtocol protocol) { + this.protocol = protocol; + } + + /** + * Get the collectionId property: Identifier of a collection. + * + * @return the collectionId value. + */ + @Generated + public String getCollectionId() { + return this.collectionId; + } + + /** + * Get the contents property: Contents of a ledger entry. + * + * @return the contents value. + */ + @Generated + public String getContents() { + return this.contents; + } + + /** + * Get the secretKey property: Base64-encoded secret key. + * + * @return the secretKey value. + */ + @Generated + public String getSecretKey() { + return this.secretKey; + } + + /** + * Get the protocol property: Represents the protocol to be used to compute the digest of a claim from the + * given claim data. + * + * @return the protocol value. + */ + @Generated + public ApplicationClaimProtocol getProtocol() { + return this.protocol; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeStringField("collectionId", this.collectionId); + jsonWriter.writeStringField("contents", this.contents); + jsonWriter.writeStringField("secretKey", this.secretKey); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LedgerEntryClaim from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LedgerEntryClaim if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LedgerEntryClaim. + */ + @Generated + public static LedgerEntryClaim fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationClaimProtocol protocol = null; + String collectionId = null; + String contents = null; + String secretKey = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protocol".equals(fieldName)) { + protocol = ApplicationClaimProtocol.fromString(reader.getString()); + } else if ("collectionId".equals(fieldName)) { + collectionId = reader.getString(); + } else if ("contents".equals(fieldName)) { + contents = reader.getString(); + } else if ("secretKey".equals(fieldName)) { + secretKey = reader.getString(); + } else { + reader.skipChildren(); + } + } + LedgerEntryClaim deserializedLedgerEntryClaim = new LedgerEntryClaim(protocol); + deserializedLedgerEntryClaim.collectionId = collectionId; + deserializedLedgerEntryClaim.contents = contents; + deserializedLedgerEntryClaim.secretKey = secretKey; + + return deserializedLedgerEntryClaim; + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/LedgerQueryResult.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/LedgerQueryResult.java new file mode 100644 index 000000000000..84ad85d72b3d --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/LedgerQueryResult.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The result of querying for a ledger entry from an older transaction id. The + * ledger entry is available in the response only if the returned state is Ready. + */ +@Immutable +public final class LedgerQueryResult implements JsonSerializable { + /* + * State of a ledger query. + */ + @Generated + private final ConfidentialLedgerQueryState state; + + /* + * The ledger entry found as a result of the query. This is only available if the + * query is in Ready state. + */ + @Generated + private LedgerEntry entry; + + /** + * Creates an instance of LedgerQueryResult class. + * + * @param state the state value to set. + */ + @Generated + private LedgerQueryResult(ConfidentialLedgerQueryState state) { + this.state = state; + } + + /** + * Get the state property: State of a ledger query. + * + * @return the state value. + */ + @Generated + public ConfidentialLedgerQueryState getState() { + return this.state; + } + + /** + * Get the entry property: The ledger entry found as a result of the query. This is only available if the + * query is in Ready state. + * + * @return the entry value. + */ + @Generated + public LedgerEntry getEntry() { + return this.entry; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeJsonField("entry", this.entry); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LedgerQueryResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LedgerQueryResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LedgerQueryResult. + */ + @Generated + public static LedgerQueryResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfidentialLedgerQueryState state = null; + LedgerEntry entry = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + state = ConfidentialLedgerQueryState.fromString(reader.getString()); + } else if ("entry".equals(fieldName)) { + entry = LedgerEntry.fromJson(reader); + } else { + reader.skipChildren(); + } + } + LedgerQueryResult deserializedLedgerQueryResult = new LedgerQueryResult(state); + deserializedLedgerQueryResult.entry = entry; + + return deserializedLedgerQueryResult; + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/LedgerUser.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/LedgerUser.java new file mode 100644 index 000000000000..cacfbb68ab01 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/LedgerUser.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.security.confidentialledger.implementation.JsonMergePatchHelper; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * Details about a Confidential Ledger user. + */ +@Fluent +public final class LedgerUser implements JsonSerializable { + /* + * Represents an assignable role. + */ + @Generated + private ConfidentialLedgerUserRoleName assignedRole; + + /* + * Identifier for the user. This must either be an AAD object id or a certificate + * fingerprint. + */ + @Generated + private String userId; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setLedgerUserAccessor(new JsonMergePatchHelper.LedgerUserAccessor() { + @Override + public LedgerUser prepareModelForJsonMergePatch(LedgerUser model, boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(LedgerUser model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of LedgerUser class. + */ + @Generated + public LedgerUser() { + } + + /** + * Get the assignedRole property: Represents an assignable role. + * + * @return the assignedRole value. + */ + @Generated + public ConfidentialLedgerUserRoleName getAssignedRole() { + return this.assignedRole; + } + + /** + * Set the assignedRole property: Represents an assignable role. + *

Required when create the resource.

+ * + * @param assignedRole the assignedRole value to set. + * @return the LedgerUser object itself. + */ + @Generated + public LedgerUser setAssignedRole(ConfidentialLedgerUserRoleName assignedRole) { + this.assignedRole = assignedRole; + this.updatedProperties.add("assignedRole"); + return this; + } + + /** + * Get the userId property: Identifier for the user. This must either be an AAD object id or a certificate + * fingerprint. + * + * @return the userId value. + */ + @Generated + public String getUserId() { + return this.userId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("assignedRole", + this.assignedRole == null ? null : this.assignedRole.toString()); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("assignedRole")) { + if (this.assignedRole == null) { + jsonWriter.writeNullField("assignedRole"); + } else { + jsonWriter.writeStringField("assignedRole", this.assignedRole.toString()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LedgerUser from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LedgerUser if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the LedgerUser. + */ + @Generated + public static LedgerUser fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LedgerUser deserializedLedgerUser = new LedgerUser(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("assignedRole".equals(fieldName)) { + deserializedLedgerUser.assignedRole = ConfidentialLedgerUserRoleName.fromString(reader.getString()); + } else if ("userId".equals(fieldName)) { + deserializedLedgerUser.userId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLedgerUser; + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/LedgerUserMultipleRoles.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/LedgerUserMultipleRoles.java new file mode 100644 index 000000000000..d13b48ff5b6a --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/LedgerUserMultipleRoles.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.security.confidentialledger.implementation.JsonMergePatchHelper; +import java.io.IOException; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * Details about a Confidential Ledger user. + */ +@Fluent +public final class LedgerUserMultipleRoles implements JsonSerializable { + /* + * Represents an assignable role. + */ + @Generated + private List assignedRoles; + + /* + * Identifier for the user. This must either be an AAD object id or a certificate + * fingerprint. + */ + @Generated + private String userId; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper + .setLedgerUserMultipleRolesAccessor(new JsonMergePatchHelper.LedgerUserMultipleRolesAccessor() { + @Override + public LedgerUserMultipleRoles prepareModelForJsonMergePatch(LedgerUserMultipleRoles model, + boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(LedgerUserMultipleRoles model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of LedgerUserMultipleRoles class. + */ + @Generated + public LedgerUserMultipleRoles() { + } + + /** + * Get the assignedRoles property: Represents an assignable role. + * + * @return the assignedRoles value. + */ + @Generated + public List getAssignedRoles() { + return this.assignedRoles; + } + + /** + * Set the assignedRoles property: Represents an assignable role. + *

Required when create the resource.

+ * + * @param assignedRoles the assignedRoles value to set. + * @return the LedgerUserMultipleRoles object itself. + */ + @Generated + public LedgerUserMultipleRoles setAssignedRoles(List assignedRoles) { + this.assignedRoles = assignedRoles; + this.updatedProperties.add("assignedRoles"); + return this; + } + + /** + * Get the userId property: Identifier for the user. This must either be an AAD object id or a certificate + * fingerprint. + * + * @return the userId value. + */ + @Generated + public String getUserId() { + return this.userId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("assignedRoles", this.assignedRoles, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("assignedRoles")) { + if (this.assignedRoles == null) { + jsonWriter.writeNullField("assignedRoles"); + } else { + jsonWriter.writeArrayField("assignedRoles", this.assignedRoles, + (writer, element) -> writer.writeString(element.toString())); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LedgerUserMultipleRoles from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LedgerUserMultipleRoles if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the LedgerUserMultipleRoles. + */ + @Generated + public static LedgerUserMultipleRoles fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LedgerUserMultipleRoles deserializedLedgerUserMultipleRoles = new LedgerUserMultipleRoles(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("assignedRoles".equals(fieldName)) { + List assignedRoles + = reader.readArray(reader1 -> ConfidentialLedgerUserRoleName.fromString(reader1.getString())); + deserializedLedgerUserMultipleRoles.assignedRoles = assignedRoles; + } else if ("userId".equals(fieldName)) { + deserializedLedgerUserMultipleRoles.userId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLedgerUserMultipleRoles; + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/LedgerWriteResult.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/LedgerWriteResult.java new file mode 100644 index 000000000000..ea7161895838 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/LedgerWriteResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Returned as a result of a write to the Confidential Ledger, the transaction id + * in the response indicates when the write will become durable. + */ +@Immutable +public final class LedgerWriteResult implements JsonSerializable { + /* + * The collection identifier of the ledger entry. + */ + @Generated + private final String collectionId; + + /** + * Creates an instance of LedgerWriteResult class. + * + * @param collectionId the collectionId value to set. + */ + @Generated + private LedgerWriteResult(String collectionId) { + this.collectionId = collectionId; + } + + /** + * Get the collectionId property: The collection identifier of the ledger entry. + * + * @return the collectionId value. + */ + @Generated + public String getCollectionId() { + return this.collectionId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("collectionId", this.collectionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LedgerWriteResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LedgerWriteResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LedgerWriteResult. + */ + @Generated + public static LedgerWriteResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String collectionId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("collectionId".equals(fieldName)) { + collectionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new LedgerWriteResult(collectionId); + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/Metadata.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/Metadata.java new file mode 100644 index 000000000000..9843560e7369 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/Metadata.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Metadata for endpoints. + */ +@Immutable +public final class Metadata implements JsonSerializable { + /* + * A map of path to method endpoints for the path + */ + @Generated + private final Map endpoints; + + /** + * Creates an instance of Metadata class. + * + * @param endpoints the endpoints value to set. + */ + @Generated + public Metadata(Map endpoints) { + this.endpoints = endpoints; + } + + /** + * Get the endpoints property: A map of path to method endpoints for the path. + * + * @return the endpoints value. + */ + @Generated + public Map getEndpoints() { + return this.endpoints; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("endpoints", this.endpoints, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Metadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Metadata if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Metadata. + */ + @Generated + public static Metadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Map endpoints = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endpoints".equals(fieldName)) { + endpoints = reader.readMap(reader1 -> MethodToEndpointProperties.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new Metadata(endpoints); + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/MethodToEndpointProperties.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/MethodToEndpointProperties.java new file mode 100644 index 000000000000..f5248f080e36 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/MethodToEndpointProperties.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Maps methods to their corresponding endpoint properties. + */ +@Fluent +public final class MethodToEndpointProperties implements JsonSerializable { + /* + * Properties for GET method endpoint. + */ + @Generated + private EndpointProperties get; + + /* + * Properties for PUT method endpoint. + */ + @Generated + private EndpointProperties put; + + /* + * Properties for PATCH method endpoint. + */ + @Generated + private EndpointProperties patch; + + /* + * Properties for DELETE method endpoint. + */ + @Generated + private EndpointProperties delete; + + /** + * Creates an instance of MethodToEndpointProperties class. + */ + @Generated + public MethodToEndpointProperties() { + } + + /** + * Get the get property: Properties for GET method endpoint. + * + * @return the get value. + */ + @Generated + public EndpointProperties getGet() { + return this.get; + } + + /** + * Set the get property: Properties for GET method endpoint. + * + * @param get the get value to set. + * @return the MethodToEndpointProperties object itself. + */ + @Generated + public MethodToEndpointProperties setGet(EndpointProperties get) { + this.get = get; + return this; + } + + /** + * Get the put property: Properties for PUT method endpoint. + * + * @return the put value. + */ + @Generated + public EndpointProperties getPut() { + return this.put; + } + + /** + * Set the put property: Properties for PUT method endpoint. + * + * @param put the put value to set. + * @return the MethodToEndpointProperties object itself. + */ + @Generated + public MethodToEndpointProperties setPut(EndpointProperties put) { + this.put = put; + return this; + } + + /** + * Get the patch property: Properties for PATCH method endpoint. + * + * @return the patch value. + */ + @Generated + public EndpointProperties getPatch() { + return this.patch; + } + + /** + * Set the patch property: Properties for PATCH method endpoint. + * + * @param patch the patch value to set. + * @return the MethodToEndpointProperties object itself. + */ + @Generated + public MethodToEndpointProperties setPatch(EndpointProperties patch) { + this.patch = patch; + return this; + } + + /** + * Get the delete property: Properties for DELETE method endpoint. + * + * @return the delete value. + */ + @Generated + public EndpointProperties getDelete() { + return this.delete; + } + + /** + * Set the delete property: Properties for DELETE method endpoint. + * + * @param delete the delete value to set. + * @return the MethodToEndpointProperties object itself. + */ + @Generated + public MethodToEndpointProperties setDelete(EndpointProperties delete) { + this.delete = delete; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("get", this.get); + jsonWriter.writeJsonField("put", this.put); + jsonWriter.writeJsonField("patch", this.patch); + jsonWriter.writeJsonField("delete", this.delete); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MethodToEndpointProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MethodToEndpointProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MethodToEndpointProperties. + */ + @Generated + public static MethodToEndpointProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MethodToEndpointProperties deserializedMethodToEndpointProperties = new MethodToEndpointProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("get".equals(fieldName)) { + deserializedMethodToEndpointProperties.get = EndpointProperties.fromJson(reader); + } else if ("put".equals(fieldName)) { + deserializedMethodToEndpointProperties.put = EndpointProperties.fromJson(reader); + } else if ("patch".equals(fieldName)) { + deserializedMethodToEndpointProperties.patch = EndpointProperties.fromJson(reader); + } else if ("delete".equals(fieldName)) { + deserializedMethodToEndpointProperties.delete = EndpointProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMethodToEndpointProperties; + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/Mode.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/Mode.java new file mode 100644 index 000000000000..6d6f8fe43766 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/Mode.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Represents the operation mode of the endpoint. + */ +public final class Mode extends ExpandableStringEnum { + /** + * Read-write mode. + */ + @Generated + public static final Mode READWRITE = fromString("readwrite"); + + /** + * Read-only mode. + */ + @Generated + public static final Mode READONLY = fromString("readonly"); + + /** + * Historical mode. + */ + @Generated + public static final Mode HISTORICAL = fromString("historical"); + + /** + * Creates a new instance of Mode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public Mode() { + } + + /** + * Creates or finds a Mode from its string representation. + * + * @param name a name to look for. + * @return the corresponding Mode. + */ + @Generated + public static Mode fromString(String name) { + return fromString(name, Mode.class); + } + + /** + * Gets known Mode values. + * + * @return known Mode values. + */ + @Generated + public static Collection values() { + return values(Mode.class); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ModuleDef.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ModuleDef.java new file mode 100644 index 000000000000..92b56f3de599 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ModuleDef.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Module definition. + */ +@Immutable +public final class ModuleDef implements JsonSerializable { + /* + * Module + */ + @Generated + private final String module; + + /* + * Name + */ + @Generated + private final String name; + + /** + * Creates an instance of ModuleDef class. + * + * @param module the module value to set. + * @param name the name value to set. + */ + @Generated + public ModuleDef(String module, String name) { + this.module = module; + this.name = name; + } + + /** + * Get the module property: Module. + * + * @return the module value. + */ + @Generated + public String getModule() { + return this.module; + } + + /** + * Get the name property: Name. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("module", this.module); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ModuleDef from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ModuleDef if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ModuleDef. + */ + @Generated + public static ModuleDef fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String module = null; + String name = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("module".equals(fieldName)) { + module = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new ModuleDef(module, name); + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ReceiptContents.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ReceiptContents.java new file mode 100644 index 000000000000..c0041f2d78ca --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ReceiptContents.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The contents of a receipt. + */ +@Immutable +public final class ReceiptContents implements JsonSerializable { + /* + * Certificate + */ + @Generated + private String cert; + + /* + * Leaf + */ + @Generated + private String leaf; + + /* + * Leaf components of the receipt + */ + @Generated + private ReceiptLeafComponents leafComponents; + + /* + * Node identifier + */ + @Generated + private final String nodeId; + + /* + * Proof + */ + @Generated + private final List proof; + + /* + * Root + */ + @Generated + private String root; + + /* + * Service endorsements + */ + @Generated + private List serviceEndorsements; + + /* + * The signature of the receipt + */ + @Generated + private final String signature; + + /** + * Creates an instance of ReceiptContents class. + * + * @param nodeId the nodeId value to set. + * @param proof the proof value to set. + * @param signature the signature value to set. + */ + @Generated + private ReceiptContents(String nodeId, List proof, String signature) { + this.nodeId = nodeId; + this.proof = proof; + this.signature = signature; + } + + /** + * Get the cert property: Certificate. + * + * @return the cert value. + */ + @Generated + public String getCert() { + return this.cert; + } + + /** + * Get the leaf property: Leaf. + * + * @return the leaf value. + */ + @Generated + public String getLeaf() { + return this.leaf; + } + + /** + * Get the leafComponents property: Leaf components of the receipt. + * + * @return the leafComponents value. + */ + @Generated + public ReceiptLeafComponents getLeafComponents() { + return this.leafComponents; + } + + /** + * Get the nodeId property: Node identifier. + * + * @return the nodeId value. + */ + @Generated + public String getNodeId() { + return this.nodeId; + } + + /** + * Get the proof property: Proof. + * + * @return the proof value. + */ + @Generated + public List getProof() { + return this.proof; + } + + /** + * Get the root property: Root. + * + * @return the root value. + */ + @Generated + public String getRoot() { + return this.root; + } + + /** + * Get the serviceEndorsements property: Service endorsements. + * + * @return the serviceEndorsements value. + */ + @Generated + public List getServiceEndorsements() { + return this.serviceEndorsements; + } + + /** + * Get the signature property: The signature of the receipt. + * + * @return the signature value. + */ + @Generated + public String getSignature() { + return this.signature; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nodeId", this.nodeId); + jsonWriter.writeArrayField("proof", this.proof, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("signature", this.signature); + jsonWriter.writeStringField("cert", this.cert); + jsonWriter.writeStringField("leaf", this.leaf); + jsonWriter.writeJsonField("leafComponents", this.leafComponents); + jsonWriter.writeStringField("root", this.root); + jsonWriter.writeArrayField("serviceEndorsements", this.serviceEndorsements, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReceiptContents from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReceiptContents if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ReceiptContents. + */ + @Generated + public static ReceiptContents fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String nodeId = null; + List proof = null; + String signature = null; + String cert = null; + String leaf = null; + ReceiptLeafComponents leafComponents = null; + String root = null; + List serviceEndorsements = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nodeId".equals(fieldName)) { + nodeId = reader.getString(); + } else if ("proof".equals(fieldName)) { + proof = reader.readArray(reader1 -> ReceiptElement.fromJson(reader1)); + } else if ("signature".equals(fieldName)) { + signature = reader.getString(); + } else if ("cert".equals(fieldName)) { + cert = reader.getString(); + } else if ("leaf".equals(fieldName)) { + leaf = reader.getString(); + } else if ("leafComponents".equals(fieldName)) { + leafComponents = ReceiptLeafComponents.fromJson(reader); + } else if ("root".equals(fieldName)) { + root = reader.getString(); + } else if ("serviceEndorsements".equals(fieldName)) { + serviceEndorsements = reader.readArray(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + ReceiptContents deserializedReceiptContents = new ReceiptContents(nodeId, proof, signature); + deserializedReceiptContents.cert = cert; + deserializedReceiptContents.leaf = leaf; + deserializedReceiptContents.leafComponents = leafComponents; + deserializedReceiptContents.root = root; + deserializedReceiptContents.serviceEndorsements = serviceEndorsements; + + return deserializedReceiptContents; + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ReceiptElement.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ReceiptElement.java new file mode 100644 index 000000000000..60511c88771a --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ReceiptElement.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Receipt element. + */ +@Immutable +public final class ReceiptElement implements JsonSerializable { + /* + * Left + */ + @Generated + private String left; + + /* + * Right + */ + @Generated + private String right; + + /** + * Creates an instance of ReceiptElement class. + */ + @Generated + private ReceiptElement() { + } + + /** + * Get the left property: Left. + * + * @return the left value. + */ + @Generated + public String getLeft() { + return this.left; + } + + /** + * Get the right property: Right. + * + * @return the right value. + */ + @Generated + public String getRight() { + return this.right; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("left", this.left); + jsonWriter.writeStringField("right", this.right); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReceiptElement from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReceiptElement if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ReceiptElement. + */ + @Generated + public static ReceiptElement fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReceiptElement deserializedReceiptElement = new ReceiptElement(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("left".equals(fieldName)) { + deserializedReceiptElement.left = reader.getString(); + } else if ("right".equals(fieldName)) { + deserializedReceiptElement.right = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedReceiptElement; + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ReceiptLeafComponents.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ReceiptLeafComponents.java new file mode 100644 index 000000000000..7637de0fc331 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/ReceiptLeafComponents.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Components that make up a receipt leaf node. + */ +@Immutable +public final class ReceiptLeafComponents implements JsonSerializable { + /* + * Claims digest + */ + @Generated + private String claimsDigest; + + /* + * Commit evidence + */ + @Generated + private String commitEvidence; + + /* + * Write set digest + */ + @Generated + private String writeSetDigest; + + /** + * Creates an instance of ReceiptLeafComponents class. + */ + @Generated + private ReceiptLeafComponents() { + } + + /** + * Get the claimsDigest property: Claims digest. + * + * @return the claimsDigest value. + */ + @Generated + public String getClaimsDigest() { + return this.claimsDigest; + } + + /** + * Get the commitEvidence property: Commit evidence. + * + * @return the commitEvidence value. + */ + @Generated + public String getCommitEvidence() { + return this.commitEvidence; + } + + /** + * Get the writeSetDigest property: Write set digest. + * + * @return the writeSetDigest value. + */ + @Generated + public String getWriteSetDigest() { + return this.writeSetDigest; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("claimsDigest", this.claimsDigest); + jsonWriter.writeStringField("commitEvidence", this.commitEvidence); + jsonWriter.writeStringField("writeSetDigest", this.writeSetDigest); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReceiptLeafComponents from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReceiptLeafComponents if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReceiptLeafComponents. + */ + @Generated + public static ReceiptLeafComponents fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReceiptLeafComponents deserializedReceiptLeafComponents = new ReceiptLeafComponents(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("claimsDigest".equals(fieldName)) { + deserializedReceiptLeafComponents.claimsDigest = reader.getString(); + } else if ("commitEvidence".equals(fieldName)) { + deserializedReceiptLeafComponents.commitEvidence = reader.getString(); + } else if ("writeSetDigest".equals(fieldName)) { + deserializedReceiptLeafComponents.writeSetDigest = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedReceiptLeafComponents; + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/RedirectionStrategy.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/RedirectionStrategy.java new file mode 100644 index 000000000000..bcc7ecf73453 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/RedirectionStrategy.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Represents the redirection strategy for the endpoint. + */ +public final class RedirectionStrategy extends ExpandableStringEnum { + /** + * No redirection strategy. + */ + @Generated + public static final RedirectionStrategy NONE = fromString("none"); + + /** + * Redirect to primary. + */ + @Generated + public static final RedirectionStrategy TO_PRIMARY = fromString("to_primary"); + + /** + * Redirect to backup. + */ + @Generated + public static final RedirectionStrategy TO_BACKUP = fromString("to_backup"); + + /** + * Creates a new instance of RedirectionStrategy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public RedirectionStrategy() { + } + + /** + * Creates or finds a RedirectionStrategy from its string representation. + * + * @param name a name to look for. + * @return the corresponding RedirectionStrategy. + */ + @Generated + public static RedirectionStrategy fromString(String name) { + return fromString(name, RedirectionStrategy.class); + } + + /** + * Gets known RedirectionStrategy values. + * + * @return known RedirectionStrategy values. + */ + @Generated + public static Collection values() { + return values(RedirectionStrategy.class); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/Role.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/Role.java new file mode 100644 index 000000000000..16bbb565beda --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/Role.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.security.confidentialledger.implementation.JsonMergePatchHelper; +import java.io.IOException; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * Definition for roles. + */ +@Fluent +public final class Role implements JsonSerializable { + /* + * name of the user defined role + */ + @Generated + private String roleName; + + /* + * role actions + */ + @Generated + private List roleActions; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setRoleAccessor(new JsonMergePatchHelper.RoleAccessor() { + @Override + public Role prepareModelForJsonMergePatch(Role model, boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(Role model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of Role class. + */ + @Generated + public Role() { + } + + /** + * Get the roleName property: name of the user defined role. + * + * @return the roleName value. + */ + @Generated + public String getRoleName() { + return this.roleName; + } + + /** + * Set the roleName property: name of the user defined role. + * + * @param roleName the roleName value to set. + * @return the Role object itself. + */ + @Generated + public Role setRoleName(String roleName) { + this.roleName = roleName; + this.updatedProperties.add("roleName"); + return this; + } + + /** + * Get the roleActions property: role actions. + * + * @return the roleActions value. + */ + @Generated + public List getRoleActions() { + return this.roleActions; + } + + /** + * Set the roleActions property: role actions. + * + * @param roleActions the roleActions value to set. + * @return the Role object itself. + */ + @Generated + public Role setRoleActions(List roleActions) { + this.roleActions = roleActions; + this.updatedProperties.add("roleActions"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("roleName", this.roleName); + jsonWriter.writeArrayField("roleActions", this.roleActions, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("roleName")) { + if (this.roleName == null) { + jsonWriter.writeNullField("roleName"); + } else { + jsonWriter.writeStringField("roleName", this.roleName); + } + } + if (updatedProperties.contains("roleActions")) { + if (this.roleActions == null) { + jsonWriter.writeNullField("roleActions"); + } else { + jsonWriter.writeArrayField("roleActions", this.roleActions, + (writer, element) -> writer.writeString(element)); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Role from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Role if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Role. + */ + @Generated + public static Role fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Role deserializedRole = new Role(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("roleName".equals(fieldName)) { + deserializedRole.roleName = reader.getString(); + } else if ("roleActions".equals(fieldName)) { + List roleActions = reader.readArray(reader1 -> reader1.getString()); + deserializedRole.roleActions = roleActions; + } else { + reader.skipChildren(); + } + } + + return deserializedRole; + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/TransactionReceipt.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/TransactionReceipt.java new file mode 100644 index 000000000000..3e59c0a2bb2e --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/TransactionReceipt.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A receipt certifying the transaction at the specified id. + */ +@Immutable +public final class TransactionReceipt implements JsonSerializable { + /* + * List of application claims. + */ + @Generated + private List applicationClaims; + + /* + * The receipt contents for the transaction. + */ + @Generated + private ReceiptContents receipt; + + /* + * State of a ledger query. + */ + @Generated + private final ConfidentialLedgerQueryState state; + + /* + * A unique identifier for the state of the ledger. If returned as part of a + * LedgerEntry, it indicates the state from which the entry was read. + */ + @Generated + private final String transactionId; + + /** + * Creates an instance of TransactionReceipt class. + * + * @param state the state value to set. + * @param transactionId the transactionId value to set. + */ + @Generated + private TransactionReceipt(ConfidentialLedgerQueryState state, String transactionId) { + this.state = state; + this.transactionId = transactionId; + } + + /** + * Get the applicationClaims property: List of application claims. + * + * @return the applicationClaims value. + */ + @Generated + public List getApplicationClaims() { + return this.applicationClaims; + } + + /** + * Get the receipt property: The receipt contents for the transaction. + * + * @return the receipt value. + */ + @Generated + public ReceiptContents getReceipt() { + return this.receipt; + } + + /** + * Get the state property: State of a ledger query. + * + * @return the state value. + */ + @Generated + public ConfidentialLedgerQueryState getState() { + return this.state; + } + + /** + * Get the transactionId property: A unique identifier for the state of the ledger. If returned as part of a + * LedgerEntry, it indicates the state from which the entry was read. + * + * @return the transactionId value. + */ + @Generated + public String getTransactionId() { + return this.transactionId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeStringField("transactionId", this.transactionId); + jsonWriter.writeArrayField("applicationClaims", this.applicationClaims, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("receipt", this.receipt); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TransactionReceipt from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TransactionReceipt if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TransactionReceipt. + */ + @Generated + public static TransactionReceipt fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfidentialLedgerQueryState state = null; + String transactionId = null; + List applicationClaims = null; + ReceiptContents receipt = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + state = ConfidentialLedgerQueryState.fromString(reader.getString()); + } else if ("transactionId".equals(fieldName)) { + transactionId = reader.getString(); + } else if ("applicationClaims".equals(fieldName)) { + applicationClaims = reader.readArray(reader1 -> ApplicationClaim.fromJson(reader1)); + } else if ("receipt".equals(fieldName)) { + receipt = ReceiptContents.fromJson(reader); + } else { + reader.skipChildren(); + } + } + TransactionReceipt deserializedTransactionReceipt = new TransactionReceipt(state, transactionId); + deserializedTransactionReceipt.applicationClaims = applicationClaims; + deserializedTransactionReceipt.receipt = receipt; + + return deserializedTransactionReceipt; + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/TransactionState.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/TransactionState.java new file mode 100644 index 000000000000..8972952e50b2 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/TransactionState.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Represents the state of the transaction. + */ +public final class TransactionState extends ExpandableStringEnum { + /** + * The transaction is committed. + */ + @Generated + public static final TransactionState COMMITTED = fromString("Committed"); + + /** + * The transaction is pending. + */ + @Generated + public static final TransactionState PENDING = fromString("Pending"); + + /** + * Creates a new instance of TransactionState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public TransactionState() { + } + + /** + * Creates or finds a TransactionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding TransactionState. + */ + @Generated + public static TransactionState fromString(String name) { + return fromString(name, TransactionState.class); + } + + /** + * Gets known TransactionState values. + * + * @return known TransactionState values. + */ + @Generated + public static Collection values() { + return values(TransactionState.class); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/TransactionStatus.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/TransactionStatus.java new file mode 100644 index 000000000000..98c80fa3ec90 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/TransactionStatus.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Response returned to a query for the transaction status. + */ +@Immutable +public final class TransactionStatus implements JsonSerializable { + /* + * Represents the state of the transaction. + */ + @Generated + private final TransactionState state; + + /* + * A unique identifier for the state of the ledger. If returned as part of a + * LedgerEntry, it indicates the state from which the entry was read. + */ + @Generated + private final String transactionId; + + /** + * Creates an instance of TransactionStatus class. + * + * @param state the state value to set. + * @param transactionId the transactionId value to set. + */ + @Generated + private TransactionStatus(TransactionState state, String transactionId) { + this.state = state; + this.transactionId = transactionId; + } + + /** + * Get the state property: Represents the state of the transaction. + * + * @return the state value. + */ + @Generated + public TransactionState getState() { + return this.state; + } + + /** + * Get the transactionId property: A unique identifier for the state of the ledger. If returned as part of a + * LedgerEntry, it indicates the state from which the entry was read. + * + * @return the transactionId value. + */ + @Generated + public String getTransactionId() { + return this.transactionId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeStringField("transactionId", this.transactionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TransactionStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TransactionStatus if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TransactionStatus. + */ + @Generated + public static TransactionStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TransactionState state = null; + String transactionId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + state = TransactionState.fromString(reader.getString()); + } else if ("transactionId".equals(fieldName)) { + transactionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new TransactionStatus(state, transactionId); + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunction.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunction.java new file mode 100644 index 000000000000..41c306d3830c --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunction.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A user defined function in the ledger. + */ +@Immutable +public final class UserDefinedFunction implements JsonSerializable { + /* + * Code of the user defined function in JavaScript. + */ + @Generated + private final String code; + + /* + * ID of the user defined function. + */ + @Generated + private String id; + + /** + * Creates an instance of UserDefinedFunction class. + * + * @param code the code value to set. + */ + @Generated + public UserDefinedFunction(String code) { + this.code = code; + } + + /** + * Get the code property: Code of the user defined function in JavaScript. + * + * @return the code value. + */ + @Generated + public String getCode() { + return this.code; + } + + /** + * Get the id property: ID of the user defined function. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserDefinedFunction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserDefinedFunction if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UserDefinedFunction. + */ + @Generated + public static UserDefinedFunction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String code = null; + String id = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + code = reader.getString(); + } else if ("id".equals(fieldName)) { + id = reader.getString(); + } else { + reader.skipChildren(); + } + } + UserDefinedFunction deserializedUserDefinedFunction = new UserDefinedFunction(code); + deserializedUserDefinedFunction.id = id; + + return deserializedUserDefinedFunction; + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionExecutionError.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionExecutionError.java new file mode 100644 index 000000000000..d17675f68c8c --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionExecutionError.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The error object of a user defined function execution. This is returned only + * when the user defined function execution throws an exception. + */ +@Immutable +public final class UserDefinedFunctionExecutionError implements JsonSerializable { + /* + * Message indicating the error thrown when executing the function. + */ + @Generated + private String message; + + /** + * Creates an instance of UserDefinedFunctionExecutionError class. + */ + @Generated + private UserDefinedFunctionExecutionError() { + } + + /** + * Get the message property: Message indicating the error thrown when executing the function. + * + * @return the message value. + */ + @Generated + public String getMessage() { + return this.message; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserDefinedFunctionExecutionError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserDefinedFunctionExecutionError if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserDefinedFunctionExecutionError. + */ + @Generated + public static UserDefinedFunctionExecutionError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserDefinedFunctionExecutionError deserializedUserDefinedFunctionExecutionError + = new UserDefinedFunctionExecutionError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("message".equals(fieldName)) { + deserializedUserDefinedFunctionExecutionError.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserDefinedFunctionExecutionError; + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionExecutionProperties.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionExecutionProperties.java new file mode 100644 index 000000000000..b98e19c4e2ff --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionExecutionProperties.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The properties for executing a user defined function. + */ +@Fluent +public final class UserDefinedFunctionExecutionProperties + implements JsonSerializable { + /* + * Runtime arguments of the user defined function. Defaults to an empty list. + */ + @Generated + private List arguments; + + /* + * Name of the exported function to execute in the code of the user defined + * function. Defaults to main. + */ + @Generated + private String exportedFunctionName; + + /* + * JS runtime options for user defined endpoints and functions + */ + @Generated + private JsRuntimeOptions runtimeOptions; + + /** + * Creates an instance of UserDefinedFunctionExecutionProperties class. + */ + @Generated + public UserDefinedFunctionExecutionProperties() { + } + + /** + * Get the arguments property: Runtime arguments of the user defined function. Defaults to an empty list. + * + * @return the arguments value. + */ + @Generated + public List getArguments() { + return this.arguments; + } + + /** + * Set the arguments property: Runtime arguments of the user defined function. Defaults to an empty list. + * + * @param arguments the arguments value to set. + * @return the UserDefinedFunctionExecutionProperties object itself. + */ + @Generated + public UserDefinedFunctionExecutionProperties setArguments(List arguments) { + this.arguments = arguments; + return this; + } + + /** + * Get the exportedFunctionName property: Name of the exported function to execute in the code of the user defined + * function. Defaults to main. + * + * @return the exportedFunctionName value. + */ + @Generated + public String getExportedFunctionName() { + return this.exportedFunctionName; + } + + /** + * Set the exportedFunctionName property: Name of the exported function to execute in the code of the user defined + * function. Defaults to main. + * + * @param exportedFunctionName the exportedFunctionName value to set. + * @return the UserDefinedFunctionExecutionProperties object itself. + */ + @Generated + public UserDefinedFunctionExecutionProperties setExportedFunctionName(String exportedFunctionName) { + this.exportedFunctionName = exportedFunctionName; + return this; + } + + /** + * Get the runtimeOptions property: JS runtime options for user defined endpoints and functions. + * + * @return the runtimeOptions value. + */ + @Generated + public JsRuntimeOptions getRuntimeOptions() { + return this.runtimeOptions; + } + + /** + * Set the runtimeOptions property: JS runtime options for user defined endpoints and functions. + * + * @param runtimeOptions the runtimeOptions value to set. + * @return the UserDefinedFunctionExecutionProperties object itself. + */ + @Generated + public UserDefinedFunctionExecutionProperties setRuntimeOptions(JsRuntimeOptions runtimeOptions) { + this.runtimeOptions = runtimeOptions; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("arguments", this.arguments, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("exportedFunctionName", this.exportedFunctionName); + jsonWriter.writeJsonField("runtimeOptions", this.runtimeOptions); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserDefinedFunctionExecutionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserDefinedFunctionExecutionProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserDefinedFunctionExecutionProperties. + */ + @Generated + public static UserDefinedFunctionExecutionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserDefinedFunctionExecutionProperties deserializedUserDefinedFunctionExecutionProperties + = new UserDefinedFunctionExecutionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("arguments".equals(fieldName)) { + List arguments = reader.readArray(reader1 -> reader1.getString()); + deserializedUserDefinedFunctionExecutionProperties.arguments = arguments; + } else if ("exportedFunctionName".equals(fieldName)) { + deserializedUserDefinedFunctionExecutionProperties.exportedFunctionName = reader.getString(); + } else if ("runtimeOptions".equals(fieldName)) { + deserializedUserDefinedFunctionExecutionProperties.runtimeOptions + = JsRuntimeOptions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUserDefinedFunctionExecutionProperties; + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionExecutionResponse.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionExecutionResponse.java new file mode 100644 index 000000000000..75aefb9457e2 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionExecutionResponse.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The result of a user defined function execution. + */ +@Immutable +public final class UserDefinedFunctionExecutionResponse + implements JsonSerializable { + /* + * The error object of a user defined function execution. This is returned only + * when the user defined function execution throws an exception. + */ + @Generated + private UserDefinedFunctionExecutionError error; + + /* + * The result object of a user defined function execution. This is returned only + * when the user defined function executes successfully. + */ + @Generated + private UserDefinedFunctionExecutionResult result; + + /* + * Represents the status of a user defined function execution. + */ + @Generated + private final UserDefinedFunctionExecutionStatus status; + + /** + * Creates an instance of UserDefinedFunctionExecutionResponse class. + * + * @param status the status value to set. + */ + @Generated + private UserDefinedFunctionExecutionResponse(UserDefinedFunctionExecutionStatus status) { + this.status = status; + } + + /** + * Get the error property: The error object of a user defined function execution. This is returned only + * when the user defined function execution throws an exception. + * + * @return the error value. + */ + @Generated + public UserDefinedFunctionExecutionError getError() { + return this.error; + } + + /** + * Get the result property: The result object of a user defined function execution. This is returned only + * when the user defined function executes successfully. + * + * @return the result value. + */ + @Generated + public UserDefinedFunctionExecutionResult getResult() { + return this.result; + } + + /** + * Get the status property: Represents the status of a user defined function execution. + * + * @return the status value. + */ + @Generated + public UserDefinedFunctionExecutionStatus getStatus() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeJsonField("error", this.error); + jsonWriter.writeJsonField("result", this.result); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserDefinedFunctionExecutionResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserDefinedFunctionExecutionResponse if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UserDefinedFunctionExecutionResponse. + */ + @Generated + public static UserDefinedFunctionExecutionResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserDefinedFunctionExecutionStatus status = null; + UserDefinedFunctionExecutionError error = null; + UserDefinedFunctionExecutionResult result = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + status = UserDefinedFunctionExecutionStatus.fromString(reader.getString()); + } else if ("error".equals(fieldName)) { + error = UserDefinedFunctionExecutionError.fromJson(reader); + } else if ("result".equals(fieldName)) { + result = UserDefinedFunctionExecutionResult.fromJson(reader); + } else { + reader.skipChildren(); + } + } + UserDefinedFunctionExecutionResponse deserializedUserDefinedFunctionExecutionResponse + = new UserDefinedFunctionExecutionResponse(status); + deserializedUserDefinedFunctionExecutionResponse.error = error; + deserializedUserDefinedFunctionExecutionResponse.result = result; + + return deserializedUserDefinedFunctionExecutionResponse; + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionExecutionResult.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionExecutionResult.java new file mode 100644 index 000000000000..ee9eb58d6fd0 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionExecutionResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The result object of a user defined function execution. This is returned only + * when the user defined function executes successfully. + */ +@Immutable +public final class UserDefinedFunctionExecutionResult implements JsonSerializable { + /* + * String-encoded value returned by the user defined function execution. If the + * function does not return any value, this is set to an empty string. + */ + @Generated + private String returnValue; + + /** + * Creates an instance of UserDefinedFunctionExecutionResult class. + */ + @Generated + private UserDefinedFunctionExecutionResult() { + } + + /** + * Get the returnValue property: String-encoded value returned by the user defined function execution. If the + * function does not return any value, this is set to an empty string. + * + * @return the returnValue value. + */ + @Generated + public String getReturnValue() { + return this.returnValue; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("returnValue", this.returnValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserDefinedFunctionExecutionResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserDefinedFunctionExecutionResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserDefinedFunctionExecutionResult. + */ + @Generated + public static UserDefinedFunctionExecutionResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserDefinedFunctionExecutionResult deserializedUserDefinedFunctionExecutionResult + = new UserDefinedFunctionExecutionResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("returnValue".equals(fieldName)) { + deserializedUserDefinedFunctionExecutionResult.returnValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserDefinedFunctionExecutionResult; + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionExecutionStatus.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionExecutionStatus.java new file mode 100644 index 000000000000..49ea7a823847 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionExecutionStatus.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Represents the status of a user defined function execution. + */ +public final class UserDefinedFunctionExecutionStatus extends ExpandableStringEnum { + /** + * The function execution completed successfully. + */ + @Generated + public static final UserDefinedFunctionExecutionStatus SUCCEEDED = fromString("Succeeded"); + + /** + * The function execution failed. + */ + @Generated + public static final UserDefinedFunctionExecutionStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of UserDefinedFunctionExecutionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public UserDefinedFunctionExecutionStatus() { + } + + /** + * Creates or finds a UserDefinedFunctionExecutionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding UserDefinedFunctionExecutionStatus. + */ + @Generated + public static UserDefinedFunctionExecutionStatus fromString(String name) { + return fromString(name, UserDefinedFunctionExecutionStatus.class); + } + + /** + * Gets known UserDefinedFunctionExecutionStatus values. + * + * @return known UserDefinedFunctionExecutionStatus values. + */ + @Generated + public static Collection values() { + return values(UserDefinedFunctionExecutionStatus.class); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionHook.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionHook.java new file mode 100644 index 000000000000..59ce95d42344 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionHook.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Hook for a user defined function execution. + */ +@Fluent +public final class UserDefinedFunctionHook implements JsonSerializable { + /* + * ID of the user defined function to execute. + */ + @Generated + private final String functionId; + + /* + * The properties for executing a user defined function. + */ + @Generated + private UserDefinedFunctionExecutionProperties properties; + + /** + * Creates an instance of UserDefinedFunctionHook class. + * + * @param functionId the functionId value to set. + */ + @Generated + public UserDefinedFunctionHook(String functionId) { + this.functionId = functionId; + } + + /** + * Get the functionId property: ID of the user defined function to execute. + * + * @return the functionId value. + */ + @Generated + public String getFunctionId() { + return this.functionId; + } + + /** + * Get the properties property: The properties for executing a user defined function. + * + * @return the properties value. + */ + @Generated + public UserDefinedFunctionExecutionProperties getProperties() { + return this.properties; + } + + /** + * Set the properties property: The properties for executing a user defined function. + * + * @param properties the properties value to set. + * @return the UserDefinedFunctionHook object itself. + */ + @Generated + public UserDefinedFunctionHook setProperties(UserDefinedFunctionExecutionProperties properties) { + this.properties = properties; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("functionId", this.functionId); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserDefinedFunctionHook from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserDefinedFunctionHook if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UserDefinedFunctionHook. + */ + @Generated + public static UserDefinedFunctionHook fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String functionId = null; + UserDefinedFunctionExecutionProperties properties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("functionId".equals(fieldName)) { + functionId = reader.getString(); + } else if ("properties".equals(fieldName)) { + properties = UserDefinedFunctionExecutionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + UserDefinedFunctionHook deserializedUserDefinedFunctionHook = new UserDefinedFunctionHook(functionId); + deserializedUserDefinedFunctionHook.properties = properties; + + return deserializedUserDefinedFunctionHook; + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedRole.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedRole.java new file mode 100644 index 000000000000..fda46b2fb80c --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedRole.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * User defined role. + */ +@Immutable +public final class UserDefinedRole implements JsonSerializable { + /* + * User defined role + */ + @Generated + private final List role; + + /** + * Creates an instance of UserDefinedRole class. + * + * @param role the role value to set. + */ + @Generated + private UserDefinedRole(List role) { + this.role = role; + } + + /** + * Get the role property: User defined role. + * + * @return the role value. + */ + @Generated + public List getRole() { + return this.role; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("role", this.role, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserDefinedRole from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserDefinedRole if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UserDefinedRole. + */ + @Generated + public static UserDefinedRole fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List role = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("role".equals(fieldName)) { + role = reader.readArray(reader1 -> Role.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new UserDefinedRole(role); + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedRoles.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedRoles.java new file mode 100644 index 000000000000..5c73f53d9f68 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/UserDefinedRoles.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.security.confidentialledger.implementation.JsonMergePatchHelper; +import java.io.IOException; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * Roles. + */ +@Fluent +public final class UserDefinedRoles implements JsonSerializable { + /* + * Roles + */ + @Generated + private List roles; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setUserDefinedRolesAccessor(new JsonMergePatchHelper.UserDefinedRolesAccessor() { + @Override + public UserDefinedRoles prepareModelForJsonMergePatch(UserDefinedRoles model, + boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(UserDefinedRoles model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of UserDefinedRoles class. + */ + @Generated + public UserDefinedRoles() { + } + + /** + * Get the roles property: Roles. + * + * @return the roles value. + */ + @Generated + public List getRoles() { + return this.roles; + } + + /** + * Set the roles property: Roles. + *

Required when create the resource.

+ * + * @param roles the roles value to set. + * @return the UserDefinedRoles object itself. + */ + @Generated + public UserDefinedRoles setRoles(List roles) { + this.roles = roles; + this.updatedProperties.add("roles"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("roles", this.roles, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("roles")) { + if (this.roles == null) { + jsonWriter.writeNullField("roles"); + } else { + jsonWriter.writeArrayField("roles", this.roles, (writer, element) -> writer.writeJson(element)); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserDefinedRoles from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserDefinedRoles if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the UserDefinedRoles. + */ + @Generated + public static UserDefinedRoles fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserDefinedRoles deserializedUserDefinedRoles = new UserDefinedRoles(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("roles".equals(fieldName)) { + List roles = reader.readArray(reader1 -> Role.fromJson(reader1)); + deserializedUserDefinedRoles.roles = roles; + } else { + reader.skipChildren(); + } + } + + return deserializedUserDefinedRoles; + }); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/package-info.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/package-info.java new file mode 100644 index 000000000000..a6384c1a93ee --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the data models for ConfidentialLedger. + * Write and retrieve ledger entries against the Confidential Ledger service. + */ +package com.azure.security.confidentialledger.models; diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/package-info.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/package-info.java index 6a366cb3672e..34109127a53b 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/package-info.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/com/azure/security/confidentialledger/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for ConfidentialLedgerClient. - * The ConfidentialLedgerClient writes and retrieves ledger entries against the Confidential Ledger service. + * Package containing the classes for ConfidentialLedger. + * Write and retrieve ledger entries against the Confidential Ledger service. */ package com.azure.security.confidentialledger; diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/module-info.java b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/module-info.java index 592a4a279c0b..f203c0cf1dec 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/module-info.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/java/module-info.java @@ -1,10 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.security.confidentialledger { requires transitive com.azure.core; exports com.azure.security.confidentialledger; - exports com.azure.security.confidentialledger.certificate; + exports com.azure.security.confidentialledger.models; + + opens com.azure.security.confidentialledger.models to com.azure.core; } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/main/resources/META-INF/azure-security-confidentialledger_metadata.json b/sdk/confidentialledger/azure-security-confidentialledger/src/main/resources/META-INF/azure-security-confidentialledger_metadata.json new file mode 100644 index 000000000000..1554ad7ab896 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/main/resources/META-INF/azure-security-confidentialledger_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"ConfidentialLedger":"2026-02-23"},"crossLanguagePackageId":"ConfidentialLedger","crossLanguageVersion":"4c5f007c40fa","crossLanguageDefinitions":{"com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient":"ConfidentialLedger","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.createLedgerEntry":"ConfidentialLedger.createLedgerEntry","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.createLedgerEntryWithResponse":"ConfidentialLedger.createLedgerEntry","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.createOrUpdateLedgerUser":"ConfidentialLedger.createOrUpdateLedgerUser","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.createOrUpdateLedgerUserWithResponse":"ConfidentialLedger.createOrUpdateLedgerUser","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.createOrUpdateUser":"ConfidentialLedger.createOrUpdateUser","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.createOrUpdateUserWithResponse":"ConfidentialLedger.createOrUpdateUser","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.createUserDefinedEndpoint":"ConfidentialLedger.createUserDefinedEndpoint","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.createUserDefinedEndpointWithResponse":"ConfidentialLedger.createUserDefinedEndpoint","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.createUserDefinedFunction":"ConfidentialLedger.createUserDefinedFunction","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.createUserDefinedFunctionWithResponse":"ConfidentialLedger.createUserDefinedFunction","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.createUserDefinedRoleStable":"ConfidentialLedger.createUserDefinedRoleStable","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.createUserDefinedRoleStableWithResponse":"ConfidentialLedger.createUserDefinedRoleStable","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.deleteLedgerUser":"ConfidentialLedger.deleteLedgerUser","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.deleteLedgerUserWithResponse":"ConfidentialLedger.deleteLedgerUser","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.deleteUser":"ConfidentialLedger.deleteUser","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.deleteUserDefinedFunction":"ConfidentialLedger.deleteUserDefinedFunction","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.deleteUserDefinedFunctionWithResponse":"ConfidentialLedger.deleteUserDefinedFunction","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.deleteUserDefinedRoleStable":"ConfidentialLedger.deleteUserDefinedRoleStable","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.deleteUserDefinedRoleStableWithResponse":"ConfidentialLedger.deleteUserDefinedRoleStable","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.deleteUserWithResponse":"ConfidentialLedger.deleteUser","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.executeUserDefinedFunction":"ConfidentialLedger.executeUserDefinedFunction","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.executeUserDefinedFunctionWithResponse":"ConfidentialLedger.executeUserDefinedFunction","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getConstitution":"ConfidentialLedger.getConstitution","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getConstitutionWithResponse":"ConfidentialLedger.getConstitution","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getCurrentLedgerEntry":"ConfidentialLedger.getCurrentLedgerEntry","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getCurrentLedgerEntryWithResponse":"ConfidentialLedger.getCurrentLedgerEntry","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getEnclaveQuotes":"ConfidentialLedger.getEnclaveQuotes","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getEnclaveQuotesWithResponse":"ConfidentialLedger.getEnclaveQuotes","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getLedgerEntry":"ConfidentialLedger.getLedgerEntry","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getLedgerEntryWithResponse":"ConfidentialLedger.getLedgerEntry","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getLedgerUser":"ConfidentialLedger.getLedgerUser","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getLedgerUserWithResponse":"ConfidentialLedger.getLedgerUser","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getReceipt":"ConfidentialLedger.getReceipt","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getReceiptWithResponse":"ConfidentialLedger.getReceipt","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getRuntimeOptions":"ConfidentialLedger.getRuntimeOptions","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getRuntimeOptionsWithResponse":"ConfidentialLedger.getRuntimeOptions","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getTransactionStatus":"ConfidentialLedger.getTransactionStatus","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getTransactionStatusWithResponse":"ConfidentialLedger.getTransactionStatus","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getUser":"ConfidentialLedger.getUser","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getUserDefinedEndpoint":"ConfidentialLedger.getUserDefinedEndpoint","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getUserDefinedEndpointWithResponse":"ConfidentialLedger.getUserDefinedEndpoint","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getUserDefinedEndpointsModule":"ConfidentialLedger.getUserDefinedEndpointsModule","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getUserDefinedEndpointsModuleWithResponse":"ConfidentialLedger.getUserDefinedEndpointsModule","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getUserDefinedFunction":"ConfidentialLedger.getUserDefinedFunction","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getUserDefinedFunctionWithResponse":"ConfidentialLedger.getUserDefinedFunction","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getUserDefinedRole":"ConfidentialLedger.getUserDefinedRole","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getUserDefinedRoleWithResponse":"ConfidentialLedger.getUserDefinedRole","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.getUserWithResponse":"ConfidentialLedger.getUser","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.listCollections":"ConfidentialLedger.listCollections","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.listConsortiumMembers":"ConfidentialLedger.listConsortiumMembers","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.listLedgerEntries":"ConfidentialLedger.listLedgerEntries","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.listLedgerUsers":"ConfidentialLedger.listLedgerUsers","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.listTags":"ConfidentialLedger.listTags","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.listUserDefinedFunctions":"ConfidentialLedger.listUserDefinedFunctions","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.listUsers":"ConfidentialLedger.listUsers","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.updateRuntimeOptionsStable":"ConfidentialLedger.updateRuntimeOptionsStable","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.updateRuntimeOptionsStableWithResponse":"ConfidentialLedger.updateRuntimeOptionsStable","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.updateUserDefinedRoleStable":"ConfidentialLedger.updateUserDefinedRoleStable","com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient.updateUserDefinedRoleStableWithResponse":"ConfidentialLedger.updateUserDefinedRoleStable","com.azure.security.confidentialledger.ConfidentialLedgerClient":"ConfidentialLedger","com.azure.security.confidentialledger.ConfidentialLedgerClient.createLedgerEntry":"ConfidentialLedger.createLedgerEntry","com.azure.security.confidentialledger.ConfidentialLedgerClient.createLedgerEntryWithResponse":"ConfidentialLedger.createLedgerEntry","com.azure.security.confidentialledger.ConfidentialLedgerClient.createOrUpdateLedgerUser":"ConfidentialLedger.createOrUpdateLedgerUser","com.azure.security.confidentialledger.ConfidentialLedgerClient.createOrUpdateLedgerUserWithResponse":"ConfidentialLedger.createOrUpdateLedgerUser","com.azure.security.confidentialledger.ConfidentialLedgerClient.createOrUpdateUser":"ConfidentialLedger.createOrUpdateUser","com.azure.security.confidentialledger.ConfidentialLedgerClient.createOrUpdateUserWithResponse":"ConfidentialLedger.createOrUpdateUser","com.azure.security.confidentialledger.ConfidentialLedgerClient.createUserDefinedEndpoint":"ConfidentialLedger.createUserDefinedEndpoint","com.azure.security.confidentialledger.ConfidentialLedgerClient.createUserDefinedEndpointWithResponse":"ConfidentialLedger.createUserDefinedEndpoint","com.azure.security.confidentialledger.ConfidentialLedgerClient.createUserDefinedFunction":"ConfidentialLedger.createUserDefinedFunction","com.azure.security.confidentialledger.ConfidentialLedgerClient.createUserDefinedFunctionWithResponse":"ConfidentialLedger.createUserDefinedFunction","com.azure.security.confidentialledger.ConfidentialLedgerClient.createUserDefinedRoleStable":"ConfidentialLedger.createUserDefinedRoleStable","com.azure.security.confidentialledger.ConfidentialLedgerClient.createUserDefinedRoleStableWithResponse":"ConfidentialLedger.createUserDefinedRoleStable","com.azure.security.confidentialledger.ConfidentialLedgerClient.deleteLedgerUser":"ConfidentialLedger.deleteLedgerUser","com.azure.security.confidentialledger.ConfidentialLedgerClient.deleteLedgerUserWithResponse":"ConfidentialLedger.deleteLedgerUser","com.azure.security.confidentialledger.ConfidentialLedgerClient.deleteUser":"ConfidentialLedger.deleteUser","com.azure.security.confidentialledger.ConfidentialLedgerClient.deleteUserDefinedFunction":"ConfidentialLedger.deleteUserDefinedFunction","com.azure.security.confidentialledger.ConfidentialLedgerClient.deleteUserDefinedFunctionWithResponse":"ConfidentialLedger.deleteUserDefinedFunction","com.azure.security.confidentialledger.ConfidentialLedgerClient.deleteUserDefinedRoleStable":"ConfidentialLedger.deleteUserDefinedRoleStable","com.azure.security.confidentialledger.ConfidentialLedgerClient.deleteUserDefinedRoleStableWithResponse":"ConfidentialLedger.deleteUserDefinedRoleStable","com.azure.security.confidentialledger.ConfidentialLedgerClient.deleteUserWithResponse":"ConfidentialLedger.deleteUser","com.azure.security.confidentialledger.ConfidentialLedgerClient.executeUserDefinedFunction":"ConfidentialLedger.executeUserDefinedFunction","com.azure.security.confidentialledger.ConfidentialLedgerClient.executeUserDefinedFunctionWithResponse":"ConfidentialLedger.executeUserDefinedFunction","com.azure.security.confidentialledger.ConfidentialLedgerClient.getConstitution":"ConfidentialLedger.getConstitution","com.azure.security.confidentialledger.ConfidentialLedgerClient.getConstitutionWithResponse":"ConfidentialLedger.getConstitution","com.azure.security.confidentialledger.ConfidentialLedgerClient.getCurrentLedgerEntry":"ConfidentialLedger.getCurrentLedgerEntry","com.azure.security.confidentialledger.ConfidentialLedgerClient.getCurrentLedgerEntryWithResponse":"ConfidentialLedger.getCurrentLedgerEntry","com.azure.security.confidentialledger.ConfidentialLedgerClient.getEnclaveQuotes":"ConfidentialLedger.getEnclaveQuotes","com.azure.security.confidentialledger.ConfidentialLedgerClient.getEnclaveQuotesWithResponse":"ConfidentialLedger.getEnclaveQuotes","com.azure.security.confidentialledger.ConfidentialLedgerClient.getLedgerEntry":"ConfidentialLedger.getLedgerEntry","com.azure.security.confidentialledger.ConfidentialLedgerClient.getLedgerEntryWithResponse":"ConfidentialLedger.getLedgerEntry","com.azure.security.confidentialledger.ConfidentialLedgerClient.getLedgerUser":"ConfidentialLedger.getLedgerUser","com.azure.security.confidentialledger.ConfidentialLedgerClient.getLedgerUserWithResponse":"ConfidentialLedger.getLedgerUser","com.azure.security.confidentialledger.ConfidentialLedgerClient.getReceipt":"ConfidentialLedger.getReceipt","com.azure.security.confidentialledger.ConfidentialLedgerClient.getReceiptWithResponse":"ConfidentialLedger.getReceipt","com.azure.security.confidentialledger.ConfidentialLedgerClient.getRuntimeOptions":"ConfidentialLedger.getRuntimeOptions","com.azure.security.confidentialledger.ConfidentialLedgerClient.getRuntimeOptionsWithResponse":"ConfidentialLedger.getRuntimeOptions","com.azure.security.confidentialledger.ConfidentialLedgerClient.getTransactionStatus":"ConfidentialLedger.getTransactionStatus","com.azure.security.confidentialledger.ConfidentialLedgerClient.getTransactionStatusWithResponse":"ConfidentialLedger.getTransactionStatus","com.azure.security.confidentialledger.ConfidentialLedgerClient.getUser":"ConfidentialLedger.getUser","com.azure.security.confidentialledger.ConfidentialLedgerClient.getUserDefinedEndpoint":"ConfidentialLedger.getUserDefinedEndpoint","com.azure.security.confidentialledger.ConfidentialLedgerClient.getUserDefinedEndpointWithResponse":"ConfidentialLedger.getUserDefinedEndpoint","com.azure.security.confidentialledger.ConfidentialLedgerClient.getUserDefinedEndpointsModule":"ConfidentialLedger.getUserDefinedEndpointsModule","com.azure.security.confidentialledger.ConfidentialLedgerClient.getUserDefinedEndpointsModuleWithResponse":"ConfidentialLedger.getUserDefinedEndpointsModule","com.azure.security.confidentialledger.ConfidentialLedgerClient.getUserDefinedFunction":"ConfidentialLedger.getUserDefinedFunction","com.azure.security.confidentialledger.ConfidentialLedgerClient.getUserDefinedFunctionWithResponse":"ConfidentialLedger.getUserDefinedFunction","com.azure.security.confidentialledger.ConfidentialLedgerClient.getUserDefinedRole":"ConfidentialLedger.getUserDefinedRole","com.azure.security.confidentialledger.ConfidentialLedgerClient.getUserDefinedRoleWithResponse":"ConfidentialLedger.getUserDefinedRole","com.azure.security.confidentialledger.ConfidentialLedgerClient.getUserWithResponse":"ConfidentialLedger.getUser","com.azure.security.confidentialledger.ConfidentialLedgerClient.listCollections":"ConfidentialLedger.listCollections","com.azure.security.confidentialledger.ConfidentialLedgerClient.listConsortiumMembers":"ConfidentialLedger.listConsortiumMembers","com.azure.security.confidentialledger.ConfidentialLedgerClient.listLedgerEntries":"ConfidentialLedger.listLedgerEntries","com.azure.security.confidentialledger.ConfidentialLedgerClient.listLedgerUsers":"ConfidentialLedger.listLedgerUsers","com.azure.security.confidentialledger.ConfidentialLedgerClient.listTags":"ConfidentialLedger.listTags","com.azure.security.confidentialledger.ConfidentialLedgerClient.listUserDefinedFunctions":"ConfidentialLedger.listUserDefinedFunctions","com.azure.security.confidentialledger.ConfidentialLedgerClient.listUsers":"ConfidentialLedger.listUsers","com.azure.security.confidentialledger.ConfidentialLedgerClient.updateRuntimeOptionsStable":"ConfidentialLedger.updateRuntimeOptionsStable","com.azure.security.confidentialledger.ConfidentialLedgerClient.updateRuntimeOptionsStableWithResponse":"ConfidentialLedger.updateRuntimeOptionsStable","com.azure.security.confidentialledger.ConfidentialLedgerClient.updateUserDefinedRoleStable":"ConfidentialLedger.updateUserDefinedRoleStable","com.azure.security.confidentialledger.ConfidentialLedgerClient.updateUserDefinedRoleStableWithResponse":"ConfidentialLedger.updateUserDefinedRoleStable","com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder":"ConfidentialLedger","com.azure.security.confidentialledger.models.ApplicationClaim":"ConfidentialLedger.ApplicationClaim","com.azure.security.confidentialledger.models.ApplicationClaimKind":"ConfidentialLedger.ApplicationClaimKind","com.azure.security.confidentialledger.models.ApplicationClaimProtocol":"ConfidentialLedger.ApplicationClaimProtocol","com.azure.security.confidentialledger.models.Bundle":"ConfidentialLedger.Bundle","com.azure.security.confidentialledger.models.ClaimDigest":"ConfidentialLedger.ClaimDigest","com.azure.security.confidentialledger.models.Collection":"ConfidentialLedger.Collection","com.azure.security.confidentialledger.models.ConfidentialLedgerEnclaves":"ConfidentialLedger.ConfidentialLedgerEnclaves","com.azure.security.confidentialledger.models.ConfidentialLedgerQueryState":"ConfidentialLedger.ConfidentialLedgerQueryState","com.azure.security.confidentialledger.models.ConfidentialLedgerUserRoleName":"ConfidentialLedger.ConfidentialLedgerUserRoleName","com.azure.security.confidentialledger.models.ConsortiumMember":"ConfidentialLedger.ConsortiumMember","com.azure.security.confidentialledger.models.Constitution":"ConfidentialLedger.Constitution","com.azure.security.confidentialledger.models.EnclaveQuote":"ConfidentialLedger.EnclaveQuote","com.azure.security.confidentialledger.models.EndpointProperties":"ConfidentialLedger.EndpointProperties","com.azure.security.confidentialledger.models.ForwardingRequired":"ConfidentialLedger.ForwardingRequired","com.azure.security.confidentialledger.models.InterpreterReusePolicy":"ConfidentialLedger.InterpreterReusePolicy","com.azure.security.confidentialledger.models.JsRuntimeOptions":"ConfidentialLedger.JsRuntimeOptions","com.azure.security.confidentialledger.models.LedgerEntry":"ConfidentialLedger.LedgerEntry","com.azure.security.confidentialledger.models.LedgerEntryClaim":"ConfidentialLedger.LedgerEntryClaim","com.azure.security.confidentialledger.models.LedgerQueryResult":"ConfidentialLedger.LedgerQueryResult","com.azure.security.confidentialledger.models.LedgerUser":"ConfidentialLedger.LedgerUser","com.azure.security.confidentialledger.models.LedgerUserMultipleRoles":"ConfidentialLedger.LedgerUserMultipleRoles","com.azure.security.confidentialledger.models.LedgerWriteResult":"ConfidentialLedger.LedgerWriteResult","com.azure.security.confidentialledger.models.Metadata":"ConfidentialLedger.Metadata","com.azure.security.confidentialledger.models.MethodToEndpointProperties":"ConfidentialLedger.MethodToEndpointProperties","com.azure.security.confidentialledger.models.Mode":"ConfidentialLedger.Mode","com.azure.security.confidentialledger.models.ModuleDef":"ConfidentialLedger.ModuleDef","com.azure.security.confidentialledger.models.ReceiptContents":"ConfidentialLedger.ReceiptContents","com.azure.security.confidentialledger.models.ReceiptElement":"ConfidentialLedger.ReceiptElement","com.azure.security.confidentialledger.models.ReceiptLeafComponents":"ConfidentialLedger.ReceiptLeafComponents","com.azure.security.confidentialledger.models.RedirectionStrategy":"ConfidentialLedger.RedirectionStrategy","com.azure.security.confidentialledger.models.Role":"ConfidentialLedger.Role","com.azure.security.confidentialledger.models.TransactionReceipt":"ConfidentialLedger.TransactionReceipt","com.azure.security.confidentialledger.models.TransactionState":"ConfidentialLedger.TransactionState","com.azure.security.confidentialledger.models.TransactionStatus":"ConfidentialLedger.TransactionStatus","com.azure.security.confidentialledger.models.UserDefinedFunction":"ConfidentialLedger.UserDefinedFunction","com.azure.security.confidentialledger.models.UserDefinedFunctionExecutionError":"ConfidentialLedger.UserDefinedFunctionExecutionError","com.azure.security.confidentialledger.models.UserDefinedFunctionExecutionProperties":"ConfidentialLedger.UserDefinedFunctionExecutionProperties","com.azure.security.confidentialledger.models.UserDefinedFunctionExecutionResponse":"ConfidentialLedger.UserDefinedFunctionExecutionResponse","com.azure.security.confidentialledger.models.UserDefinedFunctionExecutionResult":"ConfidentialLedger.UserDefinedFunctionExecutionResult","com.azure.security.confidentialledger.models.UserDefinedFunctionExecutionStatus":"ConfidentialLedger.UserDefinedFunctionExecutionStatus","com.azure.security.confidentialledger.models.UserDefinedFunctionHook":"ConfidentialLedger.UserDefinedFunctionHook","com.azure.security.confidentialledger.models.UserDefinedRole":"ConfidentialLedger.UserDefinedRole","com.azure.security.confidentialledger.models.UserDefinedRoles":"ConfidentialLedger.UserDefinedRoles"},"generatedFiles":["src/main/java/com/azure/security/confidentialledger/ConfidentialLedgerAsyncClient.java","src/main/java/com/azure/security/confidentialledger/ConfidentialLedgerClient.java","src/main/java/com/azure/security/confidentialledger/ConfidentialLedgerClientBuilder.java","src/main/java/com/azure/security/confidentialledger/ConfidentialLedgerServiceVersion.java","src/main/java/com/azure/security/confidentialledger/implementation/ConfidentialLedgerClientImpl.java","src/main/java/com/azure/security/confidentialledger/implementation/JsonMergePatchHelper.java","src/main/java/com/azure/security/confidentialledger/implementation/package-info.java","src/main/java/com/azure/security/confidentialledger/models/ApplicationClaim.java","src/main/java/com/azure/security/confidentialledger/models/ApplicationClaimKind.java","src/main/java/com/azure/security/confidentialledger/models/ApplicationClaimProtocol.java","src/main/java/com/azure/security/confidentialledger/models/Bundle.java","src/main/java/com/azure/security/confidentialledger/models/ClaimDigest.java","src/main/java/com/azure/security/confidentialledger/models/Collection.java","src/main/java/com/azure/security/confidentialledger/models/ConfidentialLedgerEnclaves.java","src/main/java/com/azure/security/confidentialledger/models/ConfidentialLedgerQueryState.java","src/main/java/com/azure/security/confidentialledger/models/ConfidentialLedgerUserRoleName.java","src/main/java/com/azure/security/confidentialledger/models/ConsortiumMember.java","src/main/java/com/azure/security/confidentialledger/models/Constitution.java","src/main/java/com/azure/security/confidentialledger/models/EnclaveQuote.java","src/main/java/com/azure/security/confidentialledger/models/EndpointProperties.java","src/main/java/com/azure/security/confidentialledger/models/ForwardingRequired.java","src/main/java/com/azure/security/confidentialledger/models/InterpreterReusePolicy.java","src/main/java/com/azure/security/confidentialledger/models/JsRuntimeOptions.java","src/main/java/com/azure/security/confidentialledger/models/LedgerEntry.java","src/main/java/com/azure/security/confidentialledger/models/LedgerEntryClaim.java","src/main/java/com/azure/security/confidentialledger/models/LedgerQueryResult.java","src/main/java/com/azure/security/confidentialledger/models/LedgerUser.java","src/main/java/com/azure/security/confidentialledger/models/LedgerUserMultipleRoles.java","src/main/java/com/azure/security/confidentialledger/models/LedgerWriteResult.java","src/main/java/com/azure/security/confidentialledger/models/Metadata.java","src/main/java/com/azure/security/confidentialledger/models/MethodToEndpointProperties.java","src/main/java/com/azure/security/confidentialledger/models/Mode.java","src/main/java/com/azure/security/confidentialledger/models/ModuleDef.java","src/main/java/com/azure/security/confidentialledger/models/ReceiptContents.java","src/main/java/com/azure/security/confidentialledger/models/ReceiptElement.java","src/main/java/com/azure/security/confidentialledger/models/ReceiptLeafComponents.java","src/main/java/com/azure/security/confidentialledger/models/RedirectionStrategy.java","src/main/java/com/azure/security/confidentialledger/models/Role.java","src/main/java/com/azure/security/confidentialledger/models/TransactionReceipt.java","src/main/java/com/azure/security/confidentialledger/models/TransactionState.java","src/main/java/com/azure/security/confidentialledger/models/TransactionStatus.java","src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunction.java","src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionExecutionError.java","src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionExecutionProperties.java","src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionExecutionResponse.java","src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionExecutionResult.java","src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionExecutionStatus.java","src/main/java/com/azure/security/confidentialledger/models/UserDefinedFunctionHook.java","src/main/java/com/azure/security/confidentialledger/models/UserDefinedRole.java","src/main/java/com/azure/security/confidentialledger/models/UserDefinedRoles.java","src/main/java/com/azure/security/confidentialledger/models/package-info.java","src/main/java/com/azure/security/confidentialledger/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/README.md b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/README.md index e101a0039aee..fcef78077ffe 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/README.md +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/README.md @@ -45,7 +45,7 @@ HttpClient httpClient = new NettyAsyncHttpClientBuilder(reactorClient).wiretap(t ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .httpClient(httpClient) .ledgerEndpoint("https://my-ledger.confidential-ledger.azure.com") .buildClient(); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ConfidentialLedgerClientSample.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ConfidentialLedgerClientSample.java index 9174484c578b..0a44b82deac4 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ConfidentialLedgerClientSample.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ConfidentialLedgerClientSample.java @@ -8,6 +8,7 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.netty.NettyAsyncHttpClientBuilder; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; @@ -46,7 +47,7 @@ public static void main(String[] args) { ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .httpClient(httpClient) .ledgerEndpoint("https://my-ledger.confidential-ledger.azure.com") .buildClient(); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/CreateLedgerEntrySample.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/CreateLedgerEntrySample.java index 333f241790d5..2aeedbfaeab2 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/CreateLedgerEntrySample.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/CreateLedgerEntrySample.java @@ -7,13 +7,14 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.Configuration; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.identity.DefaultAzureCredentialBuilder; public class CreateLedgerEntrySample { public static void main(String[] args) { ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) .buildClient(); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/CreateLedgerEntryWithCollectionIdAndTagsSample.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/CreateLedgerEntryWithCollectionIdAndTagsSample.java index 612ff22bd54d..fd559e60a501 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/CreateLedgerEntryWithCollectionIdAndTagsSample.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/CreateLedgerEntryWithCollectionIdAndTagsSample.java @@ -7,13 +7,14 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.Configuration; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.identity.DefaultAzureCredentialBuilder; public class CreateLedgerEntryWithCollectionIdAndTagsSample { public static void main(String[] args) { ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) .buildClient(); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/CreateLedgerEntryWithCollectionIdSample.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/CreateLedgerEntryWithCollectionIdSample.java index b91973f315fb..287892a19bbe 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/CreateLedgerEntryWithCollectionIdSample.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/CreateLedgerEntryWithCollectionIdSample.java @@ -7,13 +7,14 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.Configuration; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.identity.DefaultAzureCredentialBuilder; public class CreateLedgerEntryWithCollectionIdSample { public static void main(String[] args) { ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) .buildClient(); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/CreateOrUpdateUserSample.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/CreateOrUpdateUserSample.java index 9dd232218b8c..3f3e7c9b7c96 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/CreateOrUpdateUserSample.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/CreateOrUpdateUserSample.java @@ -6,13 +6,14 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.identity.DefaultAzureCredentialBuilder; public class CreateOrUpdateUserSample { public static void main(String[] args) { ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .ledgerEndpoint("https://my-ledger.confidential-ledger.azure.com") .buildClient(); BinaryData userDetails = BinaryData.fromString("{\"assignedRole\":\"Reader\"}"); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/DeleteUserSample.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/DeleteUserSample.java index 4acf1e548dbd..c3a7b6757565 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/DeleteUserSample.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/DeleteUserSample.java @@ -5,13 +5,14 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.identity.DefaultAzureCredentialBuilder; public class DeleteUserSample { public static void main(String[] args) { ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .ledgerEndpoint("https://my-ledger.confidential-ledger.azure.com") .buildClient(); RequestOptions requestOptions = new RequestOptions(); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetConstitutionSample.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetConstitutionSample.java index e30a097a7416..ab1a9a42aca3 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetConstitutionSample.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetConstitutionSample.java @@ -6,13 +6,14 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.identity.DefaultAzureCredentialBuilder; public class GetConstitutionSample { public static void main(String[] args) { ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .ledgerEndpoint("https://my-ledger.confidential-ledger.azure.com") .buildClient(); RequestOptions requestOptions = new RequestOptions(); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetCurrentLedgerEntrySample.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetCurrentLedgerEntrySample.java index 00f5fddccf1e..9d43924180fb 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetCurrentLedgerEntrySample.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetCurrentLedgerEntrySample.java @@ -6,13 +6,14 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.identity.DefaultAzureCredentialBuilder; public class GetCurrentLedgerEntrySample { public static void main(String[] args) { ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .ledgerEndpoint("https://my-ledger.confidential-ledger.azure.com") .buildClient(); RequestOptions requestOptions = new RequestOptions(); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetEnclaveQuotesSample.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetEnclaveQuotesSample.java index afb882e516aa..b38012882fa0 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetEnclaveQuotesSample.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetEnclaveQuotesSample.java @@ -6,13 +6,14 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.identity.DefaultAzureCredentialBuilder; public class GetEnclaveQuotesSample { public static void main(String[] args) { ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .ledgerEndpoint("https://my-ledger.confidential-ledger.azure.com") .buildClient(); RequestOptions requestOptions = new RequestOptions(); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetLedgerEntriesSample.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetLedgerEntriesSample.java index e280138e6ebd..36bf21f8c875 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetLedgerEntriesSample.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetLedgerEntriesSample.java @@ -6,13 +6,14 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.RequestOptions; import com.azure.core.util.BinaryData; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.identity.DefaultAzureCredentialBuilder; public class GetLedgerEntriesSample { public static void main(String[] args) { ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .ledgerEndpoint("https://my-ledger.confidential-ledger.azure.com") .buildClient(); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetLedgerEntrySample.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetLedgerEntrySample.java index 1b9d193e3f5f..97588be31d9d 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetLedgerEntrySample.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetLedgerEntrySample.java @@ -6,13 +6,14 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.identity.DefaultAzureCredentialBuilder; public class GetLedgerEntrySample { public static void main(String[] args) { ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .ledgerEndpoint("https://my-ledger.confidential-ledger.azure.com") .buildClient(); RequestOptions requestOptions = new RequestOptions(); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetLedgerIdentitySample.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetLedgerIdentitySample.java index d2a3e96e883f..8438eac8ba63 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetLedgerIdentitySample.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetLedgerIdentitySample.java @@ -6,6 +6,7 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.certificate.ConfidentialLedgerCertificateClient; import com.azure.security.confidentialledger.certificate.ConfidentialLedgerCertificateClientBuilder; @@ -14,7 +15,7 @@ public class GetLedgerIdentitySample { public static void main(String[] args) { ConfidentialLedgerCertificateClient confidentialLedgerCertificateClient = new ConfidentialLedgerCertificateClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .certificateEndpoint("identity.accledger.azure.com") .buildClient(); RequestOptions requestOptions = new RequestOptions(); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetReceiptSample.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetReceiptSample.java index 11b4327aa852..30e635bcd2c1 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetReceiptSample.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetReceiptSample.java @@ -6,13 +6,14 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.identity.DefaultAzureCredentialBuilder; public class GetReceiptSample { public static void main(String[] args) { ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .ledgerEndpoint("https://my-ledger.confidential-ledger.azure.com") .buildClient(); RequestOptions requestOptions = new RequestOptions(); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetTransactionStatusSample.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetTransactionStatusSample.java index 27f485adce58..e3f9d3c5cb13 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetTransactionStatusSample.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetTransactionStatusSample.java @@ -6,13 +6,14 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.identity.DefaultAzureCredentialBuilder; public class GetTransactionStatusSample { public static void main(String[] args) { ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .ledgerEndpoint("https://my-ledger.confidential-ledger.azure.com") .buildClient(); RequestOptions requestOptions = new RequestOptions(); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetUserSample.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetUserSample.java index 11b811642601..190daf3b978c 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetUserSample.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetUserSample.java @@ -6,6 +6,7 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.json.models.JsonObject; import com.azure.json.models.JsonString; @@ -14,7 +15,7 @@ public class GetUserSample { public static void main(String[] args) { ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .ledgerEndpoint("https://my-ledger.confidential-ledger.azure.com") .buildClient(); RequestOptions requestOptions = new RequestOptions(); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ListCollectionIdsSample.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ListCollectionIdsSample.java index 0078825e9345..2f0ccbe88270 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ListCollectionIdsSample.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ListCollectionIdsSample.java @@ -6,13 +6,14 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.RequestOptions; import com.azure.core.util.BinaryData; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.identity.DefaultAzureCredentialBuilder; public class ListCollectionIdsSample { public static void main(String[] args) { ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .ledgerEndpoint("https://my-ledger.confidential-ledger.azure.com") .buildClient(); RequestOptions requestOptions = new RequestOptions(); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ListConsortiumMembersSample.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ListConsortiumMembersSample.java index 27dbd07d977b..3a577044b407 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ListConsortiumMembersSample.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ListConsortiumMembersSample.java @@ -6,13 +6,14 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.RequestOptions; import com.azure.core.util.BinaryData; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.identity.DefaultAzureCredentialBuilder; public class ListConsortiumMembersSample { public static void main(String[] args) { ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .ledgerEndpoint("https://my-ledger.confidential-ledger.azure.com") .buildClient(); RequestOptions requestOptions = new RequestOptions(); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ListLedgerEntriesSample.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ListLedgerEntriesSample.java index 314544cd9d8e..60042d0f0099 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ListLedgerEntriesSample.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ListLedgerEntriesSample.java @@ -7,6 +7,7 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.util.BinaryData; import com.azure.core.util.Configuration; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.identity.DefaultAzureCredentialBuilder; /** @@ -16,7 +17,7 @@ public class ListLedgerEntriesSample { public static void main(String[] args) { ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) .buildClient(); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ListLedgerEntriesWithCollectionIdAndTagSample.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ListLedgerEntriesWithCollectionIdAndTagSample.java index fede2a26dc39..99bbbde315de 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ListLedgerEntriesWithCollectionIdAndTagSample.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ListLedgerEntriesWithCollectionIdAndTagSample.java @@ -7,6 +7,7 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.util.BinaryData; import com.azure.core.util.Configuration; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.identity.DefaultAzureCredentialBuilder; /** @@ -16,7 +17,7 @@ public class ListLedgerEntriesWithCollectionIdAndTagSample { public static void main(String[] args) { ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) .buildClient(); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ListLedgerEntriesWithCollectionIdSample.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ListLedgerEntriesWithCollectionIdSample.java index bd580ffb3364..10780f47949a 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ListLedgerEntriesWithCollectionIdSample.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/ListLedgerEntriesWithCollectionIdSample.java @@ -7,6 +7,7 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.util.BinaryData; import com.azure.core.util.Configuration; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.identity.DefaultAzureCredentialBuilder; /** @@ -16,7 +17,7 @@ public class ListLedgerEntriesWithCollectionIdSample { public static void main(String[] args) { ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) .buildClient(); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/PostLedgerEntrySample.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/PostLedgerEntrySample.java index 41c7f1f784ce..0360afa7d21f 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/PostLedgerEntrySample.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/PostLedgerEntrySample.java @@ -7,6 +7,7 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.json.models.JsonObject; import com.azure.json.models.JsonString; @@ -14,7 +15,7 @@ public class PostLedgerEntrySample { public static void main(String[] args) { ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .ledgerEndpoint("https://my-ledger.confidential-ledger.azure.com") .buildClient(); BinaryData entry = BinaryData.fromString("{\"contents\":\"New ledger entry contents.\"}"); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/PostLedgerEntryWithCollectionIdAndTagsSample.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/PostLedgerEntryWithCollectionIdAndTagsSample.java index 298a9abd5beb..a01869ad03cb 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/PostLedgerEntryWithCollectionIdAndTagsSample.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/PostLedgerEntryWithCollectionIdAndTagsSample.java @@ -7,6 +7,7 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.json.models.JsonObject; import com.azure.json.models.JsonString; @@ -14,7 +15,7 @@ public class PostLedgerEntryWithCollectionIdAndTagsSample { public static void main(String[] args) { ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .ledgerEndpoint("https://my-ledger.confidential-ledger.azure.com") .buildClient(); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/PostLedgerEntryWithCollectionIdSample.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/PostLedgerEntryWithCollectionIdSample.java index 7fa4e1f94c68..dfcb669a66fe 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/PostLedgerEntryWithCollectionIdSample.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/PostLedgerEntryWithCollectionIdSample.java @@ -7,6 +7,7 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.json.models.JsonObject; import com.azure.json.models.JsonString; @@ -14,7 +15,7 @@ public class PostLedgerEntryWithCollectionIdSample { public static void main(String[] args) { ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), "https://confidential-ledger.azure.com/.default")) .ledgerEndpoint("https://my-ledger.confidential-ledger.azure.com") .buildClient(); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateLedgerEntry.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateLedgerEntry.java index ea756e076043..0b70943d417f 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateLedgerEntry.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateLedgerEntry.java @@ -1,29 +1,46 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -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.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.JsRuntimeOptions; +import com.azure.security.confidentialledger.models.LedgerEntry; +import com.azure.security.confidentialledger.models.LedgerWriteResult; +import com.azure.security.confidentialledger.models.UserDefinedFunctionExecutionProperties; +import com.azure.security.confidentialledger.models.UserDefinedFunctionHook; +import java.util.Arrays; public class CreateLedgerEntry { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.createledgerentry.createledgerentry - BinaryData entry = BinaryData.fromString( - "{\"contents\":\"New ledger entry contents.\",\"postHooks\":[{\"functionId\":\"myFunction2\",\"properties\":{\"arguments\":[\"arg3\",\"arg4\"],\"exportedFunctionName\":\"main\",\"runtimeOptions\":{\"log_exception_details\":true,\"max_cached_interpreters\":0,\"max_execution_time_ms\":0,\"max_heap_bytes\":0,\"max_stack_bytes\":0,\"return_exception_details\":true}}}],\"preHooks\":[{\"functionId\":\"myFunction1\",\"properties\":{\"arguments\":[\"arg1\",\"arg2\"],\"exportedFunctionName\":\"main\",\"runtimeOptions\":{\"log_exception_details\":true,\"max_cached_interpreters\":0,\"max_execution_time_ms\":0,\"max_heap_bytes\":0,\"max_stack_bytes\":0,\"return_exception_details\":true}}}]}"); - RequestOptions requestOptions - = new RequestOptions().addQueryParam("collectionId", "Collection1").addQueryParam("tags", "tag1,tag2,tag3"); - Response response = confidentialLedgerClient.createLedgerEntryWithResponse(entry, requestOptions); - // END:com.azure.security.confidentialledger.generated.createledgerentry.createledgerentry + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.create-ledger-entry.create-ledger-entry + LedgerWriteResult response + = confidentialLedgerClient.createLedgerEntry(new LedgerEntry("New ledger entry contents.") + .setPreHooks(Arrays.asList(new UserDefinedFunctionHook("myFunction1").setProperties( + new UserDefinedFunctionExecutionProperties().setArguments(Arrays.asList("arg1", "arg2")) + .setExportedFunctionName("main") + .setRuntimeOptions(new JsRuntimeOptions().setLogExceptionDetails(true) + .setMaxCachedInterpreters(0L) + .setMaxExecutionTimeMs(0L) + .setMaxHeapBytes(0L) + .setMaxStackBytes(0L) + .setReturnExceptionDetails(true))))) + .setPostHooks(Arrays.asList(new UserDefinedFunctionHook("myFunction2").setProperties( + new UserDefinedFunctionExecutionProperties().setArguments(Arrays.asList("arg3", "arg4")) + .setExportedFunctionName("main") + .setRuntimeOptions(new JsRuntimeOptions().setLogExceptionDetails(true) + .setMaxCachedInterpreters(0L) + .setMaxExecutionTimeMs(0L) + .setMaxHeapBytes(0L) + .setMaxStackBytes(0L) + .setReturnExceptionDetails(true))))), + "Collection1", "tag1,tag2,tag3"); + // END:com.azure.security.confidentialledger.generated.create-ledger-entry.create-ledger-entry } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateOrUpdateLedgerUser.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateOrUpdateLedgerUser.java index 32ad43675003..a2c056519be6 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateOrUpdateLedgerUser.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateOrUpdateLedgerUser.java @@ -1,28 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -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.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.ConfidentialLedgerUserRoleName; +import com.azure.security.confidentialledger.models.LedgerUserMultipleRoles; +import java.util.Arrays; public class CreateOrUpdateLedgerUser { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.createorupdateledgeruser.createorupdateledgeruser - BinaryData userMultipleRoles = BinaryData.fromString("{\"assignedRoles\":[\"Reader\",\"Writer\"]}"); - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.createOrUpdateLedgerUserWithResponse("AAD object id", - userMultipleRoles, requestOptions); - // END:com.azure.security.confidentialledger.generated.createorupdateledgeruser.createorupdateledgeruser + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.create-or-update-ledger-user.create-or-update-ledger-user + LedgerUserMultipleRoles response = confidentialLedgerClient.createOrUpdateLedgerUser("AAD object id", + new LedgerUserMultipleRoles().setAssignedRoles(Arrays.asList(ConfidentialLedgerUserRoleName.READER, + ConfidentialLedgerUserRoleName.fromString("Writer")))); + // END:com.azure.security.confidentialledger.generated.create-or-update-ledger-user.create-or-update-ledger-user } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateOrUpdateLedgerUserDefinedFunction.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateOrUpdateLedgerUserDefinedFunction.java new file mode 100644 index 000000000000..5c1323634e43 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateOrUpdateLedgerUserDefinedFunction.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.generated; + +import com.azure.core.util.Configuration; +import com.azure.security.confidentialledger.ConfidentialLedgerClient; +import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.UserDefinedFunction; + +public class CreateOrUpdateLedgerUserDefinedFunction { + public static void main(String[] args) { + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.create-user-defined-function.create-or-update-ledger-user-defined-function + UserDefinedFunction response = confidentialLedgerClient.createUserDefinedFunction("myFunction", + new UserDefinedFunction("fakeTokenPlaceholder")); + // END:com.azure.security.confidentialledger.generated.create-user-defined-function.create-or-update-ledger-user-defined-function + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateOrUpdateUser.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateOrUpdateUser.java index a936e3810112..ba5fa5da02e2 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateOrUpdateUser.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateOrUpdateUser.java @@ -1,28 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -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.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.ConfidentialLedgerUserRoleName; +import com.azure.security.confidentialledger.models.LedgerUser; public class CreateOrUpdateUser { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.createorupdateuser.createorupdateuser - BinaryData userDetails = BinaryData.fromString("{\"assignedRole\":\"Reader\"}"); - RequestOptions requestOptions = new RequestOptions(); - Response response - = confidentialLedgerClient.createOrUpdateUserWithResponse("AAD object id", userDetails, requestOptions); - // END:com.azure.security.confidentialledger.generated.createorupdateuser.createorupdateuser + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.create-or-update-user.create-or-update-user + LedgerUser response = confidentialLedgerClient.createOrUpdateUser("AAD object id", + new LedgerUser().setAssignedRole(ConfidentialLedgerUserRoleName.READER)); + // END:com.azure.security.confidentialledger.generated.create-or-update-user.create-or-update-user } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateUserDefinedEndpoint.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateUserDefinedEndpoint.java index 4092062b473c..d9180e99a91c 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateUserDefinedEndpoint.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateUserDefinedEndpoint.java @@ -1,29 +1,45 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -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.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.Bundle; +import com.azure.security.confidentialledger.models.EndpointProperties; +import com.azure.security.confidentialledger.models.ForwardingRequired; +import com.azure.security.confidentialledger.models.Metadata; +import com.azure.security.confidentialledger.models.MethodToEndpointProperties; +import com.azure.security.confidentialledger.models.ModuleDef; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; public class CreateUserDefinedEndpoint { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.createuserdefinedendpoint.createuserdefinedendpoint - BinaryData bundle = BinaryData.fromString( - "{\"metadata\":{\"endpoints\":{\"/content\":{\"get\":{\"authn_policies\":[{}],\"forwarding_required\":\"always\"}}}},\"modules\":{\"name\":\"test.js\",\"module\":\"TESTJS\"}}"); - RequestOptions requestOptions = new RequestOptions(); - Response response - = confidentialLedgerClient.createUserDefinedEndpointWithResponse(bundle, requestOptions); - // END:com.azure.security.confidentialledger.generated.createuserdefinedendpoint.createuserdefinedendpoint + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.create-user-defined-endpoint.create-user-defined-endpoint + confidentialLedgerClient.createUserDefinedEndpoint(new Bundle( + new Metadata(mapOf("/content", + new MethodToEndpointProperties() + .setGet(new EndpointProperties(Arrays.asList(mapOf()), ForwardingRequired.ALWAYS)))), + Arrays.asList(new ModuleDef("TESTJS", "test.js")))); + // END:com.azure.security.confidentialledger.generated.create-user-defined-endpoint.create-user-defined-endpoint + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateUserDefinedFunction.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateUserDefinedFunction.java deleted file mode 100644 index 057fe909d06c..000000000000 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateUserDefinedFunction.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.security.confidentialledger.generated; - -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.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.security.confidentialledger.ConfidentialLedgerClient; -import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; - -public class CreateUserDefinedFunction { - public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.createuserdefinedfunction.createuserdefinedfunction - BinaryData userDefinedFunction = BinaryData.fromString("{\"code\":\"export function main() { return true }\"}"); - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.createUserDefinedFunctionWithResponse("myFunction", - userDefinedFunction, requestOptions); - // END:com.azure.security.confidentialledger.generated.createuserdefinedfunction.createuserdefinedfunction - } -} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateUserDefinedRole.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateUserDefinedRole.java deleted file mode 100644 index c51bc2c5321f..000000000000 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreateUserDefinedRole.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.security.confidentialledger.generated; - -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.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.security.confidentialledger.ConfidentialLedgerClient; -import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; - -public class CreateUserDefinedRole { - public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.createuserdefinedrole.createuserdefinedrole - BinaryData roles = BinaryData.fromString( - "[{\"roleActions\":[\"Microsoft.ConfidentialLedger/ledger/users/write\",\"Microsoft.ConfidentialLedger/ledger/users/read\"],\"roleName\":\"administrator\"},{\"roleActions\":[\"Microsoft.ConfidentialLedger/ledger/users/write\",\"Microsoft.ConfidentialLedger/ledger/users/read\"],\"roleName\":\"contributor\"}]"); - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.createUserDefinedRoleWithResponse(roles, requestOptions); - // END:com.azure.security.confidentialledger.generated.createuserdefinedrole.createuserdefinedrole - } -} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreatedUserDefinedRole.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreatedUserDefinedRole.java new file mode 100644 index 000000000000..3adb1de51e3a --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/CreatedUserDefinedRole.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.generated; + +import com.azure.core.util.Configuration; +import com.azure.security.confidentialledger.ConfidentialLedgerClient; +import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.Role; +import com.azure.security.confidentialledger.models.UserDefinedRoles; +import java.util.Arrays; + +public class CreatedUserDefinedRole { + public static void main(String[] args) { + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.create-user-defined-role-stable.created-user-defined-role + UserDefinedRoles response + = confidentialLedgerClient.createUserDefinedRoleStable(new UserDefinedRoles().setRoles(Arrays.asList( + new Role().setRoleName("administrator") + .setRoleActions(Arrays.asList("Microsoft.ConfidentialLedger/ledger/users/write", + "Microsoft.ConfidentialLedger/ledger/users/read")), + new Role().setRoleName("contributor") + .setRoleActions(Arrays.asList("Microsoft.ConfidentialLedger/ledger/users/write", + "Microsoft.ConfidentialLedger/ledger/users/read"))))); + // END:com.azure.security.confidentialledger.generated.create-user-defined-role-stable.created-user-defined-role + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/DeleteLedgerUser.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/DeleteLedgerUser.java new file mode 100644 index 000000000000..07d693d979ad --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/DeleteLedgerUser.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.generated; + +import com.azure.core.util.Configuration; +import com.azure.security.confidentialledger.ConfidentialLedgerClient; +import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; + +public class DeleteLedgerUser { + public static void main(String[] args) { + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.delete-ledger-user.delete-ledger-user + confidentialLedgerClient.deleteLedgerUser("AAD object id"); + // END:com.azure.security.confidentialledger.generated.delete-ledger-user.delete-ledger-user + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/DeleteUser.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/DeleteUser.java index 4c5cc91cbc1f..309bc31cd2e4 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/DeleteUser.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/DeleteUser.java @@ -1,25 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; import com.azure.core.util.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; public class DeleteUser { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.deleteuser.deleteuser - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.deleteUserWithResponse("AAD object id", requestOptions); - // END:com.azure.security.confidentialledger.generated.deleteuser.deleteuser + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.delete-user.delete-user + confidentialLedgerClient.deleteUser("AAD object id"); + // END:com.azure.security.confidentialledger.generated.delete-user.delete-user } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/DeleteUserDefinedFunction.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/DeleteUserDefinedFunction.java index 78d1f945fb78..6d690600cdd5 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/DeleteUserDefinedFunction.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/DeleteUserDefinedFunction.java @@ -1,26 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; import com.azure.core.util.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; public class DeleteUserDefinedFunction { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.deleteuserdefinedfunction.deleteuserdefinedfunction - RequestOptions requestOptions = new RequestOptions(); - Response response - = confidentialLedgerClient.deleteUserDefinedFunctionWithResponse("myFunction", requestOptions); - // END:com.azure.security.confidentialledger.generated.deleteuserdefinedfunction.deleteuserdefinedfunction + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.delete-user-defined-function.delete-user-defined-function + confidentialLedgerClient.deleteUserDefinedFunction("myFunction"); + // END:com.azure.security.confidentialledger.generated.delete-user-defined-function.delete-user-defined-function } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/DeleteUserDefinedRole.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/DeleteUserDefinedRole.java index 9883779f03bd..3c136953ef53 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/DeleteUserDefinedRole.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/DeleteUserDefinedRole.java @@ -1,25 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; import com.azure.core.util.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; public class DeleteUserDefinedRole { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.deleteuserdefinedrole.deleteuserdefinedrole - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.deleteUserDefinedRoleWithResponse("reader", requestOptions); - // END:com.azure.security.confidentialledger.generated.deleteuserdefinedrole.deleteuserdefinedrole + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.delete-user-defined-role-stable.delete-user-defined-role + confidentialLedgerClient.deleteUserDefinedRoleStable("reader"); + // END:com.azure.security.confidentialledger.generated.delete-user-defined-role-stable.delete-user-defined-role } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ExecuteUserDefinedFunction.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ExecuteUserDefinedFunction.java new file mode 100644 index 000000000000..d639a853a49c --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ExecuteUserDefinedFunction.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.generated; + +import com.azure.core.util.Configuration; +import com.azure.security.confidentialledger.ConfidentialLedgerClient; +import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.JsRuntimeOptions; +import com.azure.security.confidentialledger.models.UserDefinedFunctionExecutionProperties; +import com.azure.security.confidentialledger.models.UserDefinedFunctionExecutionResponse; +import java.util.Arrays; + +public class ExecuteUserDefinedFunction { + public static void main(String[] args) { + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.execute-user-defined-function.execute-user-defined-function + UserDefinedFunctionExecutionResponse response + = confidentialLedgerClient.executeUserDefinedFunction("myFunction", + new UserDefinedFunctionExecutionProperties().setArguments(Arrays.asList("arg1", "arg2")) + .setExportedFunctionName("main") + .setRuntimeOptions(new JsRuntimeOptions().setLogExceptionDetails(true) + .setMaxCachedInterpreters(0L) + .setMaxExecutionTimeMs(0L) + .setMaxHeapBytes(0L) + .setMaxStackBytes(0L) + .setReturnExceptionDetails(true))); + // END:com.azure.security.confidentialledger.generated.execute-user-defined-function.execute-user-defined-function + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetCollectionIds.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetCollectionIds.java deleted file mode 100644 index d19685515886..000000000000 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetCollectionIds.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.security.confidentialledger.generated; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.security.confidentialledger.ConfidentialLedgerClient; -import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; - -public class GetCollectionIds { - public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.listcollections.getcollectionids - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = confidentialLedgerClient.listCollections(requestOptions); - // END:com.azure.security.confidentialledger.generated.listcollections.getcollectionids - } -} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetConstitution.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetConstitution.java index 546a91336c19..53bb82ccee87 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetConstitution.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetConstitution.java @@ -1,26 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -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.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.Constitution; public class GetConstitution { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.getconstitution.getconstitution - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.getConstitutionWithResponse(requestOptions); - // END:com.azure.security.confidentialledger.generated.getconstitution.getconstitution + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.get-constitution.get-constitution + Constitution response = confidentialLedgerClient.getConstitution(); + // END:com.azure.security.confidentialledger.generated.get-constitution.get-constitution } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetCurrentLedgerEntry.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetCurrentLedgerEntry.java index 757e0de2fa52..b25f5ac5ac3b 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetCurrentLedgerEntry.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetCurrentLedgerEntry.java @@ -1,26 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -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.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.LedgerEntry; public class GetCurrentLedgerEntry { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.getcurrentledgerentry.getcurrentledgerentry - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.getCurrentLedgerEntryWithResponse(requestOptions); - // END:com.azure.security.confidentialledger.generated.getcurrentledgerentry.getcurrentledgerentry + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.get-current-ledger-entry.get-current-ledger-entry + LedgerEntry response = confidentialLedgerClient.getCurrentLedgerEntry(null); + // END:com.azure.security.confidentialledger.generated.get-current-ledger-entry.get-current-ledger-entry } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetEnclaveQuotes.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetEnclaveQuotes.java index b096c20d742d..81fb9048c49c 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetEnclaveQuotes.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetEnclaveQuotes.java @@ -1,26 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -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.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.ConfidentialLedgerEnclaves; public class GetEnclaveQuotes { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.getenclavequotes.getenclavequotes - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.getEnclaveQuotesWithResponse(requestOptions); - // END:com.azure.security.confidentialledger.generated.getenclavequotes.getenclavequotes + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.get-enclave-quotes.get-enclave-quotes + ConfidentialLedgerEnclaves response = confidentialLedgerClient.getEnclaveQuotes(); + // END:com.azure.security.confidentialledger.generated.get-enclave-quotes.get-enclave-quotes } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetLedgerEntry.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetLedgerEntry.java index 6e9425d6e974..f3a7ad1b2b80 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetLedgerEntry.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetLedgerEntry.java @@ -1,26 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -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.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.LedgerQueryResult; public class GetLedgerEntry { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.getledgerentry.getledgerentry - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.getLedgerEntryWithResponse("2.15", requestOptions); - // END:com.azure.security.confidentialledger.generated.getledgerentry.getledgerentry + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.get-ledger-entry.get-ledger-entry + LedgerQueryResult response = confidentialLedgerClient.getLedgerEntry("2.15", null); + // END:com.azure.security.confidentialledger.generated.get-ledger-entry.get-ledger-entry } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetLedgerUser.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetLedgerUser.java index f801274b7d1e..ac173f30edee 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetLedgerUser.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetLedgerUser.java @@ -1,27 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -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.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.LedgerUserMultipleRoles; public class GetLedgerUser { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.getledgeruser.getledgeruser - RequestOptions requestOptions = new RequestOptions(); - Response response - = confidentialLedgerClient.getLedgerUserWithResponse("AAD object id", requestOptions); - // END:com.azure.security.confidentialledger.generated.getledgeruser.getledgeruser + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.get-ledger-user.get-ledger-user + LedgerUserMultipleRoles response = confidentialLedgerClient.getLedgerUser("AAD object id"); + // END:com.azure.security.confidentialledger.generated.get-ledger-user.get-ledger-user } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetReceipt.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetReceipt.java index 7173c1e054d2..fc1cf344769b 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetReceipt.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetReceipt.java @@ -1,26 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -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.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.TransactionReceipt; public class GetReceipt { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.getreceipt.getreceipt - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.getReceiptWithResponse("2.15", requestOptions); - // END:com.azure.security.confidentialledger.generated.getreceipt.getreceipt + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.get-receipt.get-receipt + TransactionReceipt response = confidentialLedgerClient.getReceipt("2.15"); + // END:com.azure.security.confidentialledger.generated.get-receipt.get-receipt } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetRuntimeOptions.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetRuntimeOptions.java index 602b489e0cba..9f1bf7ccc7b4 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetRuntimeOptions.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetRuntimeOptions.java @@ -1,26 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -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.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.JsRuntimeOptions; public class GetRuntimeOptions { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.getruntimeoptions.getruntimeoptions - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.getRuntimeOptionsWithResponse(requestOptions); - // END:com.azure.security.confidentialledger.generated.getruntimeoptions.getruntimeoptions + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.get-runtime-options.get-runtime-options + JsRuntimeOptions response = confidentialLedgerClient.getRuntimeOptions(); + // END:com.azure.security.confidentialledger.generated.get-runtime-options.get-runtime-options } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetTransactionStatus.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetTransactionStatus.java index 7779b8516f58..2b195d9879f2 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetTransactionStatus.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetTransactionStatus.java @@ -1,27 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -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.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.TransactionStatus; public class GetTransactionStatus { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.gettransactionstatus.gettransactionstatus - RequestOptions requestOptions = new RequestOptions(); - Response response - = confidentialLedgerClient.getTransactionStatusWithResponse("4.2", requestOptions); - // END:com.azure.security.confidentialledger.generated.gettransactionstatus.gettransactionstatus + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.get-transaction-status.get-transaction-status + TransactionStatus response = confidentialLedgerClient.getTransactionStatus("4.2"); + // END:com.azure.security.confidentialledger.generated.get-transaction-status.get-transaction-status } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetUser.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetUser.java index 1f57a40ee3f3..d53403e9c989 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetUser.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetUser.java @@ -1,26 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -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.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.LedgerUser; public class GetUser { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.getuser.getuser - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.getUserWithResponse("AAD object id", requestOptions); - // END:com.azure.security.confidentialledger.generated.getuser.getuser + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.get-user.get-user + LedgerUser response = confidentialLedgerClient.getUser("AAD object id"); + // END:com.azure.security.confidentialledger.generated.get-user.get-user } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetUserDefinedEndpoint.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetUserDefinedEndpoint.java index c83fb5f1d444..f050bec3a98d 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetUserDefinedEndpoint.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetUserDefinedEndpoint.java @@ -1,26 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -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.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.Bundle; public class GetUserDefinedEndpoint { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.getuserdefinedendpoint.getuserdefinedendpoint - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.getUserDefinedEndpointWithResponse(requestOptions); - // END:com.azure.security.confidentialledger.generated.getuserdefinedendpoint.getuserdefinedendpoint + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.get-user-defined-endpoint.get-user-defined-endpoint + Bundle response = confidentialLedgerClient.getUserDefinedEndpoint(); + // END:com.azure.security.confidentialledger.generated.get-user-defined-endpoint.get-user-defined-endpoint } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetUserDefinedEndpointsModule.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetUserDefinedEndpointsModule.java index 9ec66ba4f571..a3948e3fc3b0 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetUserDefinedEndpointsModule.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetUserDefinedEndpointsModule.java @@ -1,27 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -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.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.ModuleDef; public class GetUserDefinedEndpointsModule { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.getuserdefinedendpointsmodule.getuserdefinedendpointsmodule - RequestOptions requestOptions = new RequestOptions(); - Response response - = confidentialLedgerClient.getUserDefinedEndpointsModuleWithResponse("TESTJS", requestOptions); - // END:com.azure.security.confidentialledger.generated.getuserdefinedendpointsmodule.getuserdefinedendpointsmodule + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.get-user-defined-endpoints-module.get-user-defined-endpoints-module + ModuleDef response = confidentialLedgerClient.getUserDefinedEndpointsModule("TESTJS"); + // END:com.azure.security.confidentialledger.generated.get-user-defined-endpoints-module.get-user-defined-endpoints-module } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetUserDefinedFunction.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetUserDefinedFunction.java index 312986642b8d..2ac408fb94dc 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetUserDefinedFunction.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetUserDefinedFunction.java @@ -1,27 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -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.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.UserDefinedFunction; public class GetUserDefinedFunction { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.getuserdefinedfunction.getuserdefinedfunction - RequestOptions requestOptions = new RequestOptions(); - Response response - = confidentialLedgerClient.getUserDefinedFunctionWithResponse("myFunction", requestOptions); - // END:com.azure.security.confidentialledger.generated.getuserdefinedfunction.getuserdefinedfunction + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.get-user-defined-function.get-user-defined-function + UserDefinedFunction response = confidentialLedgerClient.getUserDefinedFunction("myFunction"); + // END:com.azure.security.confidentialledger.generated.get-user-defined-function.get-user-defined-function } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetUserDefinedFunctions.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetUserDefinedFunctions.java deleted file mode 100644 index 87aea4cb8c64..000000000000 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetUserDefinedFunctions.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.security.confidentialledger.generated; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.security.confidentialledger.ConfidentialLedgerClient; -import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; - -public class GetUserDefinedFunctions { - public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.listuserdefinedfunctions.getuserdefinedfunctions - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = confidentialLedgerClient.listUserDefinedFunctions(requestOptions); - // END:com.azure.security.confidentialledger.generated.listuserdefinedfunctions.getuserdefinedfunctions - } -} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetUserDefinedRole.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetUserDefinedRole.java index 7b66eeffead0..ea8687514bb7 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetUserDefinedRole.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/GetUserDefinedRole.java @@ -1,27 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -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.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.UserDefinedRole; public class GetUserDefinedRole { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.getuserdefinedrole.getuserdefinedrole - RequestOptions requestOptions = new RequestOptions(); - Response response - = confidentialLedgerClient.getUserDefinedRoleWithResponse("administrator", requestOptions); - // END:com.azure.security.confidentialledger.generated.getuserdefinedrole.getuserdefinedrole + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.get-user-defined-role.get-user-defined-role + UserDefinedRole response = confidentialLedgerClient.getUserDefinedRole("administrator"); + // END:com.azure.security.confidentialledger.generated.get-user-defined-role.get-user-defined-role } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListCollections.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListCollections.java new file mode 100644 index 000000000000..39d18b6b4642 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListCollections.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Configuration; +import com.azure.security.confidentialledger.ConfidentialLedgerClient; +import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.Collection; + +public class ListCollections { + public static void main(String[] args) { + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.list-collections.list-collections + PagedIterable response = confidentialLedgerClient.listCollections(); + // END:com.azure.security.confidentialledger.generated.list-collections.list-collections + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListConsortiumMembers.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListConsortiumMembers.java index cceab0628679..17dec1b5cc96 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListConsortiumMembers.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListConsortiumMembers.java @@ -1,26 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; import com.azure.core.util.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.ConsortiumMember; public class ListConsortiumMembers { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.listconsortiummembers.listconsortiummembers - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = confidentialLedgerClient.listConsortiumMembers(requestOptions); - // END:com.azure.security.confidentialledger.generated.listconsortiummembers.listconsortiummembers + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.list-consortium-members.list-consortium-members + PagedIterable response = confidentialLedgerClient.listConsortiumMembers(); + // END:com.azure.security.confidentialledger.generated.list-consortium-members.list-consortium-members } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListLedgerEntries.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListLedgerEntries.java index 4ed20b55959a..83f7ad1f2c93 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListLedgerEntries.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListLedgerEntries.java @@ -1,27 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; import com.azure.core.util.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.LedgerEntry; public class ListLedgerEntries { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.listledgerentries.listledgerentries - RequestOptions requestOptions - = new RequestOptions().addQueryParam("fromTransactionId", "2.15").addQueryParam("toTransactionId", "2.20"); - PagedIterable response = confidentialLedgerClient.listLedgerEntries(requestOptions); - // END:com.azure.security.confidentialledger.generated.listledgerentries.listledgerentries + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.list-ledger-entries.list-ledger-entries + PagedIterable response = confidentialLedgerClient.listLedgerEntries(null, "2.15", "2.20", null); + // END:com.azure.security.confidentialledger.generated.list-ledger-entries.list-ledger-entries } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListLedgerUsers.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListLedgerUsers.java new file mode 100644 index 000000000000..e56ab8ed63bc --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListLedgerUsers.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Configuration; +import com.azure.security.confidentialledger.ConfidentialLedgerClient; +import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.LedgerUserMultipleRoles; + +public class ListLedgerUsers { + public static void main(String[] args) { + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.list-ledger-users.list-ledger-users + PagedIterable response = confidentialLedgerClient.listLedgerUsers(); + // END:com.azure.security.confidentialledger.generated.list-ledger-users.list-ledger-users + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListLedgerUsersEntries.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListLedgerUsersEntries.java deleted file mode 100644 index 92b66699b00c..000000000000 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListLedgerUsersEntries.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.security.confidentialledger.generated; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.security.confidentialledger.ConfidentialLedgerClient; -import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; - -public class ListLedgerUsersEntries { - public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.listledgerusers.listledgerusersentries - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = confidentialLedgerClient.listLedgerUsers(requestOptions); - // END:com.azure.security.confidentialledger.generated.listledgerusers.listledgerusersentries - } -} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListTags.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListTags.java new file mode 100644 index 000000000000..56beea91781a --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListTags.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Configuration; +import com.azure.security.confidentialledger.ConfidentialLedgerClient; +import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; + +public class ListTags { + public static void main(String[] args) { + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.list-tags.list-tags + PagedIterable response = confidentialLedgerClient.listTags("myCollection"); + // END:com.azure.security.confidentialledger.generated.list-tags.list-tags + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListUserDefinedFunctions.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListUserDefinedFunctions.java new file mode 100644 index 000000000000..d6430e18dacb --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListUserDefinedFunctions.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Configuration; +import com.azure.security.confidentialledger.ConfidentialLedgerClient; +import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.UserDefinedFunction; + +public class ListUserDefinedFunctions { + public static void main(String[] args) { + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.list-user-defined-functions.list-user-defined-functions + PagedIterable response = confidentialLedgerClient.listUserDefinedFunctions(); + // END:com.azure.security.confidentialledger.generated.list-user-defined-functions.list-user-defined-functions + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListUserEntries.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListUserEntries.java deleted file mode 100644 index f188094454ad..000000000000 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListUserEntries.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.security.confidentialledger.generated; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.security.confidentialledger.ConfidentialLedgerClient; -import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; - -public class ListUserEntries { - public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.listusers.listuserentries - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = confidentialLedgerClient.listUsers(requestOptions); - // END:com.azure.security.confidentialledger.generated.listusers.listuserentries - } -} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListUsers.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListUsers.java new file mode 100644 index 000000000000..034f93f841b7 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/ListUsers.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Configuration; +import com.azure.security.confidentialledger.ConfidentialLedgerClient; +import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.LedgerUser; + +public class ListUsers { + public static void main(String[] args) { + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.list-users.list-users + PagedIterable response = confidentialLedgerClient.listUsers(); + // END:com.azure.security.confidentialledger.generated.list-users.list-users + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/UpdateRuntimeOptions.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/UpdateRuntimeOptions.java index 1e9e3651dd70..8e202d131eef 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/UpdateRuntimeOptions.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/UpdateRuntimeOptions.java @@ -1,29 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -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.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.JsRuntimeOptions; public class UpdateRuntimeOptions { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.updateruntimeoptions.updateruntimeoptions - BinaryData jSRuntimeOptions - = BinaryData.fromString("{\"log_exception_details\":false,\"max_execution_time_ms\":1200}"); - RequestOptions requestOptions = new RequestOptions(); - Response response - = confidentialLedgerClient.updateRuntimeOptionsWithResponse(jSRuntimeOptions, requestOptions); - // END:com.azure.security.confidentialledger.generated.updateruntimeoptions.updateruntimeoptions + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.update-runtime-options-stable.update-runtime-options + JsRuntimeOptions response = confidentialLedgerClient.updateRuntimeOptionsStable( + new JsRuntimeOptions().setLogExceptionDetails(false).setMaxExecutionTimeMs(1200L)); + // END:com.azure.security.confidentialledger.generated.update-runtime-options-stable.update-runtime-options } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/UpdateUserDefinedRole.java b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/UpdateUserDefinedRole.java index fcf8d18a00d9..12817796b45a 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/UpdateUserDefinedRole.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/generated/UpdateUserDefinedRole.java @@ -1,28 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -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.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; +import com.azure.security.confidentialledger.models.Role; +import com.azure.security.confidentialledger.models.UserDefinedRoles; +import java.util.Arrays; public class UpdateUserDefinedRole { public static void main(String[] args) { - ConfidentialLedgerClient confidentialLedgerClient - = new ConfidentialLedgerClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) - .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) - .buildClient(); - // BEGIN:com.azure.security.confidentialledger.generated.updateuserdefinedrole.updateuserdefinedrole - BinaryData roles = BinaryData.fromString( - "[{\"roleActions\":[\"Microsoft.ConfidentialLedger/ledger/users/write\"],\"roleName\":\"administrator\"}]"); - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.updateUserDefinedRoleWithResponse(roles, requestOptions); - // END:com.azure.security.confidentialledger.generated.updateuserdefinedrole.updateuserdefinedrole + ConfidentialLedgerClient confidentialLedgerClient = new ConfidentialLedgerClientBuilder() + .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT")) + .buildClient(); + // BEGIN:com.azure.security.confidentialledger.generated.update-user-defined-role-stable.update-user-defined-role + UserDefinedRoles response = confidentialLedgerClient.updateUserDefinedRoleStable( + new UserDefinedRoles().setRoles(Arrays.asList(new Role().setRoleName("administrator") + .setRoleActions(Arrays.asList("Microsoft.ConfidentialLedger/ledger/users/write"))))); + // END:com.azure.security.confidentialledger.generated.update-user-defined-role-stable.update-user-defined-role } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/ConfidentialLedgerClientTestBase.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/ConfidentialLedgerClientTestBase.java index 88a18b6e9072..d1957d17d8bf 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/ConfidentialLedgerClientTestBase.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/ConfidentialLedgerClientTestBase.java @@ -5,11 +5,15 @@ package com.azure.security.confidentialledger; import com.azure.core.credential.AccessToken; +import com.azure.core.credential.TokenCredential; +import com.azure.core.credential.TokenRequestContext; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaderName; import com.azure.core.http.netty.NettyAsyncHttpClientBuilder; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogDetailLevel; import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.test.TestMode; @@ -109,15 +113,18 @@ protected void beforeTest() { if (getTestMode() == TestMode.PLAYBACK) { confidentialLedgerClientBuilder.httpClient(interceptorManager.getPlaybackClient()) - .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + .addPolicy( + createTestAuthPolicy(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)))); addSanitizers(); } else if (getTestMode() == TestMode.RECORD) { confidentialLedgerClientBuilder.addPolicy(interceptorManager.getRecordPolicy()) .httpClient(httpClient) - .credential(new DefaultAzureCredentialBuilder().build()); + .addPolicy(createTestAuthPolicy(new DefaultAzureCredentialBuilder().build())); addSanitizers(); } else if (getTestMode() == TestMode.LIVE) { - confidentialLedgerClientBuilder.credential(new DefaultAzureCredentialBuilder().build()) + confidentialLedgerClientBuilder + .addPolicy(new BearerTokenAuthenticationPolicy(new DefaultAzureCredentialBuilder().build(), + "https://confidential-ledger.azure.com/.default")) .httpClient(httpClient); } confidentialLedgerClient = confidentialLedgerClientBuilder.buildClient(); @@ -128,6 +135,8 @@ private void addSanitizers() { new TestProxySanitizer("(?<=/ledgerIdentity/)([^/?]+)", "java-sdk-live-tests-ledger", TestProxySanitizerType.URL), new TestProxySanitizer("(?<=/app/users/)([^/?]+)", "d958292f-5b70-4b66-9502-562217cc7eaa", + TestProxySanitizerType.URL), + new TestProxySanitizer("(?<=/app/ledgerUsers/)([^/?]+)", "sanitized-user-oid", TestProxySanitizerType.URL))); } @@ -161,4 +170,20 @@ protected String postLedgerEntry() throws IOException { return transactionId; } + + /** + * Creates an auth policy that adds a Bearer token without checking the HTTPS scheme. + * This is needed because the test proxy runs on HTTP, and BearerTokenAuthenticationPolicy + * refuses to send tokens over non-HTTPS connections. + */ + private static HttpPipelinePolicy createTestAuthPolicy(TokenCredential credential) { + return (context, next) -> { + TokenRequestContext tokenRequestContext + = new TokenRequestContext().addScopes("https://confidential-ledger.azure.com/.default"); + return credential.getToken(tokenRequestContext).flatMap(token -> { + context.getHttpRequest().getHeaders().set(HttpHeaderName.AUTHORIZATION, "Bearer " + token.getToken()); + return next.process(); + }); + }; + } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/GetEnclaveQuotesTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/GetEnclaveQuotesTests.java index cae748c1822d..5aee452a6f30 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/GetEnclaveQuotesTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/GetEnclaveQuotesTests.java @@ -27,6 +27,6 @@ public void testGetEnclaveQuotes() throws Exception { JsonNode enclaveQuotes = responseBodyJson.get("enclaveQuotes"); String enclaveQuotesKey = enclaveQuotes.fields().next().getKey(); - Assertions.assertEquals("OE_SGX_v1", enclaveQuotes.get(enclaveQuotesKey).get("quoteVersion").asText()); + Assertions.assertEquals("AMD_SEV_SNP_v1", enclaveQuotes.get(enclaveQuotesKey).get("quoteVersion").asText()); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ConfidentialLedgerClientTestBase.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ConfidentialLedgerClientTestBase.java index 5e2ed8d87c79..5eedd830d5a5 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ConfidentialLedgerClientTestBase.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ConfidentialLedgerClientTestBase.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; @@ -12,9 +12,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; -import com.azure.core.test.utils.MockTokenCredential; import com.azure.core.util.Configuration; -import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.ConfidentialLedgerClient; import com.azure.security.confidentialledger.ConfidentialLedgerClientBuilder; @@ -27,13 +25,8 @@ protected void beforeTest() { .ledgerEndpoint(Configuration.getGlobalConfiguration().get("LEDGERENDPOINT", "ledgerendpoint")) .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - if (getTestMode() == TestMode.PLAYBACK) { - confidentialLedgerClientbuilder.credential(new MockTokenCredential()); - } else if (getTestMode() == TestMode.RECORD) { - confidentialLedgerClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) - .credential(new DefaultAzureCredentialBuilder().build()); - } else if (getTestMode() == TestMode.LIVE) { - confidentialLedgerClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + if (getTestMode() == TestMode.RECORD) { + confidentialLedgerClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); } confidentialLedgerClient = confidentialLedgerClientbuilder.buildClient(); diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateLedgerEntryTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateLedgerEntryTests.java index 444f63d35a51..2225c20bd211 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateLedgerEntryTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateLedgerEntryTests.java @@ -1,30 +1,50 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; +import com.azure.security.confidentialledger.models.JsRuntimeOptions; +import com.azure.security.confidentialledger.models.LedgerEntry; +import com.azure.security.confidentialledger.models.LedgerWriteResult; +import com.azure.security.confidentialledger.models.UserDefinedFunctionExecutionProperties; +import com.azure.security.confidentialledger.models.UserDefinedFunctionHook; +import java.util.Arrays; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class CreateLedgerEntryTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testCreateLedgerEntryTests() { - BinaryData entry = BinaryData.fromString( - "{\"contents\":\"New ledger entry contents.\",\"postHooks\":[{\"functionId\":\"myFunction2\",\"properties\":{\"arguments\":[\"arg3\",\"arg4\"],\"exportedFunctionName\":\"main\",\"runtimeOptions\":{\"log_exception_details\":true,\"max_cached_interpreters\":0,\"max_execution_time_ms\":0,\"max_heap_bytes\":0,\"max_stack_bytes\":0,\"return_exception_details\":true}}}],\"preHooks\":[{\"functionId\":\"myFunction1\",\"properties\":{\"arguments\":[\"arg1\",\"arg2\"],\"exportedFunctionName\":\"main\",\"runtimeOptions\":{\"log_exception_details\":true,\"max_cached_interpreters\":0,\"max_execution_time_ms\":0,\"max_heap_bytes\":0,\"max_stack_bytes\":0,\"return_exception_details\":true}}}]}"); - RequestOptions requestOptions - = new RequestOptions().addQueryParam("collectionId", "Collection1").addQueryParam("tags", "tag1,tag2,tag3"); - Response response = confidentialLedgerClient.createLedgerEntryWithResponse(entry, requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals("2.15", - response.getHeaders().get(HttpHeaderName.fromString("x-ms-ccf-transaction-id")).getValue()); - Assertions.assertEquals(BinaryData.fromString("{\"collectionId\":\"subledger:0\"}").toObject(Object.class), - response.getValue().toObject(Object.class)); + // method invocation + LedgerWriteResult response + = confidentialLedgerClient.createLedgerEntry(new LedgerEntry("New ledger entry contents.") + .setPreHooks(Arrays.asList(new UserDefinedFunctionHook("myFunction1").setProperties( + new UserDefinedFunctionExecutionProperties().setArguments(Arrays.asList("arg1", "arg2")) + .setExportedFunctionName("main") + .setRuntimeOptions(new JsRuntimeOptions().setLogExceptionDetails(true) + .setMaxCachedInterpreters(0L) + .setMaxExecutionTimeMs(0L) + .setMaxHeapBytes(0L) + .setMaxStackBytes(0L) + .setReturnExceptionDetails(true))))) + .setPostHooks(Arrays.asList(new UserDefinedFunctionHook("myFunction2").setProperties( + new UserDefinedFunctionExecutionProperties().setArguments(Arrays.asList("arg3", "arg4")) + .setExportedFunctionName("main") + .setRuntimeOptions(new JsRuntimeOptions().setLogExceptionDetails(true) + .setMaxCachedInterpreters(0L) + .setMaxExecutionTimeMs(0L) + .setMaxHeapBytes(0L) + .setMaxStackBytes(0L) + .setReturnExceptionDetails(true))))), + "Collection1", "tag1,tag2,tag3"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "collectionId" + Assertions.assertEquals("subledger:0", response.getCollectionId()); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateOrUpdateLedgerUserDefinedFunctionTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateOrUpdateLedgerUserDefinedFunctionTests.java new file mode 100644 index 000000000000..6bf6f7c55f30 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateOrUpdateLedgerUserDefinedFunctionTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.generated; + +import com.azure.security.confidentialledger.models.UserDefinedFunction; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class CreateOrUpdateLedgerUserDefinedFunctionTests extends ConfidentialLedgerClientTestBase { + @Test + @Disabled + public void testCreateOrUpdateLedgerUserDefinedFunctionTests() { + // method invocation + UserDefinedFunction response = confidentialLedgerClient.createUserDefinedFunction("myFunction", + new UserDefinedFunction("fakeTokenPlaceholder")); + + // response assertion + Assertions.assertNotNull(response); + // verify property "code" + Assertions.assertEquals("export function main() { return true }", response.getCode()); + // verify property "id" + Assertions.assertEquals("myFunction", response.getId()); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateOrUpdateLedgerUserTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateOrUpdateLedgerUserTests.java index df41127912f9..0eddd8fe5401 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateOrUpdateLedgerUserTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateOrUpdateLedgerUserTests.java @@ -1,28 +1,33 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; +import com.azure.security.confidentialledger.models.ConfidentialLedgerUserRoleName; +import com.azure.security.confidentialledger.models.LedgerUserMultipleRoles; +import java.util.Arrays; +import java.util.List; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class CreateOrUpdateLedgerUserTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testCreateOrUpdateLedgerUserTests() { - BinaryData userMultipleRoles = BinaryData.fromString("{\"assignedRoles\":[\"Reader\",\"Writer\"]}"); - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.createOrUpdateLedgerUserWithResponse("AAD object id", - userMultipleRoles, requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString("{\"assignedRoles\":[\"Reader\",\"Writer\"],\"userId\":\"AAD object id\"}") - .toObject(Object.class), - response.getValue().toObject(Object.class)); + // method invocation + LedgerUserMultipleRoles response = confidentialLedgerClient.createOrUpdateLedgerUser("AAD object id", + new LedgerUserMultipleRoles().setAssignedRoles(Arrays.asList(ConfidentialLedgerUserRoleName.READER, + ConfidentialLedgerUserRoleName.fromString("Writer")))); + + // response assertion + Assertions.assertNotNull(response); + // verify property "assignedRoles" + List responseAssignedRoles = response.getAssignedRoles(); + Assertions.assertEquals(ConfidentialLedgerUserRoleName.READER, responseAssignedRoles.iterator().next()); + // verify property "userId" + Assertions.assertEquals("AAD object id", response.getUserId()); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateOrUpdateUserTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateOrUpdateUserTests.java index a4810a70a5c1..50219778f714 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateOrUpdateUserTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateOrUpdateUserTests.java @@ -1,27 +1,29 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; +import com.azure.security.confidentialledger.models.ConfidentialLedgerUserRoleName; +import com.azure.security.confidentialledger.models.LedgerUser; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class CreateOrUpdateUserTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testCreateOrUpdateUserTests() { - BinaryData userDetails = BinaryData.fromString("{\"assignedRole\":\"Reader\"}"); - RequestOptions requestOptions = new RequestOptions(); - Response response - = confidentialLedgerClient.createOrUpdateUserWithResponse("AAD object id", userDetails, requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString("{\"assignedRole\":\"Reader\",\"userId\":\"AAD object id\"}").toObject(Object.class), - response.getValue().toObject(Object.class)); + // method invocation + LedgerUser response = confidentialLedgerClient.createOrUpdateUser("AAD object id", + new LedgerUser().setAssignedRole(ConfidentialLedgerUserRoleName.READER)); + + // response assertion + Assertions.assertNotNull(response); + // verify property "assignedRole" + Assertions.assertEquals(ConfidentialLedgerUserRoleName.READER, response.getAssignedRole()); + // verify property "userId" + Assertions.assertEquals("AAD object id", response.getUserId()); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateUserDefinedEndpointTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateUserDefinedEndpointTests.java index f96c680f9f6d..b3c1b120d152 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateUserDefinedEndpointTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateUserDefinedEndpointTests.java @@ -1,25 +1,43 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; +import com.azure.security.confidentialledger.models.Bundle; +import com.azure.security.confidentialledger.models.EndpointProperties; +import com.azure.security.confidentialledger.models.ForwardingRequired; +import com.azure.security.confidentialledger.models.Metadata; +import com.azure.security.confidentialledger.models.MethodToEndpointProperties; +import com.azure.security.confidentialledger.models.ModuleDef; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class CreateUserDefinedEndpointTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testCreateUserDefinedEndpointTests() { - BinaryData bundle = BinaryData.fromString( - "{\"metadata\":{\"endpoints\":{\"/content\":{\"get\":{\"authn_policies\":[{}],\"forwarding_required\":\"always\"}}}},\"modules\":{\"name\":\"test.js\",\"module\":\"TESTJS\"}}"); - RequestOptions requestOptions = new RequestOptions(); - Response response - = confidentialLedgerClient.createUserDefinedEndpointWithResponse(bundle, requestOptions); - Assertions.assertEquals(201, response.getStatusCode()); + // method invocation + confidentialLedgerClient.createUserDefinedEndpoint(new Bundle( + new Metadata(mapOf("/content", + new MethodToEndpointProperties() + .setGet(new EndpointProperties(Arrays.asList(mapOf()), ForwardingRequired.ALWAYS)))), + Arrays.asList(new ModuleDef("TESTJS", "test.js")))); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateUserDefinedFunctionTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateUserDefinedFunctionTests.java deleted file mode 100644 index 1236ddcd80ce..000000000000 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateUserDefinedFunctionTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.security.confidentialledger.generated; - -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class CreateUserDefinedFunctionTests extends ConfidentialLedgerClientTestBase { - @Test - @Disabled - public void testCreateUserDefinedFunctionTests() { - BinaryData userDefinedFunction = BinaryData.fromString("{\"code\":\"export function main() { return true }\"}"); - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.createUserDefinedFunctionWithResponse("myFunction", - userDefinedFunction, requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals("2.15", - response.getHeaders().get(HttpHeaderName.fromString("x-ms-ccf-transaction-id")).getValue()); - Assertions.assertEquals( - BinaryData.fromString("{\"code\":\"export function main() { return true }\",\"id\":\"myFunction\"}") - .toObject(Object.class), - response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateUserDefinedRoleTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateUserDefinedRoleTests.java deleted file mode 100644 index a3b2d5ce5ae0..000000000000 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreateUserDefinedRoleTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.security.confidentialledger.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class CreateUserDefinedRoleTests extends ConfidentialLedgerClientTestBase { - @Test - @Disabled - public void testCreateUserDefinedRoleTests() { - BinaryData roles = BinaryData.fromString( - "[{\"roleActions\":[\"Microsoft.ConfidentialLedger/ledger/users/write\",\"Microsoft.ConfidentialLedger/ledger/users/read\"],\"roleName\":\"administrator\"},{\"roleActions\":[\"Microsoft.ConfidentialLedger/ledger/users/write\",\"Microsoft.ConfidentialLedger/ledger/users/read\"],\"roleName\":\"contributor\"}]"); - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.createUserDefinedRoleWithResponse(roles, requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - } -} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreatedUserDefinedRoleTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreatedUserDefinedRoleTests.java new file mode 100644 index 000000000000..c7e3fd243a8f --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/CreatedUserDefinedRoleTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.generated; + +import com.azure.security.confidentialledger.models.Role; +import com.azure.security.confidentialledger.models.UserDefinedRoles; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class CreatedUserDefinedRoleTests extends ConfidentialLedgerClientTestBase { + @Test + @Disabled + public void testCreatedUserDefinedRoleTests() { + // method invocation + UserDefinedRoles response + = confidentialLedgerClient.createUserDefinedRoleStable(new UserDefinedRoles().setRoles(Arrays.asList( + new Role().setRoleName("administrator") + .setRoleActions(Arrays.asList("Microsoft.ConfidentialLedger/ledger/users/write", + "Microsoft.ConfidentialLedger/ledger/users/read")), + new Role().setRoleName("contributor") + .setRoleActions(Arrays.asList("Microsoft.ConfidentialLedger/ledger/users/write", + "Microsoft.ConfidentialLedger/ledger/users/read"))))); + + // response assertion + Assertions.assertNotNull(response); + // verify property "roles" + List responseRoles = response.getRoles(); + Role responseRolesFirstItem = responseRoles.iterator().next(); + Assertions.assertNotNull(responseRolesFirstItem); + Assertions.assertEquals("administrator", responseRolesFirstItem.getRoleName()); + List responseRolesFirstItemRoleActions = responseRolesFirstItem.getRoleActions(); + Assertions.assertEquals("Microsoft.ConfidentialLedger/ledger/users/write", + responseRolesFirstItemRoleActions.iterator().next()); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/DeleteLedgerUserTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/DeleteLedgerUserTests.java new file mode 100644 index 000000000000..c68019d2e68d --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/DeleteLedgerUserTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.generated; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeleteLedgerUserTests extends ConfidentialLedgerClientTestBase { + @Test + @Disabled + public void testDeleteLedgerUserTests() { + // method invocation + confidentialLedgerClient.deleteLedgerUser("AAD object id"); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/DeleteUserDefinedFunctionTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/DeleteUserDefinedFunctionTests.java index b1152ba22545..a85ea1e25531 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/DeleteUserDefinedFunctionTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/DeleteUserDefinedFunctionTests.java @@ -1,22 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class DeleteUserDefinedFunctionTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testDeleteUserDefinedFunctionTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response - = confidentialLedgerClient.deleteUserDefinedFunctionWithResponse("myFunction", requestOptions); - Assertions.assertEquals(204, response.getStatusCode()); + // method invocation + confidentialLedgerClient.deleteUserDefinedFunction("myFunction"); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/DeleteUserDefinedRoleTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/DeleteUserDefinedRoleTests.java index ea6ecc3e77a7..0c21f12178ae 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/DeleteUserDefinedRoleTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/DeleteUserDefinedRoleTests.java @@ -1,21 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class DeleteUserDefinedRoleTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testDeleteUserDefinedRoleTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.deleteUserDefinedRoleWithResponse("reader", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); + // method invocation + confidentialLedgerClient.deleteUserDefinedRoleStable("reader"); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/DeleteUserTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/DeleteUserTests.java index c6c9201247fc..5d29de5673b5 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/DeleteUserTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/DeleteUserTests.java @@ -1,21 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class DeleteUserTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testDeleteUserTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.deleteUserWithResponse("AAD object id", requestOptions); - Assertions.assertEquals(204, response.getStatusCode()); + // method invocation + confidentialLedgerClient.deleteUser("AAD object id"); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ExecuteUserDefinedFunctionTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ExecuteUserDefinedFunctionTests.java new file mode 100644 index 000000000000..c2ca737bbd5c --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ExecuteUserDefinedFunctionTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.generated; + +import com.azure.security.confidentialledger.models.JsRuntimeOptions; +import com.azure.security.confidentialledger.models.UserDefinedFunctionExecutionProperties; +import com.azure.security.confidentialledger.models.UserDefinedFunctionExecutionResponse; +import com.azure.security.confidentialledger.models.UserDefinedFunctionExecutionResult; +import com.azure.security.confidentialledger.models.UserDefinedFunctionExecutionStatus; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ExecuteUserDefinedFunctionTests extends ConfidentialLedgerClientTestBase { + @Test + @Disabled + public void testExecuteUserDefinedFunctionTests() { + // method invocation + UserDefinedFunctionExecutionResponse response + = confidentialLedgerClient.executeUserDefinedFunction("myFunction", + new UserDefinedFunctionExecutionProperties().setArguments(Arrays.asList("arg1", "arg2")) + .setExportedFunctionName("main") + .setRuntimeOptions(new JsRuntimeOptions().setLogExceptionDetails(true) + .setMaxCachedInterpreters(0L) + .setMaxExecutionTimeMs(0L) + .setMaxHeapBytes(0L) + .setMaxStackBytes(0L) + .setReturnExceptionDetails(true))); + + // response assertion + Assertions.assertNotNull(response); + // verify property "result" + UserDefinedFunctionExecutionResult responseResult = response.getResult(); + Assertions.assertNotNull(responseResult); + Assertions.assertEquals("true", responseResult.getReturnValue()); + // verify property "status" + Assertions.assertEquals(UserDefinedFunctionExecutionStatus.SUCCEEDED, response.getStatus()); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetCollectionIdsTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetCollectionIdsTests.java deleted file mode 100644 index 9591272caabb..000000000000 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetCollectionIdsTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.security.confidentialledger.generated; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class GetCollectionIdsTests extends ConfidentialLedgerClientTestBase { - @Test - @Disabled - public void testGetCollectionIdsTests() { - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = confidentialLedgerClient.listCollections(requestOptions); - Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals(BinaryData.fromString("{\"collectionId\":\"first\"}").toObject(Object.class), - response.iterator().next().toObject(Object.class)); - } -} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetConstitutionTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetConstitutionTests.java index 39a9478dff4e..5d343f903192 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetConstitutionTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetConstitutionTests.java @@ -1,25 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; +import com.azure.security.confidentialledger.models.Constitution; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class GetConstitutionTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testGetConstitutionTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.getConstitutionWithResponse(requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"digest\":\"cd04f484d93a13df44eab4235c14df37e20907b3216c5a37b9e484a363a76c8e\",\"script\":\"\"}") - .toObject(Object.class), response.getValue().toObject(Object.class)); + // method invocation + Constitution response = confidentialLedgerClient.getConstitution(); + + // response assertion + Assertions.assertNotNull(response); + // verify property "digest" + Assertions.assertEquals("cd04f484d93a13df44eab4235c14df37e20907b3216c5a37b9e484a363a76c8e", + response.getDigest()); + // verify property "script" + Assertions.assertEquals("", response.getScript()); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetCurrentLedgerEntryTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetCurrentLedgerEntryTests.java index 21f92bbb5e4a..641bdad2d528 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetCurrentLedgerEntryTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetCurrentLedgerEntryTests.java @@ -1,25 +1,29 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; +import com.azure.security.confidentialledger.models.LedgerEntry; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class GetCurrentLedgerEntryTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testGetCurrentLedgerEntryTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.getCurrentLedgerEntryWithResponse(requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"collectionId\":\"subledger:0\",\"contents\":\"Current ledger entry contents.\",\"transactionId\":\"2.15\"}") - .toObject(Object.class), response.getValue().toObject(Object.class)); + // method invocation + LedgerEntry response = confidentialLedgerClient.getCurrentLedgerEntry(null); + + // response assertion + Assertions.assertNotNull(response); + // verify property "contents" + Assertions.assertEquals("Current ledger entry contents.", response.getContents()); + // verify property "collectionId" + Assertions.assertEquals("subledger:0", response.getCollectionId()); + // verify property "transactionId" + Assertions.assertEquals("2.15", response.getTransactionId()); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetEnclaveQuotesTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetEnclaveQuotesTests.java index f1a05ee48537..7f5d2e76b390 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetEnclaveQuotesTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetEnclaveQuotesTests.java @@ -1,25 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; +import com.azure.security.confidentialledger.models.ConfidentialLedgerEnclaves; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class GetEnclaveQuotesTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testGetEnclaveQuotesTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.getEnclaveQuotesWithResponse(requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"currentNodeId\":\"0\",\"enclaveQuotes\":{\"0\":{\"mrenclave\":\"9b4b6890a5fff10854e3ca4fa5af5801dae57a46bfef3f23749bf47a61a1b1d7\",\"nodeId\":\"0\",\"quoteVersion\":\"sgx-quote-1\",\"raw\":\"0100000002000000e811000000000000030002000000000005000a00939a7233f79c4ca9940a0db3957f06074b17f6b893ef49abff5c9b689576dc08000000000f0f0305ff80060000000000000000000000000000000000000000000000000000000000000000000000000000000000050000000000000007000000000000009b4b6890a5fff10854e3ca4fa5af5801dae57a46bfef3f23749bf47a61a1b1d700000000000000000000000000000000000000000000000000000000000000005bebf77a60c142b06ec46417957f4374b42102092d2ac7465daa3af9a62fcd7f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a7c7f007fe7242cb20ad7d6eda114b47dfd92b1f615ae728a777852ce1377e2000000000000000000000000000000000000000000000000000000000000000034100000014d855131f932a590d06f9d6d6e0f2ade47054c7a9c5de61d38ccc2f35f4c00aa83ec2b3c3642af9aa050555a23c1272c1cdb0563a4e4264552a6a8514f5671378f81f331f54a8a2965275d64c061246d64c18df5b3383a498d3b5a4e997734bb35a09b0e8374bb039889dc168523251a90d8d96d921f697efb342a6534333c0f0f0305ff8006000000000000000000000000000000000000000000000000000000000000000000000000000000000015000000000000000700000000000000cdcadfb7db22ada5fd603455cde1bf9fa258fa5f284dcd6e0c63392f633a110500000000000000000000000000000000000000000000000000000000000000008c4f5775d796503e96137f77c68a829a0056ac8ded70140b081b094490c57bff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004cb3dda245424884c47313c09366c2103703cbdef3a75f20316a2796d9243e6b0000000000000000000000000000000000000000000000000000000000000000326e8be8be9b1e8f3fb3a44d8743ca30d4cde23750294f51f282401adf08334ff280afdb1b6d912b39e2c7931837f2ac91f17689ca9cb943f5a491d60bb314332000000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f0500cc0d00002d2d2d2d2d424547494e2043455254494649434154452d2d2d2d2d0a4d494945674443434243616741774942416749555576735257764147614b502b724b36424449515776477948656a6777436759494b6f5a497a6a3045417749770a6354456a4d4345474131554541777761535735305a577767553064594946424453794251636d396a5a584e7a6233496751304578476a415942674e5642416f4d0a45556c756447567349454e76636e4276636d4630615739754d5251774567594456515148444174545957353059534244624746795954454c4d416b47413155450a4341774351304578437a414a42674e5642415954416c56544d423458445449774d4459784f4441774d5449304f466f58445449334d4459784f4441774d5449300a4f466f77634445694d434147413155454177775a535735305a5777675530645949464244537942445a584a3061575a70593246305a5445614d426747413155450a43677752535735305a577767513239796347397959585270623234784644415342674e564241634d43314e68626e526849454e7359584a684d517377435159440a5651514944414a445154454c4d416b474131554542684d4356564d775754415442676371686b6a4f5051494242676771686b6a4f50514d4242774e43414154570a663645447136324762714844326677574564656538645853645179694e665039493945594a59472b3770475a586b326173775370374f3876456d58425a52345a0a6b713075452f65687233435935793774323246786f3449436d7a434341706377487759445652306a42426777466f4155304f6971326e58582b53354a463567380a6578526c304e587957553077587759445652306642466777566a42556f464b6755495a4f6148523063484d364c79396863476b7564484a316333526c5a484e6c0a636e5a705932567a4c6d6c75644756734c6d4e766253397a5a3367765932567964476c6d61574e6864476c76626939324d6939775932746a636d772f593245390a63484a765932567a633239794d4230474131556444675157424253334b5969495a66795a7449432b4f4b7a4c365142446c5465384144414f42674e56485138420a4166384542414d434273417744415944565230544151482f42414977414443434164514743537147534962345451454e4151534341635577676748424d4234470a43697147534962345451454e415145454547462f622f39427666662b6c75427a75747a6d646d34776767466b42676f71686b69472b453042445145434d4949420a5644415142677371686b69472b4530424451454341514942447a415142677371686b69472b4530424451454341674942447a415142677371686b69472b4530420a4451454341774942416a415142677371686b69472b45304244514543424149424244415142677371686b69472b453042445145434251494241544152426773710a686b69472b4530424451454342674943414941774541594c4b6f5a496876684e4151304241676343415159774541594c4b6f5a496876684e41513042416767430a415141774541594c4b6f5a496876684e4151304241676b43415141774541594c4b6f5a496876684e4151304241676f43415141774541594c4b6f5a496876684e0a4151304241677343415141774541594c4b6f5a496876684e4151304241677743415141774541594c4b6f5a496876684e4151304241673043415141774541594c0a4b6f5a496876684e4151304241673443415141774541594c4b6f5a496876684e4151304241673843415141774541594c4b6f5a496876684e41513042416841430a415141774541594c4b6f5a496876684e415130424168454341516f774877594c4b6f5a496876684e4151304241684945454138504167514267415941414141410a41414141414141774541594b4b6f5a496876684e4151304241775143414141774641594b4b6f5a496876684e4151304242415147414a4275315141414d4138470a43697147534962345451454e4151554b41514177436759494b6f5a497a6a3045417749445341417752514968414b582b324343704b525652654d2b4d7543366a0a7477634d502b2b4645396667365a4f696d55464a55474478416941684d6a743258323651662b4247344965456f665547537070364f792b68494e704d48626d7a0a4f4a596279513d3d0a2d2d2d2d2d454e442043455254494649434154452d2d2d2d2d0a2d2d2d2d2d424547494e2043455254494649434154452d2d2d2d2d0a4d4949436c7a4343416a36674177494241674956414e446f71747031312f6b7553526559504873555a644456386c6c4e4d416f4743437147534d343942414d430a4d476778476a415942674e5642414d4d45556c756447567349464e48574342536232393049454e424d526f77474159445651514b4442464a626e526c624342440a62334a7762334a6864476c76626a45554d424947413155454277774c553246756447456751327868636d4578437a414a42674e564241674d416b4e424d5173770a435159445651514745774a56557a4165467730784f4441314d6a45784d4451314d4468614677307a4d7a41314d6a45784d4451314d4468614d484578497a41680a42674e5642414d4d476b6c756447567349464e48574342515130736755484a765932567a6332397949454e424d526f77474159445651514b4442464a626e526c0a6243424462334a7762334a6864476c76626a45554d424947413155454277774c553246756447456751327868636d4578437a414a42674e564241674d416b4e420a4d517377435159445651514745774a56557a425a4d424d4742797147534d34394167454743437147534d34394177454841304941424c39712b4e4d7032494f670a74646c31626b2f75575a352b5447516d38614369387a373866732b664b435133642b75447a586e56544154325a68444369667949754a77764e33774e427039690a484253534d4a4d4a72424f6a6762737767626777487759445652306a42426777466f4155496d554d316c71644e496e7a6737535655723951477a6b6e427177770a556759445652306642457377535442486f45576751345a426148523063484d364c79396a5a584a3061575a70593246305a584d7564484a316333526c5a484e6c0a636e5a705932567a4c6d6c75644756734c6d4e766253394a626e526c62464e4857464a76623352445153356a636d7777485159445652304f42425945464e446f0a71747031312f6b7553526559504873555a644456386c6c4e4d41344741315564447745422f77514541774942426a415342674e5648524d4241663845434441470a4151482f416745414d416f4743437147534d343942414d43413063414d45514349432f396a2b3834542b487a74564f2f734f5142574a6253642b2f327565784b0a342b6141306a6346424c63704169413364684d72463563443532743646714d764149706a385864476d79326265656c6a4c4a4b2b707a706352413d3d0a2d2d2d2d2d454e442043455254494649434154452d2d2d2d2d0a2d2d2d2d2d424547494e2043455254494649434154452d2d2d2d2d0a4d4949436a6a4343416a53674177494241674955496d554d316c71644e496e7a6737535655723951477a6b6e42717777436759494b6f5a497a6a3045417749770a614445614d4267474131554541777752535735305a5777675530645949464a766233516751304578476a415942674e5642416f4d45556c756447567349454e760a636e4276636d4630615739754d5251774567594456515148444174545957353059534244624746795954454c4d416b47413155454341774351304578437a414a0a42674e5642415954416c56544d423458445445344d4455794d5445774e4445784d566f5844544d7a4d4455794d5445774e4445784d466f77614445614d4267470a4131554541777752535735305a5777675530645949464a766233516751304578476a415942674e5642416f4d45556c756447567349454e76636e4276636d46300a615739754d5251774567594456515148444174545957353059534244624746795954454c4d416b47413155454341774351304578437a414a42674e56424159540a416c56544d466b77457759484b6f5a497a6a3043415159494b6f5a497a6a3044415163445167414543366e45774d4449595a4f6a2f69505773437a61454b69370a314f694f534c52466857476a626e42564a66566e6b59347533496a6b4459594c304d784f346d717379596a6c42616c54565978465032734a424b357a6c4b4f420a757a43427544416642674e5648534d4547444157674251695a517a575770303069664f44744a5653763141624f5363477244425342674e5648523845537a424a0a4d45656752614244686b466f64485277637a6f764c324e6c636e52705a6d6c6a5958526c63793530636e567a6447566b63325679646d6c6a5a584d75615735300a5a577775593239744c306c756447567355306459556d397664454e424c6d4e796244416442674e564851344546675155496d554d316c71644e496e7a673753560a55723951477a6b6e4271777744675944565230504151482f42415144416745474d42494741315564457745422f7751494d4159424166384341514577436759490a4b6f5a497a6a30454177494453414177525149675151732f30387279636450617543466b3855505158434d416c736c6f4265374e7761514754636470613045430a495143557438534776784b6d6a70634d2f7a3057503944766f3868326b3564753169574464426b416e2b306969413d3d0a2d2d2d2d2d454e442043455254494649434154452d2d2d2d2d0a00\"},\"1\":{\"mrenclave\":\"9b4b6890a5fff10854e3ca4fa5af5801dae57a46bfef3f23749bf47a61a1b1d7\",\"nodeId\":\"1\",\"quoteVersion\":\"sgx-quote-1\",\"raw\":\"0100000002000000e811000000000000030002000000000005000a00939a7233f79c4ca9940a0db3957f06074b17f6b893ef49abff5c9b689576dc08000000000f0f0305ff80060000000000000000000000000000000000000000000000000000000000000000000000000000000000050000000000000007000000000000009b4b6890a5fff10854e3ca4fa5af5801dae57a46bfef3f23749bf47a61a1b1d700000000000000000000000000000000000000000000000000000000000000005bebf77a60c142b06ec46417957f4374b42102092d2ac7465daa3af9a62fcd7f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a7c7f007fe7242cb20ad7d6eda114b47dfd92b1f615ae728a777852ce1377e2000000000000000000000000000000000000000000000000000000000000000034100000014d855131f932a590d06f9d6d6e0f2ade47054c7a9c5de61d38ccc2f35f4c00aa83ec2b3c3642af9aa050555a23c1272c1cdb0563a4e4264552a6a8514f5671378f81f331f54a8a2965275d64c061246d64c18df5b3383a498d3b5a4e997734bb35a09b0e8374bb039889dc168523251a90d8d96d921f697efb342a6534333c0f0f0305ff8006000000000000000000000000000000000000000000000000000000000000000000000000000000000015000000000000000700000000000000cdcadfb7db22ada5fd603455cde1bf9fa258fa5f284dcd6e0c63392f633a110500000000000000000000000000000000000000000000000000000000000000008c4f5775d796503e96137f77c68a829a0056ac8ded70140b081b094490c57bff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004cb3dda245424884c47313c09366c2103703cbdef3a75f20316a2796d9243e6b0000000000000000000000000000000000000000000000000000000000000000326e8be8be9b1e8f3fb3a44d8743ca30d4cde23750294f51f282401adf08334ff280afdb1b6d912b39e2c7931837f2ac91f17689ca9cb943f5a491d60bb314332000000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f0500cc0d00002d2d2d2d2d424547494e2043455254494649434154452d2d2d2d2d0a4d494945674443434243616741774942416749555576735257764147614b502b724b36424449515776477948656a6777436759494b6f5a497a6a3045417749770a6354456a4d4345474131554541777761535735305a577767553064594946424453794251636d396a5a584e7a6233496751304578476a415942674e5642416f4d0a45556c756447567349454e76636e4276636d4630615739754d5251774567594456515148444174545957353059534244624746795954454c4d416b47413155450a4341774351304578437a414a42674e5642415954416c56544d423458445449774d4459784f4441774d5449304f466f58445449334d4459784f4441774d5449300a4f466f77634445694d434147413155454177775a535735305a5777675530645949464244537942445a584a3061575a70593246305a5445614d426747413155450a43677752535735305a577767513239796347397959585270623234784644415342674e564241634d43314e68626e526849454e7359584a684d517377435159440a5651514944414a445154454c4d416b474131554542684d4356564d775754415442676371686b6a4f5051494242676771686b6a4f50514d4242774e43414154570a663645447136324762714844326677574564656538645853645179694e665039493945594a59472b3770475a586b326173775370374f3876456d58425a52345a0a6b713075452f65687233435935793774323246786f3449436d7a434341706377487759445652306a42426777466f4155304f6971326e58582b53354a463567380a6578526c304e587957553077587759445652306642466777566a42556f464b6755495a4f6148523063484d364c79396863476b7564484a316333526c5a484e6c0a636e5a705932567a4c6d6c75644756734c6d4e766253397a5a3367765932567964476c6d61574e6864476c76626939324d6939775932746a636d772f593245390a63484a765932567a633239794d4230474131556444675157424253334b5969495a66795a7449432b4f4b7a4c365142446c5465384144414f42674e56485138420a4166384542414d434273417744415944565230544151482f42414977414443434164514743537147534962345451454e4151534341635577676748424d4234470a43697147534962345451454e415145454547462f622f39427666662b6c75427a75747a6d646d34776767466b42676f71686b69472b453042445145434d4949420a5644415142677371686b69472b4530424451454341514942447a415142677371686b69472b4530424451454341674942447a415142677371686b69472b4530420a4451454341774942416a415142677371686b69472b45304244514543424149424244415142677371686b69472b453042445145434251494241544152426773710a686b69472b4530424451454342674943414941774541594c4b6f5a496876684e4151304241676343415159774541594c4b6f5a496876684e41513042416767430a415141774541594c4b6f5a496876684e4151304241676b43415141774541594c4b6f5a496876684e4151304241676f43415141774541594c4b6f5a496876684e0a4151304241677343415141774541594c4b6f5a496876684e4151304241677743415141774541594c4b6f5a496876684e4151304241673043415141774541594c0a4b6f5a496876684e4151304241673443415141774541594c4b6f5a496876684e4151304241673843415141774541594c4b6f5a496876684e41513042416841430a415141774541594c4b6f5a496876684e415130424168454341516f774877594c4b6f5a496876684e4151304241684945454138504167514267415941414141410a41414141414141774541594b4b6f5a496876684e4151304241775143414141774641594b4b6f5a496876684e4151304242415147414a4275315141414d4138470a43697147534962345451454e4151554b41514177436759494b6f5a497a6a3045417749445341417752514968414b582b324343704b525652654d2b4d7543366a0a7477634d502b2b4645396667365a4f696d55464a55474478416941684d6a743258323651662b4247344965456f665547537070364f792b68494e704d48626d7a0a4f4a596279513d3d0a2d2d2d2d2d454e442043455254494649434154452d2d2d2d2d0a2d2d2d2d2d424547494e2043455254494649434154452d2d2d2d2d0a4d4949436c7a4343416a36674177494241674956414e446f71747031312f6b7553526559504873555a644456386c6c4e4d416f4743437147534d343942414d430a4d476778476a415942674e5642414d4d45556c756447567349464e48574342536232393049454e424d526f77474159445651514b4442464a626e526c624342440a62334a7762334a6864476c76626a45554d424947413155454277774c553246756447456751327868636d4578437a414a42674e564241674d416b4e424d5173770a435159445651514745774a56557a4165467730784f4441314d6a45784d4451314d4468614677307a4d7a41314d6a45784d4451314d4468614d484578497a41680a42674e5642414d4d476b6c756447567349464e48574342515130736755484a765932567a6332397949454e424d526f77474159445651514b4442464a626e526c0a6243424462334a7762334a6864476c76626a45554d424947413155454277774c553246756447456751327868636d4578437a414a42674e564241674d416b4e420a4d517377435159445651514745774a56557a425a4d424d4742797147534d34394167454743437147534d34394177454841304941424c39712b4e4d7032494f670a74646c31626b2f75575a352b5447516d38614369387a373866732b664b435133642b75447a586e56544154325a68444369667949754a77764e33774e427039690a484253534d4a4d4a72424f6a6762737767626777487759445652306a42426777466f4155496d554d316c71644e496e7a6737535655723951477a6b6e427177770a556759445652306642457377535442486f45576751345a426148523063484d364c79396a5a584a3061575a70593246305a584d7564484a316333526c5a484e6c0a636e5a705932567a4c6d6c75644756734c6d4e766253394a626e526c62464e4857464a76623352445153356a636d7777485159445652304f42425945464e446f0a71747031312f6b7553526559504873555a644456386c6c4e4d41344741315564447745422f77514541774942426a415342674e5648524d4241663845434441470a4151482f416745414d416f4743437147534d343942414d43413063414d45514349432f396a2b3834542b487a74564f2f734f5142574a6253642b2f327565784b0a342b6141306a6346424c63704169413364684d72463563443532743646714d764149706a385864476d79326265656c6a4c4a4b2b707a706352413d3d0a2d2d2d2d2d454e442043455254494649434154452d2d2d2d2d0a2d2d2d2d2d424547494e2043455254494649434154452d2d2d2d2d0a4d4949436a6a4343416a53674177494241674955496d554d316c71644e496e7a6737535655723951477a6b6e42717777436759494b6f5a497a6a3045417749770a614445614d4267474131554541777752535735305a5777675530645949464a766233516751304578476a415942674e5642416f4d45556c756447567349454e760a636e4276636d4630615739754d5251774567594456515148444174545957353059534244624746795954454c4d416b47413155454341774351304578437a414a0a42674e5642415954416c56544d423458445445344d4455794d5445774e4445784d566f5844544d7a4d4455794d5445774e4445784d466f77614445614d4267470a4131554541777752535735305a5777675530645949464a766233516751304578476a415942674e5642416f4d45556c756447567349454e76636e4276636d46300a615739754d5251774567594456515148444174545957353059534244624746795954454c4d416b47413155454341774351304578437a414a42674e56424159540a416c56544d466b77457759484b6f5a497a6a3043415159494b6f5a497a6a3044415163445167414543366e45774d4449595a4f6a2f69505773437a61454b69370a314f694f534c52466857476a626e42564a66566e6b59347533496a6b4459594c304d784f346d717379596a6c42616c54565978465032734a424b357a6c4b4f420a757a43427544416642674e5648534d4547444157674251695a517a575770303069664f44744a5653763141624f5363477244425342674e5648523845537a424a0a4d45656752614244686b466f64485277637a6f764c324e6c636e52705a6d6c6a5958526c63793530636e567a6447566b63325679646d6c6a5a584d75615735300a5a577775593239744c306c756447567355306459556d397664454e424c6d4e796244416442674e564851344546675155496d554d316c71644e496e7a673753560a55723951477a6b6e4271777744675944565230504151482f42415144416745474d42494741315564457745422f7751494d4159424166384341514577436759490a4b6f5a497a6a30454177494453414177525149675151732f30387279636450617543466b3855505158434d416c736c6f4265374e7761514754636470613045430a495143557438534776784b6d6a70634d2f7a3057503944766f3868326b3564753169574464426b416e2b306969413d3d0a2d2d2d2d2d454e442043455254494649434154452d2d2d2d2d0a00\"}}}") - .toObject(Object.class), response.getValue().toObject(Object.class)); + // method invocation + ConfidentialLedgerEnclaves response = confidentialLedgerClient.getEnclaveQuotes(); + + // response assertion + Assertions.assertNotNull(response); + // verify property "currentNodeId" + Assertions.assertEquals("0", response.getCurrentNodeId()); + // verify property "enclaveQuotes" + Assertions.assertNotNull(response.getEnclaveQuotes()); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetLedgerEntryTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetLedgerEntryTests.java index ddaee6b960cf..2b439c042799 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetLedgerEntryTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetLedgerEntryTests.java @@ -1,25 +1,33 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; +import com.azure.security.confidentialledger.models.ConfidentialLedgerQueryState; +import com.azure.security.confidentialledger.models.LedgerEntry; +import com.azure.security.confidentialledger.models.LedgerQueryResult; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class GetLedgerEntryTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testGetLedgerEntryTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.getLedgerEntryWithResponse("2.15", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"entry\":{\"collectionId\":\"subledger:0\",\"contents\":\"Ledger entry contents at transaction id 2.15.\",\"transactionId\":\"2.15\"},\"state\":\"Ready\"}") - .toObject(Object.class), response.getValue().toObject(Object.class)); + // method invocation + LedgerQueryResult response = confidentialLedgerClient.getLedgerEntry("2.15", null); + + // response assertion + Assertions.assertNotNull(response); + // verify property "state" + Assertions.assertEquals(ConfidentialLedgerQueryState.READY, response.getState()); + // verify property "entry" + LedgerEntry responseEntry = response.getEntry(); + Assertions.assertNotNull(responseEntry); + Assertions.assertEquals("Ledger entry contents at transaction id 2.15.", responseEntry.getContents()); + Assertions.assertEquals("subledger:0", responseEntry.getCollectionId()); + Assertions.assertEquals("2.15", responseEntry.getTransactionId()); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetLedgerUserTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetLedgerUserTests.java index acb3cdb52506..af955caf9c22 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetLedgerUserTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetLedgerUserTests.java @@ -1,27 +1,30 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; +import com.azure.security.confidentialledger.models.ConfidentialLedgerUserRoleName; +import com.azure.security.confidentialledger.models.LedgerUserMultipleRoles; +import java.util.List; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class GetLedgerUserTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testGetLedgerUserTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response - = confidentialLedgerClient.getLedgerUserWithResponse("AAD object id", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString("{\"assignedRoles\":[\"Administrator\",\"Reader\"],\"userId\":\"AAD object id\"}") - .toObject(Object.class), - response.getValue().toObject(Object.class)); + // method invocation + LedgerUserMultipleRoles response = confidentialLedgerClient.getLedgerUser("AAD object id"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "assignedRoles" + List responseAssignedRoles = response.getAssignedRoles(); + Assertions.assertEquals(ConfidentialLedgerUserRoleName.ADMINISTRATOR, responseAssignedRoles.iterator().next()); + // verify property "userId" + Assertions.assertEquals("AAD object id", response.getUserId()); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetReceiptTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetReceiptTests.java index c5f251613298..91730384b8b0 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetReceiptTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetReceiptTests.java @@ -1,25 +1,75 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; +import com.azure.security.confidentialledger.models.ApplicationClaim; +import com.azure.security.confidentialledger.models.ApplicationClaimKind; +import com.azure.security.confidentialledger.models.ApplicationClaimProtocol; +import com.azure.security.confidentialledger.models.ConfidentialLedgerQueryState; +import com.azure.security.confidentialledger.models.LedgerEntryClaim; +import com.azure.security.confidentialledger.models.ReceiptContents; +import com.azure.security.confidentialledger.models.ReceiptElement; +import com.azure.security.confidentialledger.models.ReceiptLeafComponents; +import com.azure.security.confidentialledger.models.TransactionReceipt; +import java.util.List; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class GetReceiptTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testGetReceiptTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.getReceiptWithResponse("2.15", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"applicationClaims\":[{\"kind\":\"LedgerEntry\",\"ledgerEntry\":{\"collectionId\":\"subledger:0\",\"contents\":\"Ledger entry contents at transaction id 2.15\",\"secretKey\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\"protocol\":\"LedgerEntryV1\"}}],\"receipt\":{\"cert\":\"-----BEGIN CERTIFICATE-----\\nMIIBwzCCAUmgAwIBAgIRAMRXRsojcLOzbz90rSp67xQwCgYIKoZIzj0EAwMwFjEU\\nMBIGA1UEAwwLQ0NGIE5ldHdvcmswHhcNMjIxMTI1MTE1NzM1WhcNMjMwMjIzMTE1\\nNzM0WjATMREwDwYDVQQDDAhDQ0YgTm9kZTB2MBAGByqGSM49AgEGBSuBBAAiA2IA\\nBFjnt5PbiuXlBDdWWJvR1d0niMIzx6hxRCs06d8MUwG49UvdqRc8aY2eeCuoGupG\\n9uWA3WBaZoe3QcqUr0+S+WLYXP0TYRx0xQncbKZgSWa3bcFNqaosw1KnjbLaSIRR\\nJKNeMFwwCQYDVR0TBAIwADAdBgNVHQ4EFgQUHOauq1jxw2NJMh0UrzkrWi/Vuxkw\\nHwYDVR0jBBgwFoAUSyn9seKhGp3n74by4boUVRXOpvcwDwYDVR0RBAgwBocEfwAA\\nATAKBggqhkjOPQQDAwNoADBlAjBuhyVaon0EVXKUnO59acJVcfN8fYbz8keieiov\\nOHqVqSCc60mdNGugn1kUmCKtHWYCMQDDMnOFtyeTfHPCo4n48nyoCHdaTVyS/XIF\\n83P94iQITIiCX9ZDxf/eqc8rcEvm63A=\\n-----END CERTIFICATE-----\\n\",\"leafComponents\":{\"commitEvidence\":\"ce:2.15:3cc2bfd0e14c9fb8b3d4838d3dce19704ca83fa04720e044512f25581fc9b0a7\",\"writeSetDigest\":\"f71b60aa93a6ae36bfcadaf852b2eb43e7f868bd95053c84dd4b67d11c05d516\"},\"nodeId\":\"ff9bf39b7150510ad437977d7010aa733e718b407df755b52b961e4c3b2708fd\",\"proof\":[{\"left\":\"65e4256d7e7cbff2723de58dc1d8931e4683a328e720ba7c784a82b65d027b4a\"},{\"left\":\"ef24f237b9208cfa51cdfa56b84927adce7074f3b5502abc0a6111bbd1317438\"},{\"left\":\"067d74a552d2f96d236e8fe94ed40ffd8ae665f890d6b8721783a7795a1b3dec\"},{\"left\":\"1a64045485d3e9137978cb4de06a422a76738d36489d8efa829bbf7bdd262ac1\"}],\"serviceEndorsements\":[],\"signature\":\"MGYCMQCYbEjjClnK63cpkb+LBM4XFugq99zPM8KLN9yKvXwV576mXd3fyUOrF84HJbAbO6gCMQCiebUALQkaSixwh4q3l3v+rd9pgBnH2HZpnby6vvJLGkYBDUAdR0kyYV5OEJva6N0=\"},\"state\":\"Ready\",\"transactionId\":\"2.15\"}") - .toObject(Object.class), response.getValue().toObject(Object.class)); + // method invocation + TransactionReceipt response = confidentialLedgerClient.getReceipt("2.15"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "applicationClaims" + List responseApplicationClaims = response.getApplicationClaims(); + ApplicationClaim responseApplicationClaimsFirstItem = responseApplicationClaims.iterator().next(); + Assertions.assertNotNull(responseApplicationClaimsFirstItem); + Assertions.assertEquals(ApplicationClaimKind.LEDGER_ENTRY, responseApplicationClaimsFirstItem.getKind()); + LedgerEntryClaim responseApplicationClaimsFirstItemLedgerEntry + = responseApplicationClaimsFirstItem.getLedgerEntry(); + Assertions.assertNotNull(responseApplicationClaimsFirstItemLedgerEntry); + Assertions.assertEquals("subledger:0", responseApplicationClaimsFirstItemLedgerEntry.getCollectionId()); + Assertions.assertEquals("Ledger entry contents at transaction id 2.15", + responseApplicationClaimsFirstItemLedgerEntry.getContents()); + Assertions.assertEquals("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=", + responseApplicationClaimsFirstItemLedgerEntry.getSecretKey()); + Assertions.assertEquals(ApplicationClaimProtocol.LEDGER_ENTRY_V1, + responseApplicationClaimsFirstItemLedgerEntry.getProtocol()); + // verify property "receipt" + ReceiptContents responseReceipt = response.getReceipt(); + Assertions.assertNotNull(responseReceipt); + Assertions.assertEquals( + "-----BEGIN CERTIFICATE-----\nMIIBwzCCAUmgAwIBAgIRAMRXRsojcLOzbz90rSp67xQwCgYIKoZIzj0EAwMwFjEU\nMBIGA1UEAwwLQ0NGIE5ldHdvcmswHhcNMjIxMTI1MTE1NzM1WhcNMjMwMjIzMTE1\nNzM0WjATMREwDwYDVQQDDAhDQ0YgTm9kZTB2MBAGByqGSM49AgEGBSuBBAAiA2IA\nBFjnt5PbiuXlBDdWWJvR1d0niMIzx6hxRCs06d8MUwG49UvdqRc8aY2eeCuoGupG\n9uWA3WBaZoe3QcqUr0+S+WLYXP0TYRx0xQncbKZgSWa3bcFNqaosw1KnjbLaSIRR\nJKNeMFwwCQYDVR0TBAIwADAdBgNVHQ4EFgQUHOauq1jxw2NJMh0UrzkrWi/Vuxkw\nHwYDVR0jBBgwFoAUSyn9seKhGp3n74by4boUVRXOpvcwDwYDVR0RBAgwBocEfwAA\nATAKBggqhkjOPQQDAwNoADBlAjBuhyVaon0EVXKUnO59acJVcfN8fYbz8keieiov\nOHqVqSCc60mdNGugn1kUmCKtHWYCMQDDMnOFtyeTfHPCo4n48nyoCHdaTVyS/XIF\n83P94iQITIiCX9ZDxf/eqc8rcEvm63A=\n-----END CERTIFICATE-----\n", + responseReceipt.getCert()); + ReceiptLeafComponents responseReceiptLeafComponents = responseReceipt.getLeafComponents(); + Assertions.assertNotNull(responseReceiptLeafComponents); + Assertions.assertEquals("ce:2.15:3cc2bfd0e14c9fb8b3d4838d3dce19704ca83fa04720e044512f25581fc9b0a7", + responseReceiptLeafComponents.getCommitEvidence()); + Assertions.assertEquals("f71b60aa93a6ae36bfcadaf852b2eb43e7f868bd95053c84dd4b67d11c05d516", + responseReceiptLeafComponents.getWriteSetDigest()); + Assertions.assertEquals("ff9bf39b7150510ad437977d7010aa733e718b407df755b52b961e4c3b2708fd", + responseReceipt.getNodeId()); + List responseReceiptProof = responseReceipt.getProof(); + ReceiptElement responseReceiptProofFirstItem = responseReceiptProof.iterator().next(); + Assertions.assertNotNull(responseReceiptProofFirstItem); + Assertions.assertEquals("65e4256d7e7cbff2723de58dc1d8931e4683a328e720ba7c784a82b65d027b4a", + responseReceiptProofFirstItem.getLeft()); + List responseReceiptServiceEndorsements = responseReceipt.getServiceEndorsements(); + Assertions.assertEquals(0, responseReceiptServiceEndorsements.size()); + Assertions.assertEquals( + "MGYCMQCYbEjjClnK63cpkb+LBM4XFugq99zPM8KLN9yKvXwV576mXd3fyUOrF84HJbAbO6gCMQCiebUALQkaSixwh4q3l3v+rd9pgBnH2HZpnby6vvJLGkYBDUAdR0kyYV5OEJva6N0=", + responseReceipt.getSignature()); + // verify property "state" + Assertions.assertEquals(ConfidentialLedgerQueryState.READY, response.getState()); + // verify property "transactionId" + Assertions.assertEquals("2.15", response.getTransactionId()); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetRuntimeOptionsTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetRuntimeOptionsTests.java index 688b9ce30340..3b96393d9a9a 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetRuntimeOptionsTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetRuntimeOptionsTests.java @@ -1,25 +1,35 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; +import com.azure.security.confidentialledger.models.JsRuntimeOptions; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class GetRuntimeOptionsTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testGetRuntimeOptionsTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.getRuntimeOptionsWithResponse(requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"log_exception_details\":false,\"max_cached_interpreters\":1024,\"max_execution_time_ms\":1200,\"max_heap_bytes\":1024,\"max_stack_bytes\":1024,\"return_exception_details\":false}") - .toObject(Object.class), response.getValue().toObject(Object.class)); + // method invocation + JsRuntimeOptions response = confidentialLedgerClient.getRuntimeOptions(); + + // response assertion + Assertions.assertNotNull(response); + // verify property "logExceptionDetails" + Assertions.assertEquals(false, response.isLogExceptionDetails()); + // verify property "maxCachedInterpreters" + Assertions.assertEquals(1024L, response.getMaxCachedInterpreters()); + // verify property "maxExecutionTimeMs" + Assertions.assertEquals(1200L, response.getMaxExecutionTimeMs()); + // verify property "maxHeapBytes" + Assertions.assertEquals(1024L, response.getMaxHeapBytes()); + // verify property "maxStackBytes" + Assertions.assertEquals(1024L, response.getMaxStackBytes()); + // verify property "returnExceptionDetails" + Assertions.assertEquals(false, response.isReturnExceptionDetails()); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetTransactionStatusTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetTransactionStatusTests.java index 27fddd5e12b6..bbf225fa3655 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetTransactionStatusTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetTransactionStatusTests.java @@ -1,26 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; +import com.azure.security.confidentialledger.models.TransactionState; +import com.azure.security.confidentialledger.models.TransactionStatus; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class GetTransactionStatusTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testGetTransactionStatusTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response - = confidentialLedgerClient.getTransactionStatusWithResponse("4.2", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString("{\"state\":\"Committed\",\"transactionId\":\"4.2\"}").toObject(Object.class), - response.getValue().toObject(Object.class)); + // method invocation + TransactionStatus response = confidentialLedgerClient.getTransactionStatus("4.2"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "state" + Assertions.assertEquals(TransactionState.COMMITTED, response.getState()); + // verify property "transactionId" + Assertions.assertEquals("4.2", response.getTransactionId()); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetUserDefinedEndpointTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetUserDefinedEndpointTests.java index d8b463cd1b75..7a26d21191c3 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetUserDefinedEndpointTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetUserDefinedEndpointTests.java @@ -1,25 +1,36 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; +import com.azure.security.confidentialledger.models.Bundle; +import com.azure.security.confidentialledger.models.Metadata; +import com.azure.security.confidentialledger.models.ModuleDef; +import java.util.List; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class GetUserDefinedEndpointTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testGetUserDefinedEndpointTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.getUserDefinedEndpointWithResponse(requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"metadata\":{\"endpoints\":{\"/content\":{\"get\":{\"authn_policies\":[{}],\"forwarding_required\":\"always\"}}}},\"modules\":{\"name\":\"test.js\",\"module\":\"TESTJS\"}}") - .toObject(Object.class), response.getValue().toObject(Object.class)); + // method invocation + Bundle response = confidentialLedgerClient.getUserDefinedEndpoint(); + + // response assertion + Assertions.assertNotNull(response); + // verify property "metadata" + Metadata responseMetadata = response.getMetadata(); + Assertions.assertNotNull(responseMetadata); + Assertions.assertNotNull(responseMetadata.getEndpoints()); + // verify property "modules" + List responseModules = response.getModules(); + ModuleDef responseModulesFirstItem = responseModules.iterator().next(); + Assertions.assertNotNull(responseModulesFirstItem); + Assertions.assertEquals("TESTJS", responseModulesFirstItem.getModule()); + Assertions.assertEquals("test.js", responseModulesFirstItem.getName()); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetUserDefinedEndpointsModuleTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetUserDefinedEndpointsModuleTests.java index 7a772a67ac1f..284b1d154af5 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetUserDefinedEndpointsModuleTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetUserDefinedEndpointsModuleTests.java @@ -1,26 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; +import com.azure.security.confidentialledger.models.ModuleDef; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class GetUserDefinedEndpointsModuleTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testGetUserDefinedEndpointsModuleTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response - = confidentialLedgerClient.getUserDefinedEndpointsModuleWithResponse("TESTJS", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString("{\"name\":\"test.js\",\"module\":\"TESTJS\"}").toObject(Object.class), - response.getValue().toObject(Object.class)); + // method invocation + ModuleDef response = confidentialLedgerClient.getUserDefinedEndpointsModule("TESTJS"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "module" + Assertions.assertEquals("TESTJS", response.getModule()); + // verify property "name" + Assertions.assertEquals("test.js", response.getName()); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetUserDefinedFunctionTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetUserDefinedFunctionTests.java index 4aa7d07943dd..a558e55f75f1 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetUserDefinedFunctionTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetUserDefinedFunctionTests.java @@ -1,27 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; +import com.azure.security.confidentialledger.models.UserDefinedFunction; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class GetUserDefinedFunctionTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testGetUserDefinedFunctionTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response - = confidentialLedgerClient.getUserDefinedFunctionWithResponse("myFunction", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString("{\"code\":\"export function main() { return true }\",\"id\":\"myFunction\"}") - .toObject(Object.class), - response.getValue().toObject(Object.class)); + // method invocation + UserDefinedFunction response = confidentialLedgerClient.getUserDefinedFunction("myFunction"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "code" + Assertions.assertEquals("export function main() { return true }", response.getCode()); + // verify property "id" + Assertions.assertEquals("myFunction", response.getId()); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetUserDefinedFunctionsTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetUserDefinedFunctionsTests.java deleted file mode 100644 index 1f0e9dc2dfe6..000000000000 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetUserDefinedFunctionsTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.security.confidentialledger.generated; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class GetUserDefinedFunctionsTests extends ConfidentialLedgerClientTestBase { - @Test - @Disabled - public void testGetUserDefinedFunctionsTests() { - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = confidentialLedgerClient.listUserDefinedFunctions(requestOptions); - Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString("{\"code\":\"export function main() { return true }\",\"id\":\"myFunction\"}") - .toObject(Object.class), - response.iterator().next().toObject(Object.class)); - } -} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetUserDefinedRoleTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetUserDefinedRoleTests.java index 44b166f6fd00..5044b752a857 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetUserDefinedRoleTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetUserDefinedRoleTests.java @@ -1,26 +1,33 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; +import com.azure.security.confidentialledger.models.Role; +import com.azure.security.confidentialledger.models.UserDefinedRole; +import java.util.List; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class GetUserDefinedRoleTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testGetUserDefinedRoleTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response - = confidentialLedgerClient.getUserDefinedRoleWithResponse("administrator", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "[{\"roleActions\":[\"Microsoft.ConfidentialLedger/ledger/users/write\",\"Microsoft.ConfidentialLedger/ledger/users/read\"],\"roleName\":\"administrator\"}]") - .toObject(Object.class), response.getValue().toObject(Object.class)); + // method invocation + UserDefinedRole response = confidentialLedgerClient.getUserDefinedRole("administrator"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "role" + List responseRole = response.getRole(); + Role responseRoleFirstItem = responseRole.iterator().next(); + Assertions.assertNotNull(responseRoleFirstItem); + Assertions.assertEquals("administrator", responseRoleFirstItem.getRoleName()); + List responseRoleFirstItemRoleActions = responseRoleFirstItem.getRoleActions(); + Assertions.assertEquals("Microsoft.ConfidentialLedger/ledger/users/write", + responseRoleFirstItemRoleActions.iterator().next()); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetUserTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetUserTests.java index 693b4cdf5176..860aa2fd1747 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetUserTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/GetUserTests.java @@ -1,25 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; +import com.azure.security.confidentialledger.models.ConfidentialLedgerUserRoleName; +import com.azure.security.confidentialledger.models.LedgerUser; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class GetUserTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testGetUserTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.getUserWithResponse("AAD object id", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions - .assertEquals(BinaryData.fromString("{\"assignedRole\":\"Administrator\",\"userId\":\"AAD object id\"}") - .toObject(Object.class), response.getValue().toObject(Object.class)); + // method invocation + LedgerUser response = confidentialLedgerClient.getUser("AAD object id"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "assignedRole" + Assertions.assertEquals(ConfidentialLedgerUserRoleName.ADMINISTRATOR, response.getAssignedRole()); + // verify property "userId" + Assertions.assertEquals("AAD object id", response.getUserId()); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListCollectionsTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListCollectionsTests.java new file mode 100644 index 000000000000..9ac52713719c --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListCollectionsTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.security.confidentialledger.models.Collection; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ListCollectionsTests extends ConfidentialLedgerClientTestBase { + @Test + @Disabled + public void testListCollectionsTests() { + // method invocation + PagedIterable response = confidentialLedgerClient.listCollections(); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Collection firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "collectionId" + Assertions.assertEquals("first", firstItem.getCollectionId()); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListConsortiumMembersTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListConsortiumMembersTests.java index 7c1d5cc7cf5f..175683d0c5fb 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListConsortiumMembersTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListConsortiumMembersTests.java @@ -1,25 +1,30 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; +import com.azure.security.confidentialledger.models.ConsortiumMember; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class ListConsortiumMembersTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testListConsortiumMembersTests() { - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = confidentialLedgerClient.listConsortiumMembers(requestOptions); + // method invocation + PagedIterable response = confidentialLedgerClient.listConsortiumMembers(); + + // response assertion Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString("{\"certificate\":\"\",\"id\":\"0\"}").toObject(Object.class), - response.iterator().next().toObject(Object.class)); + ConsortiumMember firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "certificate" + Assertions.assertEquals("", firstItem.getCertificate()); + // verify property "id" + Assertions.assertEquals("0", firstItem.getId()); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListLedgerEntriesTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListLedgerEntriesTests.java index b402df91e2a7..9c5f5cafc56f 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListLedgerEntriesTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListLedgerEntriesTests.java @@ -1,26 +1,32 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; +import com.azure.security.confidentialledger.models.LedgerEntry; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class ListLedgerEntriesTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testListLedgerEntriesTests() { - RequestOptions requestOptions - = new RequestOptions().addQueryParam("fromTransactionId", "2.15").addQueryParam("toTransactionId", "2.20"); - PagedIterable response = confidentialLedgerClient.listLedgerEntries(requestOptions); + // method invocation + PagedIterable response = confidentialLedgerClient.listLedgerEntries(null, "2.15", "2.20", null); + + // response assertion Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"collectionId\":\"subledger:0\",\"contents\":\"Ledger entry contents at transaction id 2.15.\",\"transactionId\":\"2.15\"}") - .toObject(Object.class), response.iterator().next().toObject(Object.class)); + LedgerEntry firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "contents" + Assertions.assertEquals("Ledger entry contents at transaction id 2.15.", firstItem.getContents()); + // verify property "collectionId" + Assertions.assertEquals("subledger:0", firstItem.getCollectionId()); + // verify property "transactionId" + Assertions.assertEquals("2.15", firstItem.getTransactionId()); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListLedgerUsersEntriesTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListLedgerUsersEntriesTests.java deleted file mode 100644 index 81fcc6e83d8e..000000000000 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListLedgerUsersEntriesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.security.confidentialledger.generated; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class ListLedgerUsersEntriesTests extends ConfidentialLedgerClientTestBase { - @Test - @Disabled - public void testListLedgerUsersEntriesTests() { - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = confidentialLedgerClient.listLedgerUsers(requestOptions); - Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals(BinaryData - .fromString("{\"assignedRoles\":[\"Administrator\",\"Reader\"],\"userId\":\"Certificate object id 1\"}") - .toObject(Object.class), response.iterator().next().toObject(Object.class)); - } -} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListLedgerUsersTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListLedgerUsersTests.java new file mode 100644 index 000000000000..3b661e6cd154 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListLedgerUsersTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.security.confidentialledger.models.ConfidentialLedgerUserRoleName; +import com.azure.security.confidentialledger.models.LedgerUserMultipleRoles; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ListLedgerUsersTests extends ConfidentialLedgerClientTestBase { + @Test + @Disabled + public void testListLedgerUsersTests() { + // method invocation + PagedIterable response = confidentialLedgerClient.listLedgerUsers(); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + LedgerUserMultipleRoles firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "assignedRoles" + List firstItemAssignedRoles = firstItem.getAssignedRoles(); + Assertions.assertEquals(ConfidentialLedgerUserRoleName.ADMINISTRATOR, firstItemAssignedRoles.iterator().next()); + // verify property "userId" + Assertions.assertEquals("Certificate object id 1", firstItem.getUserId()); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListTagsTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListTagsTests.java new file mode 100644 index 000000000000..8b2c25a97e92 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListTagsTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.generated; + +import com.azure.core.http.rest.PagedIterable; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ListTagsTests extends ConfidentialLedgerClientTestBase { + @Test + @Disabled + public void testListTagsTests() { + // method invocation + PagedIterable response = confidentialLedgerClient.listTags("myCollection"); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListUserDefinedFunctionsTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListUserDefinedFunctionsTests.java new file mode 100644 index 000000000000..a85f24f3adb0 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListUserDefinedFunctionsTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.security.confidentialledger.models.UserDefinedFunction; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ListUserDefinedFunctionsTests extends ConfidentialLedgerClientTestBase { + @Test + @Disabled + public void testListUserDefinedFunctionsTests() { + // method invocation + PagedIterable response = confidentialLedgerClient.listUserDefinedFunctions(); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + UserDefinedFunction firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "code" + Assertions.assertEquals("export function main() { return true }", firstItem.getCode()); + // verify property "id" + Assertions.assertEquals("myFunction", firstItem.getId()); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListUserEntriesTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListUserEntriesTests.java deleted file mode 100644 index 0636ebd1234c..000000000000 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListUserEntriesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.security.confidentialledger.generated; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class ListUserEntriesTests extends ConfidentialLedgerClientTestBase { - @Test - @Disabled - public void testListUserEntriesTests() { - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = confidentialLedgerClient.listUsers(requestOptions); - Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals( - BinaryData.fromString("{\"assignedRole\":\"Administrator\",\"userId\":\"Certificate object id 1\"}") - .toObject(Object.class), - response.iterator().next().toObject(Object.class)); - } -} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListUsersTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListUsersTests.java new file mode 100644 index 000000000000..13e9a7aff346 --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/ListUsersTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.security.confidentialledger.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.security.confidentialledger.models.ConfidentialLedgerUserRoleName; +import com.azure.security.confidentialledger.models.LedgerUser; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class ListUsersTests extends ConfidentialLedgerClientTestBase { + @Test + @Disabled + public void testListUsersTests() { + // method invocation + PagedIterable response = confidentialLedgerClient.listUsers(); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + LedgerUser firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "assignedRole" + Assertions.assertEquals(ConfidentialLedgerUserRoleName.ADMINISTRATOR, firstItem.getAssignedRole()); + // verify property "userId" + Assertions.assertEquals("Certificate object id 1", firstItem.getUserId()); + } +} diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/UpdateRuntimeOptionsTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/UpdateRuntimeOptionsTests.java index fc1213984014..167a9fd1d27c 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/UpdateRuntimeOptionsTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/UpdateRuntimeOptionsTests.java @@ -1,28 +1,36 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; +import com.azure.security.confidentialledger.models.JsRuntimeOptions; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class UpdateRuntimeOptionsTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testUpdateRuntimeOptionsTests() { - BinaryData jSRuntimeOptions - = BinaryData.fromString("{\"log_exception_details\":false,\"max_execution_time_ms\":1200}"); - RequestOptions requestOptions = new RequestOptions(); - Response response - = confidentialLedgerClient.updateRuntimeOptionsWithResponse(jSRuntimeOptions, requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"log_exception_details\":false,\"max_cached_interpreters\":1024,\"max_execution_time_ms\":1200,\"max_heap_bytes\":1024,\"max_stack_bytes\":1024,\"return_exception_details\":false}") - .toObject(Object.class), response.getValue().toObject(Object.class)); + // method invocation + JsRuntimeOptions response = confidentialLedgerClient.updateRuntimeOptionsStable( + new JsRuntimeOptions().setLogExceptionDetails(false).setMaxExecutionTimeMs(1200L)); + + // response assertion + Assertions.assertNotNull(response); + // verify property "logExceptionDetails" + Assertions.assertEquals(false, response.isLogExceptionDetails()); + // verify property "maxCachedInterpreters" + Assertions.assertEquals(1024L, response.getMaxCachedInterpreters()); + // verify property "maxExecutionTimeMs" + Assertions.assertEquals(1200L, response.getMaxExecutionTimeMs()); + // verify property "maxHeapBytes" + Assertions.assertEquals(1024L, response.getMaxHeapBytes()); + // verify property "maxStackBytes" + Assertions.assertEquals(1024L, response.getMaxStackBytes()); + // verify property "returnExceptionDetails" + Assertions.assertEquals(false, response.isReturnExceptionDetails()); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/UpdateUserDefinedRoleTests.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/UpdateUserDefinedRoleTests.java index e3fdcd191e74..729b5c5ac4eb 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/UpdateUserDefinedRoleTests.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/generated/UpdateUserDefinedRoleTests.java @@ -1,24 +1,36 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.security.confidentialledger.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; +import com.azure.security.confidentialledger.models.Role; +import com.azure.security.confidentialledger.models.UserDefinedRoles; +import java.util.Arrays; +import java.util.List; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +@Disabled public final class UpdateUserDefinedRoleTests extends ConfidentialLedgerClientTestBase { @Test @Disabled public void testUpdateUserDefinedRoleTests() { - BinaryData roles = BinaryData.fromString( - "[{\"roleActions\":[\"Microsoft.ConfidentialLedger/ledger/users/write\"],\"roleName\":\"administrator\"}]"); - RequestOptions requestOptions = new RequestOptions(); - Response response = confidentialLedgerClient.updateUserDefinedRoleWithResponse(roles, requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); + // method invocation + UserDefinedRoles response = confidentialLedgerClient.updateUserDefinedRoleStable( + new UserDefinedRoles().setRoles(Arrays.asList(new Role().setRoleName("administrator") + .setRoleActions(Arrays.asList("Microsoft.ConfidentialLedger/ledger/users/write"))))); + + // response assertion + Assertions.assertNotNull(response); + // verify property "roles" + List responseRoles = response.getRoles(); + Role responseRolesFirstItem = responseRoles.iterator().next(); + Assertions.assertNotNull(responseRolesFirstItem); + Assertions.assertEquals("administrator", responseRolesFirstItem.getRoleName()); + List responseRolesFirstItemRoleActions = responseRolesFirstItem.getRoleActions(); + Assertions.assertEquals("Microsoft.ConfidentialLedger/ledger/users/write", + responseRolesFirstItemRoleActions.iterator().next()); } } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/tsp-location.yaml b/sdk/confidentialledger/azure-security-confidentialledger/tsp-location.yaml new file mode 100644 index 000000000000..06efe0c73fdb --- /dev/null +++ b/sdk/confidentialledger/azure-security-confidentialledger/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/confidentialledger/data-plane/ConfidentialLedger +commit: 29f409cc6290bead39055e215558227bf641914b +repo: Azure/azure-rest-api-specs +additionalDirectories:
Query Parameters