diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 2902a1de31f56..996cfe790a8a7 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -335,6 +335,7 @@ com.azure.resourcemanager:azure-resourcemanager-automanage;1.0.0-beta.1;1.0.0-be com.azure.resourcemanager:azure-resourcemanager-edgeorder;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-securityinsights;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-oep;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-blockchain;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.0.0 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current diff --git a/pom.xml b/pom.xml index 621fa3aedede6..42b87941c0dd3 100644 --- a/pom.xml +++ b/pom.xml @@ -866,6 +866,7 @@ sdk/batch sdk/batchai sdk/billing + sdk/blockchain sdk/boms sdk/botservice sdk/changeanalysis diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/CHANGELOG.md b/sdk/blockchain/azure-resourcemanager-blockchain/CHANGELOG.md new file mode 100644 index 0000000000000..9593a0c130ab0 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-02-09) + +- Azure Resource Manager Blockchain client library for Java. This package contains Microsoft Azure SDK for Blockchain Management SDK. REST API for Azure Blockchain Service. Package tag package-2018-06-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/README.md b/sdk/blockchain/azure-resourcemanager-blockchain/README.md new file mode 100644 index 0000000000000..012af3d4b0bbc --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager Blockchain client library for Java + +Azure Resource Manager Blockchain client library for Java. + +This package contains Microsoft Azure SDK for Blockchain Management SDK. REST API for Azure Blockchain Service. Package tag package-2018-06-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-blockchain;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-blockchain + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +BlockchainManager manager = BlockchainManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/blockchain/azure-resourcemanager-blockchain/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/SAMPLE.md b/sdk/blockchain/azure-resourcemanager-blockchain/SAMPLE.md new file mode 100644 index 0000000000000..f0515b1334170 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/SAMPLE.md @@ -0,0 +1,532 @@ +# Code snippets and samples + + +## BlockchainMemberOperationResults + +- [Get](#blockchainmemberoperationresults_get) + +## BlockchainMembers + +- [Create](#blockchainmembers_create) +- [Delete](#blockchainmembers_delete) +- [GetByResourceGroup](#blockchainmembers_getbyresourcegroup) +- [List](#blockchainmembers_list) +- [ListApiKeys](#blockchainmembers_listapikeys) +- [ListByResourceGroup](#blockchainmembers_listbyresourcegroup) +- [ListConsortiumMembers](#blockchainmembers_listconsortiummembers) +- [ListRegenerateApiKeys](#blockchainmembers_listregenerateapikeys) +- [Update](#blockchainmembers_update) + +## Locations + +- [CheckNameAvailability](#locations_checknameavailability) +- [ListConsortiums](#locations_listconsortiums) + +## Operations + +- [List](#operations_list) + +## Skus + +- [List](#skus_list) + +## TransactionNodes + +- [Create](#transactionnodes_create) +- [Delete](#transactionnodes_delete) +- [Get](#transactionnodes_get) +- [List](#transactionnodes_list) +- [ListApiKeys](#transactionnodes_listapikeys) +- [ListRegenerateApiKeys](#transactionnodes_listregenerateapikeys) +- [Update](#transactionnodes_update) +### BlockchainMemberOperationResults_Get + +```java +import com.azure.core.util.Context; + +/** Samples for BlockchainMemberOperationResults Get. */ +public final class BlockchainMemberOperationResultsGetSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/BlockchainMemberOperationResults_Get.json + */ + /** + * Sample code: BlockchainMemberOperationResults_Get. + * + * @param manager Entry point to BlockchainManager. + */ + public static void blockchainMemberOperationResultsGet( + com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager + .blockchainMemberOperationResults() + .getWithResponse("southeastasia", "12f4b309-01e3-4fcf-bc0b-1cc034ca03f8", Context.NONE); + } +} +``` + +### BlockchainMembers_Create + +```java +import com.azure.resourcemanager.blockchain.models.BlockchainMemberNodesSku; +import com.azure.resourcemanager.blockchain.models.BlockchainProtocol; + +/** Samples for BlockchainMembers Create. */ +public final class BlockchainMembersCreateSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/BlockchainMembers_Create.json + */ + /** + * Sample code: BlockchainMembers_Create. + * + * @param manager Entry point to BlockchainManager. + */ + public static void blockchainMembersCreate(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager + .blockchainMembers() + .define("contosemember1") + .withRegion("southeastasia") + .withExistingResourceGroup("mygroup") + .withProtocol(BlockchainProtocol.QUORUM) + .withValidatorNodesSku(new BlockchainMemberNodesSku().withCapacity(2)) + .withPassword("") + .withConsortium("ContoseConsortium") + .withConsortiumManagementAccountPassword("") + .create(); + } +} +``` + +### BlockchainMembers_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for BlockchainMembers Delete. */ +public final class BlockchainMembersDeleteSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/BlockchainMembers_Delete.json + */ + /** + * Sample code: BlockchainMembers_Delete. + * + * @param manager Entry point to BlockchainManager. + */ + public static void blockchainMembersDelete(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.blockchainMembers().delete("mygroup", "contosemember1", Context.NONE); + } +} +``` + +### BlockchainMembers_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for BlockchainMembers GetByResourceGroup. */ +public final class BlockchainMembersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/BlockchainMembers_Get.json + */ + /** + * Sample code: BlockchainMembers_Get. + * + * @param manager Entry point to BlockchainManager. + */ + public static void blockchainMembersGet(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.blockchainMembers().getByResourceGroupWithResponse("mygroup", "contosemember1", Context.NONE); + } +} +``` + +### BlockchainMembers_List + +```java +import com.azure.core.util.Context; + +/** Samples for BlockchainMembers List. */ +public final class BlockchainMembersListSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/BlockchainMembers_ListAll.json + */ + /** + * Sample code: BlockchainMembers_ListAll. + * + * @param manager Entry point to BlockchainManager. + */ + public static void blockchainMembersListAll(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.blockchainMembers().list(Context.NONE); + } +} +``` + +### BlockchainMembers_ListApiKeys + +```java +import com.azure.core.util.Context; + +/** Samples for BlockchainMembers ListApiKeys. */ +public final class BlockchainMembersListApiKeysSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/BlockchainMembers_ListApiKeys.json + */ + /** + * Sample code: BlockchainMembers_ListApiKeys. + * + * @param manager Entry point to BlockchainManager. + */ + public static void blockchainMembersListApiKeys(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.blockchainMembers().listApiKeysWithResponse("contosemember1", "mygroup", Context.NONE); + } +} +``` + +### BlockchainMembers_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for BlockchainMembers ListByResourceGroup. */ +public final class BlockchainMembersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/BlockchainMembers_List.json + */ + /** + * Sample code: BlockchainMembers_List. + * + * @param manager Entry point to BlockchainManager. + */ + public static void blockchainMembersList(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.blockchainMembers().listByResourceGroup("mygroup", Context.NONE); + } +} +``` + +### BlockchainMembers_ListConsortiumMembers + +```java +import com.azure.core.util.Context; + +/** Samples for BlockchainMembers ListConsortiumMembers. */ +public final class BlockchainMembersListConsortiumMembersSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/BlockchainMembers_ListConsortiumMembers.json + */ + /** + * Sample code: BlockchainMembers_ListConsortiumMembers. + * + * @param manager Entry point to BlockchainManager. + */ + public static void blockchainMembersListConsortiumMembers( + com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.blockchainMembers().listConsortiumMembers("contosemember1", "mygroup", Context.NONE); + } +} +``` + +### BlockchainMembers_ListRegenerateApiKeys + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.blockchain.models.ApiKey; + +/** Samples for BlockchainMembers ListRegenerateApiKeys. */ +public final class BlockchainMembersListRegenerateApiKeysSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/BlockchainMembers_ListRegenerateApiKeys.json + */ + /** + * Sample code: BlockchainMembers_ListRegenerateApiKeys. + * + * @param manager Entry point to BlockchainManager. + */ + public static void blockchainMembersListRegenerateApiKeys( + com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager + .blockchainMembers() + .listRegenerateApiKeysWithResponse( + "contosemember1", "mygroup", new ApiKey().withKeyName("key1"), Context.NONE); + } +} +``` + +### BlockchainMembers_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.blockchain.models.BlockchainMember; + +/** Samples for BlockchainMembers Update. */ +public final class BlockchainMembersUpdateSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/BlockchainMembers_Update.json + */ + /** + * Sample code: BlockchainMembers_Update. + * + * @param manager Entry point to BlockchainManager. + */ + public static void blockchainMembersUpdate(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + BlockchainMember resource = + manager + .blockchainMembers() + .getByResourceGroupWithResponse("mygroup", "ContoseMember1", Context.NONE) + .getValue(); + resource + .update() + .withConsortiumManagementAccountPassword("") + .withPassword("") + .apply(); + } +} +``` + +### Locations_CheckNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.blockchain.models.NameAvailabilityRequest; + +/** Samples for Locations CheckNameAvailability. */ +public final class LocationsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/Locations_CheckNameAvailability.json + */ + /** + * Sample code: Locations_CheckNameAvailability. + * + * @param manager Entry point to BlockchainManager. + */ + public static void locationsCheckNameAvailability(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager + .locations() + .checkNameAvailabilityWithResponse( + "southeastasia", + new NameAvailabilityRequest() + .withName("contosemember1") + .withType("Microsoft.Blockchain/blockchainMembers"), + Context.NONE); + } +} +``` + +### Locations_ListConsortiums + +```java +import com.azure.core.util.Context; + +/** Samples for Locations ListConsortiums. */ +public final class LocationsListConsortiumsSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/Locations_ListConsortiums.json + */ + /** + * Sample code: Locations_ListConsortiums. + * + * @param manager Entry point to BlockchainManager. + */ + public static void locationsListConsortiums(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.locations().listConsortiumsWithResponse("southeastasia", Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/Operations_List.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to BlockchainManager. + */ + public static void operationsList(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### Skus_List + +```java +import com.azure.core.util.Context; + +/** Samples for Skus List. */ +public final class SkusListSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/Skus_List.json + */ + /** + * Sample code: Skus_List. + * + * @param manager Entry point to BlockchainManager. + */ + public static void skusList(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.skus().listWithResponse(Context.NONE); + } +} +``` + +### TransactionNodes_Create + +```java +/** Samples for TransactionNodes Create. */ +public final class TransactionNodesCreateSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/TransactionNodes_Create.json + */ + /** + * Sample code: TransactionNodes_Create. + * + * @param manager Entry point to BlockchainManager. + */ + public static void transactionNodesCreate(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager + .transactionNodes() + .define("txnode2") + .withExistingBlockchainMember("contosemember1", "mygroup") + .withRegion("southeastasia") + .withPassword("") + .create(); + } +} +``` + +### TransactionNodes_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for TransactionNodes Delete. */ +public final class TransactionNodesDeleteSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/TransactionNodes_Delete.json + */ + /** + * Sample code: TransactionNodes_Delete. + * + * @param manager Entry point to BlockchainManager. + */ + public static void transactionNodesDelete(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.transactionNodes().delete("contosemember1", "txNode2", "mygroup", Context.NONE); + } +} +``` + +### TransactionNodes_Get + +```java +import com.azure.core.util.Context; + +/** Samples for TransactionNodes Get. */ +public final class TransactionNodesGetSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/TransactionNodes_Get.json + */ + /** + * Sample code: TransactionNodes_Get. + * + * @param manager Entry point to BlockchainManager. + */ + public static void transactionNodesGet(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.transactionNodes().getWithResponse("contosemember1", "txnode2", "mygroup", Context.NONE); + } +} +``` + +### TransactionNodes_List + +```java +import com.azure.core.util.Context; + +/** Samples for TransactionNodes List. */ +public final class TransactionNodesListSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/TransactionNodes_List.json + */ + /** + * Sample code: TransactionNodes_List. + * + * @param manager Entry point to BlockchainManager. + */ + public static void transactionNodesList(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.transactionNodes().list("contosemember1", "mygroup", Context.NONE); + } +} +``` + +### TransactionNodes_ListApiKeys + +```java +import com.azure.core.util.Context; + +/** Samples for TransactionNodes ListApiKeys. */ +public final class TransactionNodesListApiKeysSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/TransactionNodes_ListApiKeys.json + */ + /** + * Sample code: TransactionNodes_ListApiKeys. + * + * @param manager Entry point to BlockchainManager. + */ + public static void transactionNodesListApiKeys(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.transactionNodes().listApiKeysWithResponse("contosemember1", "txnode2", "mygroup", Context.NONE); + } +} +``` + +### TransactionNodes_ListRegenerateApiKeys + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.blockchain.models.ApiKey; + +/** Samples for TransactionNodes ListRegenerateApiKeys. */ +public final class TransactionNodesListRegenerateApiKeysSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/TransactionNodes_ListRegenerateApiKeys.json + */ + /** + * Sample code: TransactionNodes_ListRegenerateApiKeys. + * + * @param manager Entry point to BlockchainManager. + */ + public static void transactionNodesListRegenerateApiKeys( + com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager + .transactionNodes() + .listRegenerateApiKeysWithResponse( + "contosemember1", "txnode2", "mygroup", new ApiKey().withKeyName("key1"), Context.NONE); + } +} +``` + +### TransactionNodes_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.blockchain.models.TransactionNode; + +/** Samples for TransactionNodes Update. */ +public final class TransactionNodesUpdateSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/TransactionNodes_Update.json + */ + /** + * Sample code: TransactionNodes_Update. + * + * @param manager Entry point to BlockchainManager. + */ + public static void transactionNodesUpdate(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + TransactionNode resource = + manager.transactionNodes().getWithResponse("contosemember1", "txnode2", "mygroup", Context.NONE).getValue(); + resource.update().withPassword("").apply(); + } +} +``` + diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/pom.xml b/sdk/blockchain/azure-resourcemanager-blockchain/pom.xml new file mode 100644 index 0000000000000..d938244898321 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-blockchain + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Blockchain Management + This package contains Microsoft Azure SDK for Blockchain Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. REST API for Azure Blockchain Service. Package tag package-2018-06-01-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.25.0 + + + com.azure + azure-core-management + 1.5.2 + + + diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/BlockchainManager.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/BlockchainManager.java new file mode 100644 index 0000000000000..ccb74c6864a3d --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/BlockchainManager.java @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.fluent.BlockchainManagementClient; +import com.azure.resourcemanager.blockchain.implementation.BlockchainManagementClientBuilder; +import com.azure.resourcemanager.blockchain.implementation.BlockchainMemberOperationResultsImpl; +import com.azure.resourcemanager.blockchain.implementation.BlockchainMembersImpl; +import com.azure.resourcemanager.blockchain.implementation.LocationsImpl; +import com.azure.resourcemanager.blockchain.implementation.OperationsImpl; +import com.azure.resourcemanager.blockchain.implementation.SkusImpl; +import com.azure.resourcemanager.blockchain.implementation.TransactionNodesImpl; +import com.azure.resourcemanager.blockchain.models.BlockchainMemberOperationResults; +import com.azure.resourcemanager.blockchain.models.BlockchainMembers; +import com.azure.resourcemanager.blockchain.models.Locations; +import com.azure.resourcemanager.blockchain.models.Operations; +import com.azure.resourcemanager.blockchain.models.Skus; +import com.azure.resourcemanager.blockchain.models.TransactionNodes; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** Entry point to BlockchainManager. REST API for Azure Blockchain Service. */ +public final class BlockchainManager { + private BlockchainMembers blockchainMembers; + + private BlockchainMemberOperationResults blockchainMemberOperationResults; + + private Locations locations; + + private Operations operations; + + private Skus skus; + + private TransactionNodes transactionNodes; + + private final BlockchainManagementClient clientObject; + + private BlockchainManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new BlockchainManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Blockchain service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Blockchain service API instance. + */ + public static BlockchainManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create BlockchainManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new BlockchainManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Blockchain service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Blockchain service API instance. + */ + public BlockchainManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.blockchain") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new BlockchainManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of BlockchainMembers. */ + public BlockchainMembers blockchainMembers() { + if (this.blockchainMembers == null) { + this.blockchainMembers = new BlockchainMembersImpl(clientObject.getBlockchainMembers(), this); + } + return blockchainMembers; + } + + /** @return Resource collection API of BlockchainMemberOperationResults. */ + public BlockchainMemberOperationResults blockchainMemberOperationResults() { + if (this.blockchainMemberOperationResults == null) { + this.blockchainMemberOperationResults = + new BlockchainMemberOperationResultsImpl(clientObject.getBlockchainMemberOperationResults(), this); + } + return blockchainMemberOperationResults; + } + + /** @return Resource collection API of Locations. */ + public Locations locations() { + if (this.locations == null) { + this.locations = new LocationsImpl(clientObject.getLocations(), this); + } + return locations; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of Skus. */ + public Skus skus() { + if (this.skus == null) { + this.skus = new SkusImpl(clientObject.getSkus(), this); + } + return skus; + } + + /** @return Resource collection API of TransactionNodes. */ + public TransactionNodes transactionNodes() { + if (this.transactionNodes == null) { + this.transactionNodes = new TransactionNodesImpl(clientObject.getTransactionNodes(), this); + } + return transactionNodes; + } + + /** + * @return Wrapped service client BlockchainManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public BlockchainManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/BlockchainManagementClient.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/BlockchainManagementClient.java new file mode 100644 index 0000000000000..059778ff39ac4 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/BlockchainManagementClient.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for BlockchainManagementClient class. */ +public interface BlockchainManagementClient { + /** + * Gets Gets the subscription Id which uniquely identifies the Microsoft Azure subscription. The subscription ID is + * part of the URI for every service call. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the BlockchainMembersClient object to access its operations. + * + * @return the BlockchainMembersClient object. + */ + BlockchainMembersClient getBlockchainMembers(); + + /** + * Gets the BlockchainMemberOperationResultsClient object to access its operations. + * + * @return the BlockchainMemberOperationResultsClient object. + */ + BlockchainMemberOperationResultsClient getBlockchainMemberOperationResults(); + + /** + * Gets the LocationsClient object to access its operations. + * + * @return the LocationsClient object. + */ + LocationsClient getLocations(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + SkusClient getSkus(); + + /** + * Gets the TransactionNodesClient object to access its operations. + * + * @return the TransactionNodesClient object. + */ + TransactionNodesClient getTransactionNodes(); +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/BlockchainMemberOperationResultsClient.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/BlockchainMemberOperationResultsClient.java new file mode 100644 index 0000000000000..d666c35469586 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/BlockchainMemberOperationResultsClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.blockchain.fluent.models.OperationResultInner; + +/** + * An instance of this class provides access to all the operations defined in BlockchainMemberOperationResultsClient. + */ +public interface BlockchainMemberOperationResultsClient { + /** + * Get Async operation result. + * + * @param locationName Location name. + * @param operationId Operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return async operation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationResultInner get(String locationName, String operationId); + + /** + * Get Async operation result. + * + * @param locationName Location name. + * @param operationId Operation Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return async operation result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String locationName, String operationId, Context context); +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/BlockchainMembersClient.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/BlockchainMembersClient.java new file mode 100644 index 0000000000000..66cae29a2af8c --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/BlockchainMembersClient.java @@ -0,0 +1,372 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.blockchain.fluent.models.ApiKeyCollectionInner; +import com.azure.resourcemanager.blockchain.fluent.models.BlockchainMemberInner; +import com.azure.resourcemanager.blockchain.fluent.models.ConsortiumMemberInner; +import com.azure.resourcemanager.blockchain.models.ApiKey; +import com.azure.resourcemanager.blockchain.models.BlockchainMemberUpdate; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BlockchainMembersClient. */ +public interface BlockchainMembersClient { + /** + * Get details about a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about a blockchain member. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlockchainMemberInner getByResourceGroup(String resourceGroupName, String blockchainMemberName); + + /** + * Get details about a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about a blockchain member along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String blockchainMemberName, Context context); + + /** + * Create a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMember Payload to create a blockchain member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BlockchainMemberInner> beginCreate( + String blockchainMemberName, String resourceGroupName, BlockchainMemberInner blockchainMember); + + /** + * Create a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMember Payload to create a blockchain member. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BlockchainMemberInner> beginCreate( + String blockchainMemberName, String resourceGroupName, BlockchainMemberInner blockchainMember, Context context); + + /** + * Create a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMember Payload to create a blockchain member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlockchainMemberInner create( + String blockchainMemberName, String resourceGroupName, BlockchainMemberInner blockchainMember); + + /** + * Create a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlockchainMemberInner create(String blockchainMemberName, String resourceGroupName); + + /** + * Create a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMember Payload to create a blockchain member. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlockchainMemberInner create( + String blockchainMemberName, String resourceGroupName, BlockchainMemberInner blockchainMember, Context context); + + /** + * Delete a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String blockchainMemberName); + + /** + * Delete a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String blockchainMemberName, Context context); + + /** + * Delete a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String blockchainMemberName); + + /** + * Delete a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String blockchainMemberName, Context context); + + /** + * Update a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlockchainMemberInner update(String blockchainMemberName, String resourceGroupName); + + /** + * Update a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMember Payload to update the blockchain member. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String blockchainMemberName, + String resourceGroupName, + BlockchainMemberUpdate blockchainMember, + Context context); + + /** + * Lists the blockchain members for a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists the blockchain members for a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists the blockchain members for a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists the blockchain members for a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists the consortium members for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of consortium payload. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listConsortiumMembers(String blockchainMemberName, String resourceGroupName); + + /** + * Lists the consortium members for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of consortium payload. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listConsortiumMembers( + String blockchainMemberName, String resourceGroupName, Context context); + + /** + * Lists the API keys for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiKeyCollectionInner listApiKeys(String blockchainMemberName, String resourceGroupName); + + /** + * Lists the API keys for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listApiKeysWithResponse( + String blockchainMemberName, String resourceGroupName, Context context); + + /** + * Regenerate the API keys for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiKeyCollectionInner listRegenerateApiKeys(String blockchainMemberName, String resourceGroupName); + + /** + * Regenerate the API keys for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param apiKey api key to be regenerate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listRegenerateApiKeysWithResponse( + String blockchainMemberName, String resourceGroupName, ApiKey apiKey, Context context); +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/LocationsClient.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/LocationsClient.java new file mode 100644 index 0000000000000..ad9d57d0141ec --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/LocationsClient.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.blockchain.fluent.models.ConsortiumCollectionInner; +import com.azure.resourcemanager.blockchain.fluent.models.NameAvailabilityInner; +import com.azure.resourcemanager.blockchain.models.NameAvailabilityRequest; + +/** An instance of this class provides access to all the operations defined in LocationsClient. */ +public interface LocationsClient { + /** + * To check whether a resource name is available. + * + * @param locationName Location Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability payload which is exposed in the response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NameAvailabilityInner checkNameAvailability(String locationName); + + /** + * To check whether a resource name is available. + * + * @param locationName Location Name. + * @param nameAvailabilityRequest Name availability request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability payload which is exposed in the response of the resource provider along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String locationName, NameAvailabilityRequest nameAvailabilityRequest, Context context); + + /** + * Lists the available consortiums for a subscription. + * + * @param locationName Location Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the consortium payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConsortiumCollectionInner listConsortiums(String locationName); + + /** + * Lists the available consortiums for a subscription. + * + * @param locationName Location Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the consortium payload along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listConsortiumsWithResponse(String locationName, Context context); +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/OperationsClient.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/OperationsClient.java new file mode 100644 index 0000000000000..b1365180f1180 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.blockchain.fluent.models.ResourceProviderOperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists the available operations of Microsoft.Blockchain resource provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of operation payload which is exposed in the response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists the available operations of Microsoft.Blockchain resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of operation payload which is exposed in the response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/SkusClient.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/SkusClient.java new file mode 100644 index 0000000000000..c4e7b6129a29e --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/SkusClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.blockchain.fluent.models.ResourceTypeSkuCollectionInner; + +/** An instance of this class provides access to all the operations defined in SkusClient. */ +public interface SkusClient { + /** + * Lists the Skus of the resource type. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the resource type Sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourceTypeSkuCollectionInner list(); + + /** + * Lists the Skus of the resource type. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the resource type Sku along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(Context context); +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/TransactionNodesClient.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/TransactionNodesClient.java new file mode 100644 index 0000000000000..cebc2ddd0482c --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/TransactionNodesClient.java @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.blockchain.fluent.models.ApiKeyCollectionInner; +import com.azure.resourcemanager.blockchain.fluent.models.TransactionNodeInner; +import com.azure.resourcemanager.blockchain.models.ApiKey; +import com.azure.resourcemanager.blockchain.models.TransactionNodeUpdate; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TransactionNodesClient. */ +public interface TransactionNodesClient { + /** + * Get the details of the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the transaction node. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TransactionNodeInner get(String blockchainMemberName, String transactionNodeName, String resourceGroupName); + + /** + * Get the details of the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the transaction node along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String blockchainMemberName, String transactionNodeName, String resourceGroupName, Context context); + + /** + * Create or update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param transactionNode Payload to create the transaction node. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TransactionNodeInner> beginCreate( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + TransactionNodeInner transactionNode); + + /** + * Create or update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param transactionNode Payload to create the transaction node. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TransactionNodeInner> beginCreate( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + TransactionNodeInner transactionNode, + Context context); + + /** + * Create or update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param transactionNode Payload to create the transaction node. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TransactionNodeInner create( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + TransactionNodeInner transactionNode); + + /** + * Create or update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TransactionNodeInner create(String blockchainMemberName, String transactionNodeName, String resourceGroupName); + + /** + * Create or update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param transactionNode Payload to create the transaction node. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TransactionNodeInner create( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + TransactionNodeInner transactionNode, + Context context); + + /** + * Delete the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String blockchainMemberName, String transactionNodeName, String resourceGroupName); + + /** + * Delete the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String blockchainMemberName, String transactionNodeName, String resourceGroupName, Context context); + + /** + * Delete the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String blockchainMemberName, String transactionNodeName, String resourceGroupName); + + /** + * Delete the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String blockchainMemberName, String transactionNodeName, String resourceGroupName, Context context); + + /** + * Update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TransactionNodeInner update(String blockchainMemberName, String transactionNodeName, String resourceGroupName); + + /** + * Update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param transactionNode Payload to create the transaction node. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + TransactionNodeUpdate transactionNode, + Context context); + + /** + * Lists the transaction nodes for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of transaction node payload which is exposed in the request/response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String blockchainMemberName, String resourceGroupName); + + /** + * Lists the transaction nodes for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of transaction node payload which is exposed in the request/response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String blockchainMemberName, String resourceGroupName, Context context); + + /** + * List the API keys for the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiKeyCollectionInner listApiKeys( + String blockchainMemberName, String transactionNodeName, String resourceGroupName); + + /** + * List the API keys for the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listApiKeysWithResponse( + String blockchainMemberName, String transactionNodeName, String resourceGroupName, Context context); + + /** + * Regenerate the API keys for the blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiKeyCollectionInner listRegenerateApiKeys( + String blockchainMemberName, String transactionNodeName, String resourceGroupName); + + /** + * Regenerate the API keys for the blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param apiKey api key to be regenerated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listRegenerateApiKeysWithResponse( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + ApiKey apiKey, + Context context); +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/ApiKeyCollectionInner.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/ApiKeyCollectionInner.java new file mode 100644 index 0000000000000..e35a5a6cf228b --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/ApiKeyCollectionInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.models.ApiKey; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of the API key payload which is exposed in the response of the resource provider. */ +@Fluent +public final class ApiKeyCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiKeyCollectionInner.class); + + /* + * Gets or sets the collection of API key. + */ + @JsonProperty(value = "keys") + private List keys; + + /** + * Get the keys property: Gets or sets the collection of API key. + * + * @return the keys value. + */ + public List keys() { + return this.keys; + } + + /** + * Set the keys property: Gets or sets the collection of API key. + * + * @param keys the keys value to set. + * @return the ApiKeyCollectionInner object itself. + */ + public ApiKeyCollectionInner withKeys(List keys) { + this.keys = keys; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keys() != null) { + keys().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/BlockchainMemberInner.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/BlockchainMemberInner.java new file mode 100644 index 0000000000000..287cebaf97326 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/BlockchainMemberInner.java @@ -0,0 +1,331 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.models.BlockchainMemberNodesSku; +import com.azure.resourcemanager.blockchain.models.BlockchainMemberProvisioningState; +import com.azure.resourcemanager.blockchain.models.BlockchainProtocol; +import com.azure.resourcemanager.blockchain.models.FirewallRule; +import com.azure.resourcemanager.blockchain.models.Sku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Payload of the blockchain member which is exposed in the request/response of the resource provider. */ +@Fluent +public final class BlockchainMemberInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BlockchainMemberInner.class); + + /* + * Gets or sets the blockchain member properties. + */ + @JsonProperty(value = "properties") + private BlockchainMemberProperties innerProperties; + + /* + * Gets or sets the blockchain member Sku. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the innerProperties property: Gets or sets the blockchain member properties. + * + * @return the innerProperties value. + */ + private BlockchainMemberProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the sku property: Gets or sets the blockchain member Sku. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Gets or sets the blockchain member Sku. + * + * @param sku the sku value to set. + * @return the BlockchainMemberInner object itself. + */ + public BlockchainMemberInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** {@inheritDoc} */ + @Override + public BlockchainMemberInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public BlockchainMemberInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the protocol property: Gets or sets the blockchain protocol. + * + * @return the protocol value. + */ + public BlockchainProtocol protocol() { + return this.innerProperties() == null ? null : this.innerProperties().protocol(); + } + + /** + * Set the protocol property: Gets or sets the blockchain protocol. + * + * @param protocol the protocol value to set. + * @return the BlockchainMemberInner object itself. + */ + public BlockchainMemberInner withProtocol(BlockchainProtocol protocol) { + if (this.innerProperties() == null) { + this.innerProperties = new BlockchainMemberProperties(); + } + this.innerProperties().withProtocol(protocol); + return this; + } + + /** + * Get the validatorNodesSku property: Gets or sets the blockchain validator nodes Sku. + * + * @return the validatorNodesSku value. + */ + public BlockchainMemberNodesSku validatorNodesSku() { + return this.innerProperties() == null ? null : this.innerProperties().validatorNodesSku(); + } + + /** + * Set the validatorNodesSku property: Gets or sets the blockchain validator nodes Sku. + * + * @param validatorNodesSku the validatorNodesSku value to set. + * @return the BlockchainMemberInner object itself. + */ + public BlockchainMemberInner withValidatorNodesSku(BlockchainMemberNodesSku validatorNodesSku) { + if (this.innerProperties() == null) { + this.innerProperties = new BlockchainMemberProperties(); + } + this.innerProperties().withValidatorNodesSku(validatorNodesSku); + return this; + } + + /** + * Get the provisioningState property: Gets or sets the blockchain member provision state. + * + * @return the provisioningState value. + */ + public BlockchainMemberProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the dns property: Gets the dns endpoint of the blockchain member. + * + * @return the dns value. + */ + public String dns() { + return this.innerProperties() == null ? null : this.innerProperties().dns(); + } + + /** + * Get the username property: Gets the auth user name of the blockchain member. + * + * @return the username value. + */ + public String username() { + return this.innerProperties() == null ? null : this.innerProperties().username(); + } + + /** + * Get the password property: Sets the basic auth password of the blockchain member. + * + * @return the password value. + */ + public String password() { + return this.innerProperties() == null ? null : this.innerProperties().password(); + } + + /** + * Set the password property: Sets the basic auth password of the blockchain member. + * + * @param password the password value to set. + * @return the BlockchainMemberInner object itself. + */ + public BlockchainMemberInner withPassword(String password) { + if (this.innerProperties() == null) { + this.innerProperties = new BlockchainMemberProperties(); + } + this.innerProperties().withPassword(password); + return this; + } + + /** + * Get the consortium property: Gets or sets the consortium for the blockchain member. + * + * @return the consortium value. + */ + public String consortium() { + return this.innerProperties() == null ? null : this.innerProperties().consortium(); + } + + /** + * Set the consortium property: Gets or sets the consortium for the blockchain member. + * + * @param consortium the consortium value to set. + * @return the BlockchainMemberInner object itself. + */ + public BlockchainMemberInner withConsortium(String consortium) { + if (this.innerProperties() == null) { + this.innerProperties = new BlockchainMemberProperties(); + } + this.innerProperties().withConsortium(consortium); + return this; + } + + /** + * Get the consortiumManagementAccountAddress property: Gets the managed consortium management account address. + * + * @return the consortiumManagementAccountAddress value. + */ + public String consortiumManagementAccountAddress() { + return this.innerProperties() == null ? null : this.innerProperties().consortiumManagementAccountAddress(); + } + + /** + * Get the consortiumManagementAccountPassword property: Sets the managed consortium management account password. + * + * @return the consortiumManagementAccountPassword value. + */ + public String consortiumManagementAccountPassword() { + return this.innerProperties() == null ? null : this.innerProperties().consortiumManagementAccountPassword(); + } + + /** + * Set the consortiumManagementAccountPassword property: Sets the managed consortium management account password. + * + * @param consortiumManagementAccountPassword the consortiumManagementAccountPassword value to set. + * @return the BlockchainMemberInner object itself. + */ + public BlockchainMemberInner withConsortiumManagementAccountPassword(String consortiumManagementAccountPassword) { + if (this.innerProperties() == null) { + this.innerProperties = new BlockchainMemberProperties(); + } + this.innerProperties().withConsortiumManagementAccountPassword(consortiumManagementAccountPassword); + return this; + } + + /** + * Get the consortiumRole property: Gets the role of the member in the consortium. + * + * @return the consortiumRole value. + */ + public String consortiumRole() { + return this.innerProperties() == null ? null : this.innerProperties().consortiumRole(); + } + + /** + * Set the consortiumRole property: Gets the role of the member in the consortium. + * + * @param consortiumRole the consortiumRole value to set. + * @return the BlockchainMemberInner object itself. + */ + public BlockchainMemberInner withConsortiumRole(String consortiumRole) { + if (this.innerProperties() == null) { + this.innerProperties = new BlockchainMemberProperties(); + } + this.innerProperties().withConsortiumRole(consortiumRole); + return this; + } + + /** + * Get the consortiumMemberDisplayName property: Gets the display name of the member in the consortium. + * + * @return the consortiumMemberDisplayName value. + */ + public String consortiumMemberDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().consortiumMemberDisplayName(); + } + + /** + * Set the consortiumMemberDisplayName property: Gets the display name of the member in the consortium. + * + * @param consortiumMemberDisplayName the consortiumMemberDisplayName value to set. + * @return the BlockchainMemberInner object itself. + */ + public BlockchainMemberInner withConsortiumMemberDisplayName(String consortiumMemberDisplayName) { + if (this.innerProperties() == null) { + this.innerProperties = new BlockchainMemberProperties(); + } + this.innerProperties().withConsortiumMemberDisplayName(consortiumMemberDisplayName); + return this; + } + + /** + * Get the rootContractAddress property: Gets the Ethereum root contract address of the blockchain. + * + * @return the rootContractAddress value. + */ + public String rootContractAddress() { + return this.innerProperties() == null ? null : this.innerProperties().rootContractAddress(); + } + + /** + * Get the publicKey property: Gets the public key of the blockchain member (default transaction node). + * + * @return the publicKey value. + */ + public String publicKey() { + return this.innerProperties() == null ? null : this.innerProperties().publicKey(); + } + + /** + * Get the firewallRules property: Gets or sets firewall rules. + * + * @return the firewallRules value. + */ + public List firewallRules() { + return this.innerProperties() == null ? null : this.innerProperties().firewallRules(); + } + + /** + * Set the firewallRules property: Gets or sets firewall rules. + * + * @param firewallRules the firewallRules value to set. + * @return the BlockchainMemberInner object itself. + */ + public BlockchainMemberInner withFirewallRules(List firewallRules) { + if (this.innerProperties() == null) { + this.innerProperties = new BlockchainMemberProperties(); + } + this.innerProperties().withFirewallRules(firewallRules); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/BlockchainMemberProperties.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/BlockchainMemberProperties.java new file mode 100644 index 0000000000000..9e0cc07b68a74 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/BlockchainMemberProperties.java @@ -0,0 +1,334 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.models.BlockchainMemberNodesSku; +import com.azure.resourcemanager.blockchain.models.BlockchainMemberProvisioningState; +import com.azure.resourcemanager.blockchain.models.BlockchainProtocol; +import com.azure.resourcemanager.blockchain.models.FirewallRule; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Payload of the blockchain member properties for a blockchain member. */ +@Fluent +public final class BlockchainMemberProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BlockchainMemberProperties.class); + + /* + * Gets or sets the blockchain protocol. + */ + @JsonProperty(value = "protocol") + private BlockchainProtocol protocol; + + /* + * Gets or sets the blockchain validator nodes Sku. + */ + @JsonProperty(value = "validatorNodesSku") + private BlockchainMemberNodesSku validatorNodesSku; + + /* + * Gets or sets the blockchain member provision state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private BlockchainMemberProvisioningState provisioningState; + + /* + * Gets the dns endpoint of the blockchain member. + */ + @JsonProperty(value = "dns", access = JsonProperty.Access.WRITE_ONLY) + private String dns; + + /* + * Gets the auth user name of the blockchain member. + */ + @JsonProperty(value = "userName", access = JsonProperty.Access.WRITE_ONLY) + private String username; + + /* + * Sets the basic auth password of the blockchain member. + */ + @JsonProperty(value = "password") + private String password; + + /* + * Gets or sets the consortium for the blockchain member. + */ + @JsonProperty(value = "consortium") + private String consortium; + + /* + * Gets the managed consortium management account address. + */ + @JsonProperty(value = "consortiumManagementAccountAddress", access = JsonProperty.Access.WRITE_ONLY) + private String consortiumManagementAccountAddress; + + /* + * Sets the managed consortium management account password. + */ + @JsonProperty(value = "consortiumManagementAccountPassword") + private String consortiumManagementAccountPassword; + + /* + * Gets the role of the member in the consortium. + */ + @JsonProperty(value = "consortiumRole") + private String consortiumRole; + + /* + * Gets the display name of the member in the consortium. + */ + @JsonProperty(value = "consortiumMemberDisplayName") + private String consortiumMemberDisplayName; + + /* + * Gets the Ethereum root contract address of the blockchain. + */ + @JsonProperty(value = "rootContractAddress", access = JsonProperty.Access.WRITE_ONLY) + private String rootContractAddress; + + /* + * Gets the public key of the blockchain member (default transaction node). + */ + @JsonProperty(value = "publicKey", access = JsonProperty.Access.WRITE_ONLY) + private String publicKey; + + /* + * Gets or sets firewall rules + */ + @JsonProperty(value = "firewallRules") + private List firewallRules; + + /** + * Get the protocol property: Gets or sets the blockchain protocol. + * + * @return the protocol value. + */ + public BlockchainProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Gets or sets the blockchain protocol. + * + * @param protocol the protocol value to set. + * @return the BlockchainMemberProperties object itself. + */ + public BlockchainMemberProperties withProtocol(BlockchainProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the validatorNodesSku property: Gets or sets the blockchain validator nodes Sku. + * + * @return the validatorNodesSku value. + */ + public BlockchainMemberNodesSku validatorNodesSku() { + return this.validatorNodesSku; + } + + /** + * Set the validatorNodesSku property: Gets or sets the blockchain validator nodes Sku. + * + * @param validatorNodesSku the validatorNodesSku value to set. + * @return the BlockchainMemberProperties object itself. + */ + public BlockchainMemberProperties withValidatorNodesSku(BlockchainMemberNodesSku validatorNodesSku) { + this.validatorNodesSku = validatorNodesSku; + return this; + } + + /** + * Get the provisioningState property: Gets or sets the blockchain member provision state. + * + * @return the provisioningState value. + */ + public BlockchainMemberProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the dns property: Gets the dns endpoint of the blockchain member. + * + * @return the dns value. + */ + public String dns() { + return this.dns; + } + + /** + * Get the username property: Gets the auth user name of the blockchain member. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Get the password property: Sets the basic auth password of the blockchain member. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Sets the basic auth password of the blockchain member. + * + * @param password the password value to set. + * @return the BlockchainMemberProperties object itself. + */ + public BlockchainMemberProperties withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the consortium property: Gets or sets the consortium for the blockchain member. + * + * @return the consortium value. + */ + public String consortium() { + return this.consortium; + } + + /** + * Set the consortium property: Gets or sets the consortium for the blockchain member. + * + * @param consortium the consortium value to set. + * @return the BlockchainMemberProperties object itself. + */ + public BlockchainMemberProperties withConsortium(String consortium) { + this.consortium = consortium; + return this; + } + + /** + * Get the consortiumManagementAccountAddress property: Gets the managed consortium management account address. + * + * @return the consortiumManagementAccountAddress value. + */ + public String consortiumManagementAccountAddress() { + return this.consortiumManagementAccountAddress; + } + + /** + * Get the consortiumManagementAccountPassword property: Sets the managed consortium management account password. + * + * @return the consortiumManagementAccountPassword value. + */ + public String consortiumManagementAccountPassword() { + return this.consortiumManagementAccountPassword; + } + + /** + * Set the consortiumManagementAccountPassword property: Sets the managed consortium management account password. + * + * @param consortiumManagementAccountPassword the consortiumManagementAccountPassword value to set. + * @return the BlockchainMemberProperties object itself. + */ + public BlockchainMemberProperties withConsortiumManagementAccountPassword( + String consortiumManagementAccountPassword) { + this.consortiumManagementAccountPassword = consortiumManagementAccountPassword; + return this; + } + + /** + * Get the consortiumRole property: Gets the role of the member in the consortium. + * + * @return the consortiumRole value. + */ + public String consortiumRole() { + return this.consortiumRole; + } + + /** + * Set the consortiumRole property: Gets the role of the member in the consortium. + * + * @param consortiumRole the consortiumRole value to set. + * @return the BlockchainMemberProperties object itself. + */ + public BlockchainMemberProperties withConsortiumRole(String consortiumRole) { + this.consortiumRole = consortiumRole; + return this; + } + + /** + * Get the consortiumMemberDisplayName property: Gets the display name of the member in the consortium. + * + * @return the consortiumMemberDisplayName value. + */ + public String consortiumMemberDisplayName() { + return this.consortiumMemberDisplayName; + } + + /** + * Set the consortiumMemberDisplayName property: Gets the display name of the member in the consortium. + * + * @param consortiumMemberDisplayName the consortiumMemberDisplayName value to set. + * @return the BlockchainMemberProperties object itself. + */ + public BlockchainMemberProperties withConsortiumMemberDisplayName(String consortiumMemberDisplayName) { + this.consortiumMemberDisplayName = consortiumMemberDisplayName; + return this; + } + + /** + * Get the rootContractAddress property: Gets the Ethereum root contract address of the blockchain. + * + * @return the rootContractAddress value. + */ + public String rootContractAddress() { + return this.rootContractAddress; + } + + /** + * Get the publicKey property: Gets the public key of the blockchain member (default transaction node). + * + * @return the publicKey value. + */ + public String publicKey() { + return this.publicKey; + } + + /** + * Get the firewallRules property: Gets or sets firewall rules. + * + * @return the firewallRules value. + */ + public List firewallRules() { + return this.firewallRules; + } + + /** + * Set the firewallRules property: Gets or sets firewall rules. + * + * @param firewallRules the firewallRules value to set. + * @return the BlockchainMemberProperties object itself. + */ + public BlockchainMemberProperties withFirewallRules(List firewallRules) { + this.firewallRules = firewallRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validatorNodesSku() != null) { + validatorNodesSku().validate(); + } + if (firewallRules() != null) { + firewallRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/BlockchainMemberPropertiesUpdate.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/BlockchainMemberPropertiesUpdate.java new file mode 100644 index 0000000000000..2756a4d4f66f5 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/BlockchainMemberPropertiesUpdate.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.models.FirewallRule; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Update the payload of the blockchain member properties for a blockchain member. */ +@Fluent +public final class BlockchainMemberPropertiesUpdate extends TransactionNodePropertiesUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BlockchainMemberPropertiesUpdate.class); + + /* + * Sets the managed consortium management account password. + */ + @JsonProperty(value = "consortiumManagementAccountPassword") + private String consortiumManagementAccountPassword; + + /** + * Get the consortiumManagementAccountPassword property: Sets the managed consortium management account password. + * + * @return the consortiumManagementAccountPassword value. + */ + public String consortiumManagementAccountPassword() { + return this.consortiumManagementAccountPassword; + } + + /** + * Set the consortiumManagementAccountPassword property: Sets the managed consortium management account password. + * + * @param consortiumManagementAccountPassword the consortiumManagementAccountPassword value to set. + * @return the BlockchainMemberPropertiesUpdate object itself. + */ + public BlockchainMemberPropertiesUpdate withConsortiumManagementAccountPassword( + String consortiumManagementAccountPassword) { + this.consortiumManagementAccountPassword = consortiumManagementAccountPassword; + return this; + } + + /** {@inheritDoc} */ + @Override + public BlockchainMemberPropertiesUpdate withPassword(String password) { + super.withPassword(password); + return this; + } + + /** {@inheritDoc} */ + @Override + public BlockchainMemberPropertiesUpdate withFirewallRules(List firewallRules) { + super.withFirewallRules(firewallRules); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/ConsortiumCollectionInner.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/ConsortiumCollectionInner.java new file mode 100644 index 0000000000000..f014c9703b96d --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/ConsortiumCollectionInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.models.Consortium; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of the consortium payload. */ +@Fluent +public final class ConsortiumCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConsortiumCollectionInner.class); + + /* + * Gets or sets the collection of consortiums. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Gets or sets the collection of consortiums. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets the collection of consortiums. + * + * @param value the value value to set. + * @return the ConsortiumCollectionInner object itself. + */ + public ConsortiumCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/ConsortiumMemberInner.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/ConsortiumMemberInner.java new file mode 100644 index 0000000000000..10c5f1c5cd270 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/ConsortiumMemberInner.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Consortium approval. */ +@Fluent +public final class ConsortiumMemberInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConsortiumMemberInner.class); + + /* + * Gets the consortium member name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets the consortium member display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Gets the consortium member subscription id. + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + + /* + * Gets the consortium member role. + */ + @JsonProperty(value = "role") + private String role; + + /* + * Gets the consortium member status. + */ + @JsonProperty(value = "status") + private String status; + + /* + * Gets the consortium member join date. + */ + @JsonProperty(value = "joinDate") + private OffsetDateTime joinDate; + + /* + * Gets the consortium member modified date. + */ + @JsonProperty(value = "dateModified") + private OffsetDateTime dateModified; + + /** + * Get the name property: Gets the consortium member name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets the consortium member name. + * + * @param name the name value to set. + * @return the ConsortiumMemberInner object itself. + */ + public ConsortiumMemberInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Gets the consortium member display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Gets the consortium member display name. + * + * @param displayName the displayName value to set. + * @return the ConsortiumMemberInner object itself. + */ + public ConsortiumMemberInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the subscriptionId property: Gets the consortium member subscription id. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Gets the consortium member subscription id. + * + * @param subscriptionId the subscriptionId value to set. + * @return the ConsortiumMemberInner object itself. + */ + public ConsortiumMemberInner withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the role property: Gets the consortium member role. + * + * @return the role value. + */ + public String role() { + return this.role; + } + + /** + * Set the role property: Gets the consortium member role. + * + * @param role the role value to set. + * @return the ConsortiumMemberInner object itself. + */ + public ConsortiumMemberInner withRole(String role) { + this.role = role; + return this; + } + + /** + * Get the status property: Gets the consortium member status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Gets the consortium member status. + * + * @param status the status value to set. + * @return the ConsortiumMemberInner object itself. + */ + public ConsortiumMemberInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the joinDate property: Gets the consortium member join date. + * + * @return the joinDate value. + */ + public OffsetDateTime joinDate() { + return this.joinDate; + } + + /** + * Set the joinDate property: Gets the consortium member join date. + * + * @param joinDate the joinDate value to set. + * @return the ConsortiumMemberInner object itself. + */ + public ConsortiumMemberInner withJoinDate(OffsetDateTime joinDate) { + this.joinDate = joinDate; + return this; + } + + /** + * Get the dateModified property: Gets the consortium member modified date. + * + * @return the dateModified value. + */ + public OffsetDateTime dateModified() { + return this.dateModified; + } + + /** + * Set the dateModified property: Gets the consortium member modified date. + * + * @param dateModified the dateModified value to set. + * @return the ConsortiumMemberInner object itself. + */ + public ConsortiumMemberInner withDateModified(OffsetDateTime dateModified) { + this.dateModified = dateModified; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/NameAvailabilityInner.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/NameAvailabilityInner.java new file mode 100644 index 0000000000000..ac7a1b684058b --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/NameAvailabilityInner.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.models.NameAvailabilityReason; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Name availability payload which is exposed in the response of the resource provider. */ +@Fluent +public final class NameAvailabilityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NameAvailabilityInner.class); + + /* + * Gets or sets the value indicating whether the name is available. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /* + * Gets or sets the message. + */ + @JsonProperty(value = "message") + private String message; + + /* + * Gets or sets the name availability reason. + */ + @JsonProperty(value = "reason") + private NameAvailabilityReason reason; + + /** + * Get the nameAvailable property: Gets or sets the value indicating whether the name is available. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the nameAvailable property: Gets or sets the value indicating whether the name is available. + * + * @param nameAvailable the nameAvailable value to set. + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the message property: Gets or sets the message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Gets or sets the message. + * + * @param message the message value to set. + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the reason property: Gets or sets the name availability reason. + * + * @return the reason value. + */ + public NameAvailabilityReason reason() { + return this.reason; + } + + /** + * Set the reason property: Gets or sets the name availability reason. + * + * @param reason the reason value to set. + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withReason(NameAvailabilityReason reason) { + this.reason = reason; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/OperationResultInner.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/OperationResultInner.java new file mode 100644 index 0000000000000..e27d51147e274 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/OperationResultInner.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Operation result payload which is exposed in the response of the resource provider. */ +@Fluent +public final class OperationResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationResultInner.class); + + /* + * Gets or sets the operation name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets or sets the operation start time. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * Gets or sets the operation end time. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /** + * Get the name property: Gets or sets the operation name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or sets the operation name. + * + * @param name the name value to set. + * @return the OperationResultInner object itself. + */ + public OperationResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the startTime property: Gets or sets the operation start time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Gets or sets the operation start time. + * + * @param startTime the startTime value to set. + * @return the OperationResultInner object itself. + */ + public OperationResultInner withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: Gets or sets the operation end time. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: Gets or sets the operation end time. + * + * @param endTime the endTime value to set. + * @return the OperationResultInner object itself. + */ + public OperationResultInner withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/ResourceProviderOperationInner.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/ResourceProviderOperationInner.java new file mode 100644 index 0000000000000..6e2434e09e815 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/ResourceProviderOperationInner.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.models.ResourceProviderOperationDisplay; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operation payload which is exposed in the response of the resource provider. */ +@Fluent +public final class ResourceProviderOperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProviderOperationInner.class); + + /* + * Gets or sets the origin. + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Gets or sets the operation name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets or sets a value indicating whether the operation is a data action + * or not. + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /* + * Gets or sets operation display + */ + @JsonProperty(value = "display") + private ResourceProviderOperationDisplay display; + + /** + * Get the origin property: Gets or sets the origin. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: Gets or sets the origin. + * + * @param origin the origin value to set. + * @return the ResourceProviderOperationInner object itself. + */ + public ResourceProviderOperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the name property: Gets or sets the operation name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or sets the operation name. + * + * @param name the name value to set. + * @return the ResourceProviderOperationInner object itself. + */ + public ResourceProviderOperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the isDataAction property: Gets or sets a value indicating whether the operation is a data action or not. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Gets or sets a value indicating whether the operation is a data action or not. + * + * @param isDataAction the isDataAction value to set. + * @return the ResourceProviderOperationInner object itself. + */ + public ResourceProviderOperationInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the display property: Gets or sets operation display. + * + * @return the display value. + */ + public ResourceProviderOperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Gets or sets operation display. + * + * @param display the display value to set. + * @return the ResourceProviderOperationInner object itself. + */ + public ResourceProviderOperationInner withDisplay(ResourceProviderOperationDisplay display) { + this.display = display; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/ResourceTypeSkuCollectionInner.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/ResourceTypeSkuCollectionInner.java new file mode 100644 index 0000000000000..3fc0005a8a307 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/ResourceTypeSkuCollectionInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.models.ResourceTypeSku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of the resource type Sku. */ +@Fluent +public final class ResourceTypeSkuCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceTypeSkuCollectionInner.class); + + /* + * Gets or sets the collection of resource type Sku. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Gets or sets the collection of resource type Sku. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets the collection of resource type Sku. + * + * @param value the value value to set. + * @return the ResourceTypeSkuCollectionInner object itself. + */ + public ResourceTypeSkuCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/TransactionNodeInner.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/TransactionNodeInner.java new file mode 100644 index 0000000000000..35cab125c8dcf --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/TransactionNodeInner.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.models.FirewallRule; +import com.azure.resourcemanager.blockchain.models.NodeProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Payload of the transaction node which is the request/response of the resource provider. */ +@Fluent +public final class TransactionNodeInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TransactionNodeInner.class); + + /* + * Gets or sets the transaction node location. + */ + @JsonProperty(value = "location") + private String location; + + /* + * Gets or sets the blockchain member properties. + */ + @JsonProperty(value = "properties") + private TransactionNodeProperties innerProperties; + + /** + * Get the location property: Gets or sets the transaction node location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Gets or sets the transaction node location. + * + * @param location the location value to set. + * @return the TransactionNodeInner object itself. + */ + public TransactionNodeInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the innerProperties property: Gets or sets the blockchain member properties. + * + * @return the innerProperties value. + */ + private TransactionNodeProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the provisioningState property: Gets or sets the blockchain member provision state. + * + * @return the provisioningState value. + */ + public NodeProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the dns property: Gets or sets the transaction node dns endpoint. + * + * @return the dns value. + */ + public String dns() { + return this.innerProperties() == null ? null : this.innerProperties().dns(); + } + + /** + * Get the publicKey property: Gets or sets the transaction node public key. + * + * @return the publicKey value. + */ + public String publicKey() { + return this.innerProperties() == null ? null : this.innerProperties().publicKey(); + } + + /** + * Get the username property: Gets or sets the transaction node dns endpoint basic auth user name. + * + * @return the username value. + */ + public String username() { + return this.innerProperties() == null ? null : this.innerProperties().username(); + } + + /** + * Get the password property: Sets the transaction node dns endpoint basic auth password. + * + * @return the password value. + */ + public String password() { + return this.innerProperties() == null ? null : this.innerProperties().password(); + } + + /** + * Set the password property: Sets the transaction node dns endpoint basic auth password. + * + * @param password the password value to set. + * @return the TransactionNodeInner object itself. + */ + public TransactionNodeInner withPassword(String password) { + if (this.innerProperties() == null) { + this.innerProperties = new TransactionNodeProperties(); + } + this.innerProperties().withPassword(password); + return this; + } + + /** + * Get the firewallRules property: Gets or sets the firewall rules. + * + * @return the firewallRules value. + */ + public List firewallRules() { + return this.innerProperties() == null ? null : this.innerProperties().firewallRules(); + } + + /** + * Set the firewallRules property: Gets or sets the firewall rules. + * + * @param firewallRules the firewallRules value to set. + * @return the TransactionNodeInner object itself. + */ + public TransactionNodeInner withFirewallRules(List firewallRules) { + if (this.innerProperties() == null) { + this.innerProperties = new TransactionNodeProperties(); + } + this.innerProperties().withFirewallRules(firewallRules); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/TransactionNodeProperties.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/TransactionNodeProperties.java new file mode 100644 index 0000000000000..28fb72268e64f --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/TransactionNodeProperties.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.models.FirewallRule; +import com.azure.resourcemanager.blockchain.models.NodeProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Payload of transaction node properties payload in the transaction node payload. */ +@Fluent +public final class TransactionNodeProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TransactionNodeProperties.class); + + /* + * Gets or sets the blockchain member provision state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private NodeProvisioningState provisioningState; + + /* + * Gets or sets the transaction node dns endpoint. + */ + @JsonProperty(value = "dns", access = JsonProperty.Access.WRITE_ONLY) + private String dns; + + /* + * Gets or sets the transaction node public key. + */ + @JsonProperty(value = "publicKey", access = JsonProperty.Access.WRITE_ONLY) + private String publicKey; + + /* + * Gets or sets the transaction node dns endpoint basic auth user name. + */ + @JsonProperty(value = "userName", access = JsonProperty.Access.WRITE_ONLY) + private String username; + + /* + * Sets the transaction node dns endpoint basic auth password. + */ + @JsonProperty(value = "password") + private String password; + + /* + * Gets or sets the firewall rules. + */ + @JsonProperty(value = "firewallRules") + private List firewallRules; + + /** + * Get the provisioningState property: Gets or sets the blockchain member provision state. + * + * @return the provisioningState value. + */ + public NodeProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the dns property: Gets or sets the transaction node dns endpoint. + * + * @return the dns value. + */ + public String dns() { + return this.dns; + } + + /** + * Get the publicKey property: Gets or sets the transaction node public key. + * + * @return the publicKey value. + */ + public String publicKey() { + return this.publicKey; + } + + /** + * Get the username property: Gets or sets the transaction node dns endpoint basic auth user name. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Get the password property: Sets the transaction node dns endpoint basic auth password. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Sets the transaction node dns endpoint basic auth password. + * + * @param password the password value to set. + * @return the TransactionNodeProperties object itself. + */ + public TransactionNodeProperties withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the firewallRules property: Gets or sets the firewall rules. + * + * @return the firewallRules value. + */ + public List firewallRules() { + return this.firewallRules; + } + + /** + * Set the firewallRules property: Gets or sets the firewall rules. + * + * @param firewallRules the firewallRules value to set. + * @return the TransactionNodeProperties object itself. + */ + public TransactionNodeProperties withFirewallRules(List firewallRules) { + this.firewallRules = firewallRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (firewallRules() != null) { + firewallRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/TransactionNodePropertiesUpdate.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/TransactionNodePropertiesUpdate.java new file mode 100644 index 0000000000000..428695079e504 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/TransactionNodePropertiesUpdate.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.models.FirewallRule; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Update the payload of the transaction node properties in the transaction node payload. */ +@Fluent +public class TransactionNodePropertiesUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TransactionNodePropertiesUpdate.class); + + /* + * Sets the transaction node dns endpoint basic auth password. + */ + @JsonProperty(value = "password") + private String password; + + /* + * Gets or sets the firewall rules. + */ + @JsonProperty(value = "firewallRules") + private List firewallRules; + + /** + * Get the password property: Sets the transaction node dns endpoint basic auth password. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Sets the transaction node dns endpoint basic auth password. + * + * @param password the password value to set. + * @return the TransactionNodePropertiesUpdate object itself. + */ + public TransactionNodePropertiesUpdate withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the firewallRules property: Gets or sets the firewall rules. + * + * @return the firewallRules value. + */ + public List firewallRules() { + return this.firewallRules; + } + + /** + * Set the firewallRules property: Gets or sets the firewall rules. + * + * @param firewallRules the firewallRules value to set. + * @return the TransactionNodePropertiesUpdate object itself. + */ + public TransactionNodePropertiesUpdate withFirewallRules(List firewallRules) { + this.firewallRules = firewallRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (firewallRules() != null) { + firewallRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/package-info.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/package-info.java new file mode 100644 index 0000000000000..06451f36ccb87 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for BlockchainManagementClient. REST API for Azure Blockchain Service. */ +package com.azure.resourcemanager.blockchain.fluent.models; diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/package-info.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/package-info.java new file mode 100644 index 0000000000000..fe5535b55fb48 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for BlockchainManagementClient. REST API for Azure Blockchain Service. */ +package com.azure.resourcemanager.blockchain.fluent; diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/ApiKeyCollectionImpl.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/ApiKeyCollectionImpl.java new file mode 100644 index 0000000000000..25ab1dfa4fd6a --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/ApiKeyCollectionImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.resourcemanager.blockchain.fluent.models.ApiKeyCollectionInner; +import com.azure.resourcemanager.blockchain.models.ApiKey; +import com.azure.resourcemanager.blockchain.models.ApiKeyCollection; +import java.util.Collections; +import java.util.List; + +public final class ApiKeyCollectionImpl implements ApiKeyCollection { + private ApiKeyCollectionInner innerObject; + + private final com.azure.resourcemanager.blockchain.BlockchainManager serviceManager; + + ApiKeyCollectionImpl( + ApiKeyCollectionInner innerObject, com.azure.resourcemanager.blockchain.BlockchainManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List keys() { + List inner = this.innerModel().keys(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ApiKeyCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.blockchain.BlockchainManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/BlockchainManagementClientBuilder.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/BlockchainManagementClientBuilder.java new file mode 100644 index 0000000000000..7e1a6dae58d50 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/BlockchainManagementClientBuilder.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the BlockchainManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {BlockchainManagementClientImpl.class}) +public final class BlockchainManagementClientBuilder { + /* + * Gets the subscription Id which uniquely identifies the Microsoft Azure + * subscription. The subscription ID is part of the URI for every service + * call. + */ + private String subscriptionId; + + /** + * Sets Gets the subscription Id which uniquely identifies the Microsoft Azure subscription. The subscription ID is + * part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the BlockchainManagementClientBuilder. + */ + public BlockchainManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the BlockchainManagementClientBuilder. + */ + public BlockchainManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the BlockchainManagementClientBuilder. + */ + public BlockchainManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the BlockchainManagementClientBuilder. + */ + public BlockchainManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the BlockchainManagementClientBuilder. + */ + public BlockchainManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the BlockchainManagementClientBuilder. + */ + public BlockchainManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of BlockchainManagementClientImpl with the provided parameters. + * + * @return an instance of BlockchainManagementClientImpl. + */ + public BlockchainManagementClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + BlockchainManagementClientImpl client = + new BlockchainManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/BlockchainManagementClientImpl.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/BlockchainManagementClientImpl.java new file mode 100644 index 0000000000000..2d01b35ba1823 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/BlockchainManagementClientImpl.java @@ -0,0 +1,368 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.blockchain.fluent.BlockchainManagementClient; +import com.azure.resourcemanager.blockchain.fluent.BlockchainMemberOperationResultsClient; +import com.azure.resourcemanager.blockchain.fluent.BlockchainMembersClient; +import com.azure.resourcemanager.blockchain.fluent.LocationsClient; +import com.azure.resourcemanager.blockchain.fluent.OperationsClient; +import com.azure.resourcemanager.blockchain.fluent.SkusClient; +import com.azure.resourcemanager.blockchain.fluent.TransactionNodesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the BlockchainManagementClientImpl type. */ +@ServiceClient(builder = BlockchainManagementClientBuilder.class) +public final class BlockchainManagementClientImpl implements BlockchainManagementClient { + private final ClientLogger logger = new ClientLogger(BlockchainManagementClientImpl.class); + + /** + * Gets the subscription Id which uniquely identifies the Microsoft Azure subscription. The subscription ID is part + * of the URI for every service call. + */ + private final String subscriptionId; + + /** + * Gets Gets the subscription Id which uniquely identifies the Microsoft Azure subscription. The subscription ID is + * part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The BlockchainMembersClient object to access its operations. */ + private final BlockchainMembersClient blockchainMembers; + + /** + * Gets the BlockchainMembersClient object to access its operations. + * + * @return the BlockchainMembersClient object. + */ + public BlockchainMembersClient getBlockchainMembers() { + return this.blockchainMembers; + } + + /** The BlockchainMemberOperationResultsClient object to access its operations. */ + private final BlockchainMemberOperationResultsClient blockchainMemberOperationResults; + + /** + * Gets the BlockchainMemberOperationResultsClient object to access its operations. + * + * @return the BlockchainMemberOperationResultsClient object. + */ + public BlockchainMemberOperationResultsClient getBlockchainMemberOperationResults() { + return this.blockchainMemberOperationResults; + } + + /** The LocationsClient object to access its operations. */ + private final LocationsClient locations; + + /** + * Gets the LocationsClient object to access its operations. + * + * @return the LocationsClient object. + */ + public LocationsClient getLocations() { + return this.locations; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The SkusClient object to access its operations. */ + private final SkusClient skus; + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + public SkusClient getSkus() { + return this.skus; + } + + /** The TransactionNodesClient object to access its operations. */ + private final TransactionNodesClient transactionNodes; + + /** + * Gets the TransactionNodesClient object to access its operations. + * + * @return the TransactionNodesClient object. + */ + public TransactionNodesClient getTransactionNodes() { + return this.transactionNodes; + } + + /** + * Initializes an instance of BlockchainManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId Gets the subscription Id which uniquely identifies the Microsoft Azure subscription. The + * subscription ID is part of the URI for every service call. + * @param endpoint server parameter. + */ + BlockchainManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2018-06-01-preview"; + this.blockchainMembers = new BlockchainMembersClientImpl(this); + this.blockchainMemberOperationResults = new BlockchainMemberOperationResultsClientImpl(this); + this.locations = new LocationsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.skus = new SkusClientImpl(this); + this.transactionNodes = new TransactionNodesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/BlockchainMemberImpl.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/BlockchainMemberImpl.java new file mode 100644 index 0000000000000..31aeb56f70de5 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/BlockchainMemberImpl.java @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.blockchain.fluent.models.BlockchainMemberInner; +import com.azure.resourcemanager.blockchain.models.ApiKey; +import com.azure.resourcemanager.blockchain.models.ApiKeyCollection; +import com.azure.resourcemanager.blockchain.models.BlockchainMember; +import com.azure.resourcemanager.blockchain.models.BlockchainMemberNodesSku; +import com.azure.resourcemanager.blockchain.models.BlockchainMemberProvisioningState; +import com.azure.resourcemanager.blockchain.models.BlockchainMemberUpdate; +import com.azure.resourcemanager.blockchain.models.BlockchainProtocol; +import com.azure.resourcemanager.blockchain.models.FirewallRule; +import com.azure.resourcemanager.blockchain.models.Sku; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class BlockchainMemberImpl + implements BlockchainMember, BlockchainMember.Definition, BlockchainMember.Update { + private BlockchainMemberInner innerObject; + + private final com.azure.resourcemanager.blockchain.BlockchainManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public BlockchainProtocol protocol() { + return this.innerModel().protocol(); + } + + public BlockchainMemberNodesSku validatorNodesSku() { + return this.innerModel().validatorNodesSku(); + } + + public BlockchainMemberProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String dns() { + return this.innerModel().dns(); + } + + public String username() { + return this.innerModel().username(); + } + + public String password() { + return this.innerModel().password(); + } + + public String consortium() { + return this.innerModel().consortium(); + } + + public String consortiumManagementAccountAddress() { + return this.innerModel().consortiumManagementAccountAddress(); + } + + public String consortiumManagementAccountPassword() { + return this.innerModel().consortiumManagementAccountPassword(); + } + + public String consortiumRole() { + return this.innerModel().consortiumRole(); + } + + public String consortiumMemberDisplayName() { + return this.innerModel().consortiumMemberDisplayName(); + } + + public String rootContractAddress() { + return this.innerModel().rootContractAddress(); + } + + public String publicKey() { + return this.innerModel().publicKey(); + } + + public List firewallRules() { + List inner = this.innerModel().firewallRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public BlockchainMemberInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.blockchain.BlockchainManager manager() { + return this.serviceManager; + } + + private String blockchainMemberName; + + private String resourceGroupName; + + private BlockchainMemberUpdate updateBlockchainMember; + + public BlockchainMemberImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public BlockchainMember create() { + this.innerObject = + serviceManager + .serviceClient() + .getBlockchainMembers() + .create(blockchainMemberName, resourceGroupName, this.innerModel(), Context.NONE); + return this; + } + + public BlockchainMember create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBlockchainMembers() + .create(blockchainMemberName, resourceGroupName, this.innerModel(), context); + return this; + } + + BlockchainMemberImpl(String name, com.azure.resourcemanager.blockchain.BlockchainManager serviceManager) { + this.innerObject = new BlockchainMemberInner(); + this.serviceManager = serviceManager; + this.blockchainMemberName = name; + } + + public BlockchainMemberImpl update() { + this.updateBlockchainMember = new BlockchainMemberUpdate(); + return this; + } + + public BlockchainMember apply() { + this.innerObject = + serviceManager + .serviceClient() + .getBlockchainMembers() + .updateWithResponse(blockchainMemberName, resourceGroupName, updateBlockchainMember, Context.NONE) + .getValue(); + return this; + } + + public BlockchainMember apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBlockchainMembers() + .updateWithResponse(blockchainMemberName, resourceGroupName, updateBlockchainMember, context) + .getValue(); + return this; + } + + BlockchainMemberImpl( + BlockchainMemberInner innerObject, com.azure.resourcemanager.blockchain.BlockchainManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.blockchainMemberName = Utils.getValueFromIdByName(innerObject.id(), "blockchainMembers"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + } + + public BlockchainMember refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getBlockchainMembers() + .getByResourceGroupWithResponse(resourceGroupName, blockchainMemberName, Context.NONE) + .getValue(); + return this; + } + + public BlockchainMember refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBlockchainMembers() + .getByResourceGroupWithResponse(resourceGroupName, blockchainMemberName, context) + .getValue(); + return this; + } + + public ApiKeyCollection listApiKeys() { + return serviceManager.blockchainMembers().listApiKeys(blockchainMemberName, resourceGroupName); + } + + public Response listApiKeysWithResponse(Context context) { + return serviceManager + .blockchainMembers() + .listApiKeysWithResponse(blockchainMemberName, resourceGroupName, context); + } + + public ApiKeyCollection listRegenerateApiKeys() { + return serviceManager.blockchainMembers().listRegenerateApiKeys(blockchainMemberName, resourceGroupName); + } + + public Response listRegenerateApiKeysWithResponse(ApiKey apiKey, Context context) { + return serviceManager + .blockchainMembers() + .listRegenerateApiKeysWithResponse(blockchainMemberName, resourceGroupName, apiKey, context); + } + + public BlockchainMemberImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public BlockchainMemberImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public BlockchainMemberImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBlockchainMember.withTags(tags); + return this; + } + } + + public BlockchainMemberImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public BlockchainMemberImpl withProtocol(BlockchainProtocol protocol) { + this.innerModel().withProtocol(protocol); + return this; + } + + public BlockchainMemberImpl withValidatorNodesSku(BlockchainMemberNodesSku validatorNodesSku) { + this.innerModel().withValidatorNodesSku(validatorNodesSku); + return this; + } + + public BlockchainMemberImpl withPassword(String password) { + if (isInCreateMode()) { + this.innerModel().withPassword(password); + return this; + } else { + this.updateBlockchainMember.withPassword(password); + return this; + } + } + + public BlockchainMemberImpl withConsortium(String consortium) { + this.innerModel().withConsortium(consortium); + return this; + } + + public BlockchainMemberImpl withConsortiumManagementAccountPassword(String consortiumManagementAccountPassword) { + if (isInCreateMode()) { + this.innerModel().withConsortiumManagementAccountPassword(consortiumManagementAccountPassword); + return this; + } else { + this.updateBlockchainMember.withConsortiumManagementAccountPassword(consortiumManagementAccountPassword); + return this; + } + } + + public BlockchainMemberImpl withConsortiumRole(String consortiumRole) { + this.innerModel().withConsortiumRole(consortiumRole); + return this; + } + + public BlockchainMemberImpl withConsortiumMemberDisplayName(String consortiumMemberDisplayName) { + this.innerModel().withConsortiumMemberDisplayName(consortiumMemberDisplayName); + return this; + } + + public BlockchainMemberImpl withFirewallRules(List firewallRules) { + if (isInCreateMode()) { + this.innerModel().withFirewallRules(firewallRules); + return this; + } else { + this.updateBlockchainMember.withFirewallRules(firewallRules); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/BlockchainMemberOperationResultsClientImpl.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/BlockchainMemberOperationResultsClientImpl.java new file mode 100644 index 0000000000000..7aa240549e2ac --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/BlockchainMemberOperationResultsClientImpl.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.fluent.BlockchainMemberOperationResultsClient; +import com.azure.resourcemanager.blockchain.fluent.models.OperationResultInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BlockchainMemberOperationResultsClient. + */ +public final class BlockchainMemberOperationResultsClientImpl implements BlockchainMemberOperationResultsClient { + private final ClientLogger logger = new ClientLogger(BlockchainMemberOperationResultsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BlockchainMemberOperationResultsService service; + + /** The service client containing this operation class. */ + private final BlockchainManagementClientImpl client; + + /** + * Initializes an instance of BlockchainMemberOperationResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BlockchainMemberOperationResultsClientImpl(BlockchainManagementClientImpl client) { + this.service = + RestProxy + .create( + BlockchainMemberOperationResultsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for BlockchainManagementClientBlockchainMemberOperationResults to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "BlockchainManagement") + private interface BlockchainMemberOperationResultsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Blockchain/locations/{locationName}" + + "/blockchainMemberOperationResults/{operationId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("locationName") String locationName, + @PathParam("operationId") String operationId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get Async operation result. + * + * @param locationName Location name. + * @param operationId Operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return async operation result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String locationName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + locationName, + operationId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Async operation result. + * + * @param locationName Location name. + * @param operationId Operation Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return async operation result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String locationName, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + locationName, + operationId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get Async operation result. + * + * @param locationName Location name. + * @param operationId Operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return async operation result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String locationName, String operationId) { + return getWithResponseAsync(locationName, operationId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get Async operation result. + * + * @param locationName Location name. + * @param operationId Operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return async operation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationResultInner get(String locationName, String operationId) { + return getAsync(locationName, operationId).block(); + } + + /** + * Get Async operation result. + * + * @param locationName Location name. + * @param operationId Operation Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return async operation result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String locationName, String operationId, Context context) { + return getWithResponseAsync(locationName, operationId, context).block(); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/BlockchainMemberOperationResultsImpl.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/BlockchainMemberOperationResultsImpl.java new file mode 100644 index 0000000000000..ba48b05064e62 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/BlockchainMemberOperationResultsImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.fluent.BlockchainMemberOperationResultsClient; +import com.azure.resourcemanager.blockchain.fluent.models.OperationResultInner; +import com.azure.resourcemanager.blockchain.models.BlockchainMemberOperationResults; +import com.azure.resourcemanager.blockchain.models.OperationResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BlockchainMemberOperationResultsImpl implements BlockchainMemberOperationResults { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BlockchainMemberOperationResultsImpl.class); + + private final BlockchainMemberOperationResultsClient innerClient; + + private final com.azure.resourcemanager.blockchain.BlockchainManager serviceManager; + + public BlockchainMemberOperationResultsImpl( + BlockchainMemberOperationResultsClient innerClient, + com.azure.resourcemanager.blockchain.BlockchainManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public OperationResult get(String locationName, String operationId) { + OperationResultInner inner = this.serviceClient().get(locationName, operationId); + if (inner != null) { + return new OperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String locationName, String operationId, Context context) { + Response inner = this.serviceClient().getWithResponse(locationName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private BlockchainMemberOperationResultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.blockchain.BlockchainManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/BlockchainMembersClientImpl.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/BlockchainMembersClientImpl.java new file mode 100644 index 0000000000000..bd510bd289025 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/BlockchainMembersClientImpl.java @@ -0,0 +1,2269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.blockchain.fluent.BlockchainMembersClient; +import com.azure.resourcemanager.blockchain.fluent.models.ApiKeyCollectionInner; +import com.azure.resourcemanager.blockchain.fluent.models.BlockchainMemberInner; +import com.azure.resourcemanager.blockchain.fluent.models.ConsortiumMemberInner; +import com.azure.resourcemanager.blockchain.models.ApiKey; +import com.azure.resourcemanager.blockchain.models.BlockchainMemberCollection; +import com.azure.resourcemanager.blockchain.models.BlockchainMemberUpdate; +import com.azure.resourcemanager.blockchain.models.ConsortiumMemberCollection; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BlockchainMembersClient. */ +public final class BlockchainMembersClientImpl implements BlockchainMembersClient { + private final ClientLogger logger = new ClientLogger(BlockchainMembersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BlockchainMembersService service; + + /** The service client containing this operation class. */ + private final BlockchainManagementClientImpl client; + + /** + * Initializes an instance of BlockchainMembersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BlockchainMembersClientImpl(BlockchainManagementClientImpl client) { + this.service = + RestProxy.create(BlockchainMembersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for BlockchainManagementClientBlockchainMembers to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "BlockchainManagement") + private interface BlockchainMembersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Blockchain" + + "/blockchainMembers/{blockchainMemberName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("blockchainMemberName") String blockchainMemberName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Blockchain" + + "/blockchainMembers/{blockchainMemberName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("blockchainMemberName") String blockchainMemberName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @BodyParam("application/json") BlockchainMemberInner blockchainMember, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Blockchain" + + "/blockchainMembers/{blockchainMemberName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("blockchainMemberName") String blockchainMemberName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Blockchain" + + "/blockchainMembers/{blockchainMemberName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("blockchainMemberName") String blockchainMemberName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @BodyParam("application/json") BlockchainMemberUpdate blockchainMember, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Blockchain" + + "/blockchainMembers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Blockchain/blockchainMembers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Blockchain" + + "/blockchainMembers/{blockchainMemberName}/consortiumMembers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listConsortiumMembers( + @HostParam("$host") String endpoint, + @PathParam("blockchainMemberName") String blockchainMemberName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Blockchain" + + "/blockchainMembers/{blockchainMemberName}/listApiKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listApiKeys( + @HostParam("$host") String endpoint, + @PathParam("blockchainMemberName") String blockchainMemberName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Blockchain" + + "/blockchainMembers/{blockchainMemberName}/regenerateApiKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listRegenerateApiKeys( + @HostParam("$host") String endpoint, + @PathParam("blockchainMemberName") String blockchainMemberName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @BodyParam("application/json") ApiKey apiKey, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listConsortiumMembersNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get details about a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about a blockchain member along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String blockchainMemberName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + blockchainMemberName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get details about a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about a blockchain member along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String blockchainMemberName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + blockchainMemberName, + accept, + context); + } + + /** + * Get details about a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about a blockchain member on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String blockchainMemberName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, blockchainMemberName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get details about a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about a blockchain member. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlockchainMemberInner getByResourceGroup(String resourceGroupName, String blockchainMemberName) { + return getByResourceGroupAsync(resourceGroupName, blockchainMemberName).block(); + } + + /** + * Get details about a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about a blockchain member along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String blockchainMemberName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, blockchainMemberName, context).block(); + } + + /** + * Create a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMember Payload to create a blockchain member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String blockchainMemberName, String resourceGroupName, BlockchainMemberInner blockchainMember) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (blockchainMember != null) { + blockchainMember.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + blockchainMemberName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + blockchainMember, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMember Payload to create a blockchain member. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String blockchainMemberName, + String resourceGroupName, + BlockchainMemberInner blockchainMember, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (blockchainMember != null) { + blockchainMember.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + blockchainMemberName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + blockchainMember, + accept, + context); + } + + /** + * Create a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMember Payload to create a blockchain member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BlockchainMemberInner> beginCreateAsync( + String blockchainMemberName, String resourceGroupName, BlockchainMemberInner blockchainMember) { + Mono>> mono = + createWithResponseAsync(blockchainMemberName, resourceGroupName, blockchainMember); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BlockchainMemberInner.class, + BlockchainMemberInner.class, + this.client.getContext()); + } + + /** + * Create a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMember Payload to create a blockchain member. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BlockchainMemberInner> beginCreateAsync( + String blockchainMemberName, + String resourceGroupName, + BlockchainMemberInner blockchainMember, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(blockchainMemberName, resourceGroupName, blockchainMember, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), BlockchainMemberInner.class, BlockchainMemberInner.class, context); + } + + /** + * Create a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMember Payload to create a blockchain member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BlockchainMemberInner> beginCreate( + String blockchainMemberName, String resourceGroupName, BlockchainMemberInner blockchainMember) { + return beginCreateAsync(blockchainMemberName, resourceGroupName, blockchainMember).getSyncPoller(); + } + + /** + * Create a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMember Payload to create a blockchain member. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BlockchainMemberInner> beginCreate( + String blockchainMemberName, + String resourceGroupName, + BlockchainMemberInner blockchainMember, + Context context) { + return beginCreateAsync(blockchainMemberName, resourceGroupName, blockchainMember, context).getSyncPoller(); + } + + /** + * Create a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMember Payload to create a blockchain member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String blockchainMemberName, String resourceGroupName, BlockchainMemberInner blockchainMember) { + return beginCreateAsync(blockchainMemberName, resourceGroupName, blockchainMember) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String blockchainMemberName, String resourceGroupName) { + final BlockchainMemberInner blockchainMember = null; + return beginCreateAsync(blockchainMemberName, resourceGroupName, blockchainMember) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMember Payload to create a blockchain member. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String blockchainMemberName, + String resourceGroupName, + BlockchainMemberInner blockchainMember, + Context context) { + return beginCreateAsync(blockchainMemberName, resourceGroupName, blockchainMember, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMember Payload to create a blockchain member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlockchainMemberInner create( + String blockchainMemberName, String resourceGroupName, BlockchainMemberInner blockchainMember) { + return createAsync(blockchainMemberName, resourceGroupName, blockchainMember).block(); + } + + /** + * Create a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlockchainMemberInner create(String blockchainMemberName, String resourceGroupName) { + final BlockchainMemberInner blockchainMember = null; + return createAsync(blockchainMemberName, resourceGroupName, blockchainMember).block(); + } + + /** + * Create a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMember Payload to create a blockchain member. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlockchainMemberInner create( + String blockchainMemberName, + String resourceGroupName, + BlockchainMemberInner blockchainMember, + Context context) { + return createAsync(blockchainMemberName, resourceGroupName, blockchainMember, context).block(); + } + + /** + * Delete a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String blockchainMemberName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + blockchainMemberName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String blockchainMemberName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + blockchainMemberName, + context); + } + + /** + * Delete a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String blockchainMemberName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, blockchainMemberName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String blockchainMemberName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, blockchainMemberName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String blockchainMemberName) { + return beginDeleteAsync(resourceGroupName, blockchainMemberName).getSyncPoller(); + } + + /** + * Delete a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String blockchainMemberName, Context context) { + return beginDeleteAsync(resourceGroupName, blockchainMemberName, context).getSyncPoller(); + } + + /** + * Delete a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String blockchainMemberName) { + return beginDeleteAsync(resourceGroupName, blockchainMemberName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String blockchainMemberName, Context context) { + return beginDeleteAsync(resourceGroupName, blockchainMemberName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String blockchainMemberName) { + deleteAsync(resourceGroupName, blockchainMemberName).block(); + } + + /** + * Delete a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String blockchainMemberName, Context context) { + deleteAsync(resourceGroupName, blockchainMemberName, context).block(); + } + + /** + * Update a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMember Payload to update the blockchain member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String blockchainMemberName, String resourceGroupName, BlockchainMemberUpdate blockchainMember) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (blockchainMember != null) { + blockchainMember.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + blockchainMemberName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + blockchainMember, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMember Payload to update the blockchain member. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String blockchainMemberName, + String resourceGroupName, + BlockchainMemberUpdate blockchainMember, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (blockchainMember != null) { + blockchainMember.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + blockchainMemberName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + blockchainMember, + accept, + context); + } + + /** + * Update a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMember Payload to update the blockchain member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String blockchainMemberName, String resourceGroupName, BlockchainMemberUpdate blockchainMember) { + return updateWithResponseAsync(blockchainMemberName, resourceGroupName, blockchainMember) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String blockchainMemberName, String resourceGroupName) { + final BlockchainMemberUpdate blockchainMember = null; + return updateWithResponseAsync(blockchainMemberName, resourceGroupName, blockchainMember) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlockchainMemberInner update(String blockchainMemberName, String resourceGroupName) { + final BlockchainMemberUpdate blockchainMember = null; + return updateAsync(blockchainMemberName, resourceGroupName, blockchainMember).block(); + } + + /** + * Update a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMember Payload to update the blockchain member. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the blockchain member which is exposed in the request/response of the resource provider along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String blockchainMemberName, + String resourceGroupName, + BlockchainMemberUpdate blockchainMember, + Context context) { + return updateWithResponseAsync(blockchainMemberName, resourceGroupName, blockchainMember, context).block(); + } + + /** + * Lists the blockchain members for a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the blockchain members for a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the blockchain members for a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the blockchain members for a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the blockchain members for a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists the blockchain members for a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists the blockchain members for a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the blockchain members for a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the blockchain members for a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + } + + /** + * Lists the blockchain members for a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the blockchain members for a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists the blockchain members for a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists the consortium members for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of consortium payload along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listConsortiumMembersSinglePageAsync( + String blockchainMemberName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listConsortiumMembers( + this.client.getEndpoint(), + blockchainMemberName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the consortium members for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of consortium payload along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listConsortiumMembersSinglePageAsync( + String blockchainMemberName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listConsortiumMembers( + this.client.getEndpoint(), + blockchainMemberName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the consortium members for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of consortium payload. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listConsortiumMembersAsync( + String blockchainMemberName, String resourceGroupName) { + return new PagedFlux<>( + () -> listConsortiumMembersSinglePageAsync(blockchainMemberName, resourceGroupName), + nextLink -> listConsortiumMembersNextSinglePageAsync(nextLink)); + } + + /** + * Lists the consortium members for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of consortium payload. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listConsortiumMembersAsync( + String blockchainMemberName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listConsortiumMembersSinglePageAsync(blockchainMemberName, resourceGroupName, context), + nextLink -> listConsortiumMembersNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the consortium members for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of consortium payload. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listConsortiumMembers( + String blockchainMemberName, String resourceGroupName) { + return new PagedIterable<>(listConsortiumMembersAsync(blockchainMemberName, resourceGroupName)); + } + + /** + * Lists the consortium members for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of consortium payload. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listConsortiumMembers( + String blockchainMemberName, String resourceGroupName, Context context) { + return new PagedIterable<>(listConsortiumMembersAsync(blockchainMemberName, resourceGroupName, context)); + } + + /** + * Lists the API keys for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listApiKeysWithResponseAsync( + String blockchainMemberName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listApiKeys( + this.client.getEndpoint(), + blockchainMemberName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the API keys for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listApiKeysWithResponseAsync( + String blockchainMemberName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listApiKeys( + this.client.getEndpoint(), + blockchainMemberName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context); + } + + /** + * Lists the API keys for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listApiKeysAsync(String blockchainMemberName, String resourceGroupName) { + return listApiKeysWithResponseAsync(blockchainMemberName, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists the API keys for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiKeyCollectionInner listApiKeys(String blockchainMemberName, String resourceGroupName) { + return listApiKeysAsync(blockchainMemberName, resourceGroupName).block(); + } + + /** + * Lists the API keys for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listApiKeysWithResponse( + String blockchainMemberName, String resourceGroupName, Context context) { + return listApiKeysWithResponseAsync(blockchainMemberName, resourceGroupName, context).block(); + } + + /** + * Regenerate the API keys for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param apiKey api key to be regenerate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRegenerateApiKeysWithResponseAsync( + String blockchainMemberName, String resourceGroupName, ApiKey apiKey) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (apiKey != null) { + apiKey.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listRegenerateApiKeys( + this.client.getEndpoint(), + blockchainMemberName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + apiKey, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Regenerate the API keys for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param apiKey api key to be regenerate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRegenerateApiKeysWithResponseAsync( + String blockchainMemberName, String resourceGroupName, ApiKey apiKey, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (apiKey != null) { + apiKey.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listRegenerateApiKeys( + this.client.getEndpoint(), + blockchainMemberName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + apiKey, + accept, + context); + } + + /** + * Regenerate the API keys for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param apiKey api key to be regenerate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listRegenerateApiKeysAsync( + String blockchainMemberName, String resourceGroupName, ApiKey apiKey) { + return listRegenerateApiKeysWithResponseAsync(blockchainMemberName, resourceGroupName, apiKey) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Regenerate the API keys for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listRegenerateApiKeysAsync( + String blockchainMemberName, String resourceGroupName) { + final ApiKey apiKey = null; + return listRegenerateApiKeysWithResponseAsync(blockchainMemberName, resourceGroupName, apiKey) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Regenerate the API keys for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiKeyCollectionInner listRegenerateApiKeys(String blockchainMemberName, String resourceGroupName) { + final ApiKey apiKey = null; + return listRegenerateApiKeysAsync(blockchainMemberName, resourceGroupName, apiKey).block(); + } + + /** + * Regenerate the API keys for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param apiKey api key to be regenerate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listRegenerateApiKeysWithResponse( + String blockchainMemberName, String resourceGroupName, ApiKey apiKey, Context context) { + return listRegenerateApiKeysWithResponseAsync(blockchainMemberName, resourceGroupName, apiKey, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAllNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of consortium payload along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listConsortiumMembersNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listConsortiumMembersNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of consortium payload along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listConsortiumMembersNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listConsortiumMembersNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/BlockchainMembersImpl.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/BlockchainMembersImpl.java new file mode 100644 index 0000000000000..c5e4ea0d6913a --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/BlockchainMembersImpl.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.fluent.BlockchainMembersClient; +import com.azure.resourcemanager.blockchain.fluent.models.ApiKeyCollectionInner; +import com.azure.resourcemanager.blockchain.fluent.models.BlockchainMemberInner; +import com.azure.resourcemanager.blockchain.fluent.models.ConsortiumMemberInner; +import com.azure.resourcemanager.blockchain.models.ApiKey; +import com.azure.resourcemanager.blockchain.models.ApiKeyCollection; +import com.azure.resourcemanager.blockchain.models.BlockchainMember; +import com.azure.resourcemanager.blockchain.models.BlockchainMembers; +import com.azure.resourcemanager.blockchain.models.ConsortiumMember; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BlockchainMembersImpl implements BlockchainMembers { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BlockchainMembersImpl.class); + + private final BlockchainMembersClient innerClient; + + private final com.azure.resourcemanager.blockchain.BlockchainManager serviceManager; + + public BlockchainMembersImpl( + BlockchainMembersClient innerClient, com.azure.resourcemanager.blockchain.BlockchainManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public BlockchainMember getByResourceGroup(String resourceGroupName, String blockchainMemberName) { + BlockchainMemberInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, blockchainMemberName); + if (inner != null) { + return new BlockchainMemberImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String blockchainMemberName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, blockchainMemberName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BlockchainMemberImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String blockchainMemberName) { + this.serviceClient().delete(resourceGroupName, blockchainMemberName); + } + + public void delete(String resourceGroupName, String blockchainMemberName, Context context) { + this.serviceClient().delete(resourceGroupName, blockchainMemberName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new BlockchainMemberImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new BlockchainMemberImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new BlockchainMemberImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new BlockchainMemberImpl(inner1, this.manager())); + } + + public PagedIterable listConsortiumMembers( + String blockchainMemberName, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listConsortiumMembers(blockchainMemberName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ConsortiumMemberImpl(inner1, this.manager())); + } + + public PagedIterable listConsortiumMembers( + String blockchainMemberName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listConsortiumMembers(blockchainMemberName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ConsortiumMemberImpl(inner1, this.manager())); + } + + public ApiKeyCollection listApiKeys(String blockchainMemberName, String resourceGroupName) { + ApiKeyCollectionInner inner = this.serviceClient().listApiKeys(blockchainMemberName, resourceGroupName); + if (inner != null) { + return new ApiKeyCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listApiKeysWithResponse( + String blockchainMemberName, String resourceGroupName, Context context) { + Response inner = + this.serviceClient().listApiKeysWithResponse(blockchainMemberName, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApiKeyCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApiKeyCollection listRegenerateApiKeys(String blockchainMemberName, String resourceGroupName) { + ApiKeyCollectionInner inner = + this.serviceClient().listRegenerateApiKeys(blockchainMemberName, resourceGroupName); + if (inner != null) { + return new ApiKeyCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listRegenerateApiKeysWithResponse( + String blockchainMemberName, String resourceGroupName, ApiKey apiKey, Context context) { + Response inner = + this + .serviceClient() + .listRegenerateApiKeysWithResponse(blockchainMemberName, resourceGroupName, apiKey, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApiKeyCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BlockchainMember getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String blockchainMemberName = Utils.getValueFromIdByName(id, "blockchainMembers"); + if (blockchainMemberName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'blockchainMembers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, blockchainMemberName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String blockchainMemberName = Utils.getValueFromIdByName(id, "blockchainMembers"); + if (blockchainMemberName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'blockchainMembers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, blockchainMemberName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String blockchainMemberName = Utils.getValueFromIdByName(id, "blockchainMembers"); + if (blockchainMemberName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'blockchainMembers'.", id))); + } + this.delete(resourceGroupName, blockchainMemberName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String blockchainMemberName = Utils.getValueFromIdByName(id, "blockchainMembers"); + if (blockchainMemberName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'blockchainMembers'.", id))); + } + this.delete(resourceGroupName, blockchainMemberName, context); + } + + private BlockchainMembersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.blockchain.BlockchainManager manager() { + return this.serviceManager; + } + + public BlockchainMemberImpl define(String name) { + return new BlockchainMemberImpl(name, this.manager()); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/ConsortiumCollectionImpl.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/ConsortiumCollectionImpl.java new file mode 100644 index 0000000000000..cdfcbab2bd1b5 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/ConsortiumCollectionImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.resourcemanager.blockchain.fluent.models.ConsortiumCollectionInner; +import com.azure.resourcemanager.blockchain.models.Consortium; +import com.azure.resourcemanager.blockchain.models.ConsortiumCollection; +import java.util.Collections; +import java.util.List; + +public final class ConsortiumCollectionImpl implements ConsortiumCollection { + private ConsortiumCollectionInner innerObject; + + private final com.azure.resourcemanager.blockchain.BlockchainManager serviceManager; + + ConsortiumCollectionImpl( + ConsortiumCollectionInner innerObject, com.azure.resourcemanager.blockchain.BlockchainManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ConsortiumCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.blockchain.BlockchainManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/ConsortiumMemberImpl.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/ConsortiumMemberImpl.java new file mode 100644 index 0000000000000..e8becef914470 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/ConsortiumMemberImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.resourcemanager.blockchain.fluent.models.ConsortiumMemberInner; +import com.azure.resourcemanager.blockchain.models.ConsortiumMember; +import java.time.OffsetDateTime; + +public final class ConsortiumMemberImpl implements ConsortiumMember { + private ConsortiumMemberInner innerObject; + + private final com.azure.resourcemanager.blockchain.BlockchainManager serviceManager; + + ConsortiumMemberImpl( + ConsortiumMemberInner innerObject, com.azure.resourcemanager.blockchain.BlockchainManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String subscriptionId() { + return this.innerModel().subscriptionId(); + } + + public String role() { + return this.innerModel().role(); + } + + public String status() { + return this.innerModel().status(); + } + + public OffsetDateTime joinDate() { + return this.innerModel().joinDate(); + } + + public OffsetDateTime dateModified() { + return this.innerModel().dateModified(); + } + + public ConsortiumMemberInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.blockchain.BlockchainManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/LocationsClientImpl.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/LocationsClientImpl.java new file mode 100644 index 0000000000000..ac26140455e28 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/LocationsClientImpl.java @@ -0,0 +1,397 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.fluent.LocationsClient; +import com.azure.resourcemanager.blockchain.fluent.models.ConsortiumCollectionInner; +import com.azure.resourcemanager.blockchain.fluent.models.NameAvailabilityInner; +import com.azure.resourcemanager.blockchain.models.NameAvailabilityRequest; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LocationsClient. */ +public final class LocationsClientImpl implements LocationsClient { + private final ClientLogger logger = new ClientLogger(LocationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LocationsService service; + + /** The service client containing this operation class. */ + private final BlockchainManagementClientImpl client; + + /** + * Initializes an instance of LocationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LocationsClientImpl(BlockchainManagementClientImpl client) { + this.service = + RestProxy.create(LocationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for BlockchainManagementClientLocations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "BlockchainManagement") + private interface LocationsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Blockchain/locations/{locationName}" + + "/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("locationName") String locationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NameAvailabilityRequest nameAvailabilityRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Blockchain/locations/{locationName}/listConsortiums") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listConsortiums( + @HostParam("$host") String endpoint, + @PathParam("locationName") String locationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * To check whether a resource name is available. + * + * @param locationName Location Name. + * @param nameAvailabilityRequest Name availability request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability payload which is exposed in the response of the resource provider along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String locationName, NameAvailabilityRequest nameAvailabilityRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (nameAvailabilityRequest != null) { + nameAvailabilityRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + locationName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + nameAvailabilityRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * To check whether a resource name is available. + * + * @param locationName Location Name. + * @param nameAvailabilityRequest Name availability request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability payload which is exposed in the response of the resource provider along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String locationName, NameAvailabilityRequest nameAvailabilityRequest, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (nameAvailabilityRequest != null) { + nameAvailabilityRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + locationName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + nameAvailabilityRequest, + accept, + context); + } + + /** + * To check whether a resource name is available. + * + * @param locationName Location Name. + * @param nameAvailabilityRequest Name availability request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability payload which is exposed in the response of the resource provider on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String locationName, NameAvailabilityRequest nameAvailabilityRequest) { + return checkNameAvailabilityWithResponseAsync(locationName, nameAvailabilityRequest) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * To check whether a resource name is available. + * + * @param locationName Location Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability payload which is exposed in the response of the resource provider on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync(String locationName) { + final NameAvailabilityRequest nameAvailabilityRequest = null; + return checkNameAvailabilityWithResponseAsync(locationName, nameAvailabilityRequest) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * To check whether a resource name is available. + * + * @param locationName Location Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability payload which is exposed in the response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NameAvailabilityInner checkNameAvailability(String locationName) { + final NameAvailabilityRequest nameAvailabilityRequest = null; + return checkNameAvailabilityAsync(locationName, nameAvailabilityRequest).block(); + } + + /** + * To check whether a resource name is available. + * + * @param locationName Location Name. + * @param nameAvailabilityRequest Name availability request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability payload which is exposed in the response of the resource provider along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String locationName, NameAvailabilityRequest nameAvailabilityRequest, Context context) { + return checkNameAvailabilityWithResponseAsync(locationName, nameAvailabilityRequest, context).block(); + } + + /** + * Lists the available consortiums for a subscription. + * + * @param locationName Location Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the consortium payload along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listConsortiumsWithResponseAsync(String locationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listConsortiums( + this.client.getEndpoint(), + locationName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the available consortiums for a subscription. + * + * @param locationName Location Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the consortium payload along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listConsortiumsWithResponseAsync( + String locationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listConsortiums( + this.client.getEndpoint(), + locationName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Lists the available consortiums for a subscription. + * + * @param locationName Location Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the consortium payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listConsortiumsAsync(String locationName) { + return listConsortiumsWithResponseAsync(locationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists the available consortiums for a subscription. + * + * @param locationName Location Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the consortium payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConsortiumCollectionInner listConsortiums(String locationName) { + return listConsortiumsAsync(locationName).block(); + } + + /** + * Lists the available consortiums for a subscription. + * + * @param locationName Location Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the consortium payload along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listConsortiumsWithResponse(String locationName, Context context) { + return listConsortiumsWithResponseAsync(locationName, context).block(); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/LocationsImpl.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/LocationsImpl.java new file mode 100644 index 0000000000000..7ead5cc082f47 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/LocationsImpl.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.fluent.LocationsClient; +import com.azure.resourcemanager.blockchain.fluent.models.ConsortiumCollectionInner; +import com.azure.resourcemanager.blockchain.fluent.models.NameAvailabilityInner; +import com.azure.resourcemanager.blockchain.models.ConsortiumCollection; +import com.azure.resourcemanager.blockchain.models.Locations; +import com.azure.resourcemanager.blockchain.models.NameAvailability; +import com.azure.resourcemanager.blockchain.models.NameAvailabilityRequest; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LocationsImpl implements Locations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LocationsImpl.class); + + private final LocationsClient innerClient; + + private final com.azure.resourcemanager.blockchain.BlockchainManager serviceManager; + + public LocationsImpl( + LocationsClient innerClient, com.azure.resourcemanager.blockchain.BlockchainManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public NameAvailability checkNameAvailability(String locationName) { + NameAvailabilityInner inner = this.serviceClient().checkNameAvailability(locationName); + if (inner != null) { + return new NameAvailabilityImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + String locationName, NameAvailabilityRequest nameAvailabilityRequest, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithResponse(locationName, nameAvailabilityRequest, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NameAvailabilityImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ConsortiumCollection listConsortiums(String locationName) { + ConsortiumCollectionInner inner = this.serviceClient().listConsortiums(locationName); + if (inner != null) { + return new ConsortiumCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listConsortiumsWithResponse(String locationName, Context context) { + Response inner = + this.serviceClient().listConsortiumsWithResponse(locationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ConsortiumCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private LocationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.blockchain.BlockchainManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/NameAvailabilityImpl.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/NameAvailabilityImpl.java new file mode 100644 index 0000000000000..56ce3782a7b88 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/NameAvailabilityImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.resourcemanager.blockchain.fluent.models.NameAvailabilityInner; +import com.azure.resourcemanager.blockchain.models.NameAvailability; +import com.azure.resourcemanager.blockchain.models.NameAvailabilityReason; + +public final class NameAvailabilityImpl implements NameAvailability { + private NameAvailabilityInner innerObject; + + private final com.azure.resourcemanager.blockchain.BlockchainManager serviceManager; + + NameAvailabilityImpl( + NameAvailabilityInner innerObject, com.azure.resourcemanager.blockchain.BlockchainManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public String message() { + return this.innerModel().message(); + } + + public NameAvailabilityReason reason() { + return this.innerModel().reason(); + } + + public NameAvailabilityInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.blockchain.BlockchainManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/OperationResultImpl.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/OperationResultImpl.java new file mode 100644 index 0000000000000..bd4aafbb7ee06 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/OperationResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.resourcemanager.blockchain.fluent.models.OperationResultInner; +import com.azure.resourcemanager.blockchain.models.OperationResult; +import java.time.OffsetDateTime; + +public final class OperationResultImpl implements OperationResult { + private OperationResultInner innerObject; + + private final com.azure.resourcemanager.blockchain.BlockchainManager serviceManager; + + OperationResultImpl( + OperationResultInner innerObject, com.azure.resourcemanager.blockchain.BlockchainManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public OperationResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.blockchain.BlockchainManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/OperationsClientImpl.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..13f58914aa329 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/OperationsClientImpl.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.fluent.OperationsClient; +import com.azure.resourcemanager.blockchain.fluent.models.ResourceProviderOperationInner; +import com.azure.resourcemanager.blockchain.models.ResourceProviderOperationCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final BlockchainManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(BlockchainManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for BlockchainManagementClientOperations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "BlockchainManagement") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Blockchain/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the available operations of Microsoft.Blockchain resource provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of operation payload which is exposed in the response of the resource provider along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the available operations of Microsoft.Blockchain resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of operation payload which is exposed in the response of the resource provider along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the available operations of Microsoft.Blockchain resource provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of operation payload which is exposed in the response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the available operations of Microsoft.Blockchain resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of operation payload which is exposed in the response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the available operations of Microsoft.Blockchain resource provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of operation payload which is exposed in the response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists the available operations of Microsoft.Blockchain resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of operation payload which is exposed in the response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of operation payload which is exposed in the response of the resource provider along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of operation payload which is exposed in the response of the resource provider along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/OperationsImpl.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..c20c300399434 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.fluent.OperationsClient; +import com.azure.resourcemanager.blockchain.fluent.models.ResourceProviderOperationInner; +import com.azure.resourcemanager.blockchain.models.Operations; +import com.azure.resourcemanager.blockchain.models.ResourceProviderOperation; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.blockchain.BlockchainManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.blockchain.BlockchainManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ResourceProviderOperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ResourceProviderOperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.blockchain.BlockchainManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/ResourceProviderOperationImpl.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/ResourceProviderOperationImpl.java new file mode 100644 index 0000000000000..a7734562c6d56 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/ResourceProviderOperationImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.resourcemanager.blockchain.fluent.models.ResourceProviderOperationInner; +import com.azure.resourcemanager.blockchain.models.ResourceProviderOperation; +import com.azure.resourcemanager.blockchain.models.ResourceProviderOperationDisplay; + +public final class ResourceProviderOperationImpl implements ResourceProviderOperation { + private ResourceProviderOperationInner innerObject; + + private final com.azure.resourcemanager.blockchain.BlockchainManager serviceManager; + + ResourceProviderOperationImpl( + ResourceProviderOperationInner innerObject, + com.azure.resourcemanager.blockchain.BlockchainManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String origin() { + return this.innerModel().origin(); + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public ResourceProviderOperationDisplay display() { + return this.innerModel().display(); + } + + public ResourceProviderOperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.blockchain.BlockchainManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/ResourceTypeSkuCollectionImpl.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/ResourceTypeSkuCollectionImpl.java new file mode 100644 index 0000000000000..30cc12a7c3aa3 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/ResourceTypeSkuCollectionImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.resourcemanager.blockchain.fluent.models.ResourceTypeSkuCollectionInner; +import com.azure.resourcemanager.blockchain.models.ResourceTypeSku; +import com.azure.resourcemanager.blockchain.models.ResourceTypeSkuCollection; +import java.util.Collections; +import java.util.List; + +public final class ResourceTypeSkuCollectionImpl implements ResourceTypeSkuCollection { + private ResourceTypeSkuCollectionInner innerObject; + + private final com.azure.resourcemanager.blockchain.BlockchainManager serviceManager; + + ResourceTypeSkuCollectionImpl( + ResourceTypeSkuCollectionInner innerObject, + com.azure.resourcemanager.blockchain.BlockchainManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ResourceTypeSkuCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.blockchain.BlockchainManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/SkusClientImpl.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/SkusClientImpl.java new file mode 100644 index 0000000000000..3be9c69612fa4 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/SkusClientImpl.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.fluent.SkusClient; +import com.azure.resourcemanager.blockchain.fluent.models.ResourceTypeSkuCollectionInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SkusClient. */ +public final class SkusClientImpl implements SkusClient { + private final ClientLogger logger = new ClientLogger(SkusClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SkusService service; + + /** The service client containing this operation class. */ + private final BlockchainManagementClientImpl client; + + /** + * Initializes an instance of SkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SkusClientImpl(BlockchainManagementClientImpl client) { + this.service = RestProxy.create(SkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for BlockchainManagementClientSkus to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "BlockchainManagement") + private interface SkusService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Blockchain/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the Skus of the resource type. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the resource type Sku along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the Skus of the resource type. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the resource type Sku along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Lists the Skus of the resource type. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the resource type Sku on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync() { + return listWithResponseAsync() + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists the Skus of the resource type. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the resource type Sku. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceTypeSkuCollectionInner list() { + return listAsync().block(); + } + + /** + * Lists the Skus of the resource type. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the resource type Sku along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(Context context) { + return listWithResponseAsync(context).block(); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/SkusImpl.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/SkusImpl.java new file mode 100644 index 0000000000000..7b74454655bd5 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/SkusImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.fluent.SkusClient; +import com.azure.resourcemanager.blockchain.fluent.models.ResourceTypeSkuCollectionInner; +import com.azure.resourcemanager.blockchain.models.ResourceTypeSkuCollection; +import com.azure.resourcemanager.blockchain.models.Skus; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SkusImpl implements Skus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkusImpl.class); + + private final SkusClient innerClient; + + private final com.azure.resourcemanager.blockchain.BlockchainManager serviceManager; + + public SkusImpl(SkusClient innerClient, com.azure.resourcemanager.blockchain.BlockchainManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ResourceTypeSkuCollection list() { + ResourceTypeSkuCollectionInner inner = this.serviceClient().list(); + if (inner != null) { + return new ResourceTypeSkuCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse(Context context) { + Response inner = this.serviceClient().listWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ResourceTypeSkuCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private SkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.blockchain.BlockchainManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/TransactionNodeImpl.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/TransactionNodeImpl.java new file mode 100644 index 0000000000000..a0a2be90ceeac --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/TransactionNodeImpl.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.blockchain.fluent.models.TransactionNodeInner; +import com.azure.resourcemanager.blockchain.models.ApiKey; +import com.azure.resourcemanager.blockchain.models.ApiKeyCollection; +import com.azure.resourcemanager.blockchain.models.FirewallRule; +import com.azure.resourcemanager.blockchain.models.NodeProvisioningState; +import com.azure.resourcemanager.blockchain.models.TransactionNode; +import com.azure.resourcemanager.blockchain.models.TransactionNodeUpdate; +import java.util.Collections; +import java.util.List; + +public final class TransactionNodeImpl implements TransactionNode, TransactionNode.Definition, TransactionNode.Update { + private TransactionNodeInner innerObject; + + private final com.azure.resourcemanager.blockchain.BlockchainManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public NodeProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String dns() { + return this.innerModel().dns(); + } + + public String publicKey() { + return this.innerModel().publicKey(); + } + + public String username() { + return this.innerModel().username(); + } + + public String password() { + return this.innerModel().password(); + } + + public List firewallRules() { + List inner = this.innerModel().firewallRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public TransactionNodeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.blockchain.BlockchainManager manager() { + return this.serviceManager; + } + + private String blockchainMemberName; + + private String transactionNodeName; + + private String resourceGroupName; + + private TransactionNodeUpdate updateTransactionNode; + + public TransactionNodeImpl withExistingBlockchainMember(String blockchainMemberName, String resourceGroupName) { + this.blockchainMemberName = blockchainMemberName; + this.resourceGroupName = resourceGroupName; + return this; + } + + public TransactionNode create() { + this.innerObject = + serviceManager + .serviceClient() + .getTransactionNodes() + .create(blockchainMemberName, transactionNodeName, resourceGroupName, this.innerModel(), Context.NONE); + return this; + } + + public TransactionNode create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTransactionNodes() + .create(blockchainMemberName, transactionNodeName, resourceGroupName, this.innerModel(), context); + return this; + } + + TransactionNodeImpl(String name, com.azure.resourcemanager.blockchain.BlockchainManager serviceManager) { + this.innerObject = new TransactionNodeInner(); + this.serviceManager = serviceManager; + this.transactionNodeName = name; + } + + public TransactionNodeImpl update() { + this.updateTransactionNode = new TransactionNodeUpdate(); + return this; + } + + public TransactionNode apply() { + this.innerObject = + serviceManager + .serviceClient() + .getTransactionNodes() + .updateWithResponse( + blockchainMemberName, transactionNodeName, resourceGroupName, updateTransactionNode, Context.NONE) + .getValue(); + return this; + } + + public TransactionNode apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTransactionNodes() + .updateWithResponse( + blockchainMemberName, transactionNodeName, resourceGroupName, updateTransactionNode, context) + .getValue(); + return this; + } + + TransactionNodeImpl( + TransactionNodeInner innerObject, com.azure.resourcemanager.blockchain.BlockchainManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.blockchainMemberName = Utils.getValueFromIdByName(innerObject.id(), "blockchainMembers"); + this.transactionNodeName = Utils.getValueFromIdByName(innerObject.id(), "transactionNodes"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + } + + public TransactionNode refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getTransactionNodes() + .getWithResponse(blockchainMemberName, transactionNodeName, resourceGroupName, Context.NONE) + .getValue(); + return this; + } + + public TransactionNode refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTransactionNodes() + .getWithResponse(blockchainMemberName, transactionNodeName, resourceGroupName, context) + .getValue(); + return this; + } + + public ApiKeyCollection listApiKeys() { + return serviceManager + .transactionNodes() + .listApiKeys(blockchainMemberName, transactionNodeName, resourceGroupName); + } + + public Response listApiKeysWithResponse(Context context) { + return serviceManager + .transactionNodes() + .listApiKeysWithResponse(blockchainMemberName, transactionNodeName, resourceGroupName, context); + } + + public ApiKeyCollection listRegenerateApiKeys() { + return serviceManager + .transactionNodes() + .listRegenerateApiKeys(blockchainMemberName, transactionNodeName, resourceGroupName); + } + + public Response listRegenerateApiKeysWithResponse(ApiKey apiKey, Context context) { + return serviceManager + .transactionNodes() + .listRegenerateApiKeysWithResponse( + blockchainMemberName, transactionNodeName, resourceGroupName, apiKey, context); + } + + public TransactionNodeImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public TransactionNodeImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public TransactionNodeImpl withPassword(String password) { + if (isInCreateMode()) { + this.innerModel().withPassword(password); + return this; + } else { + this.updateTransactionNode.withPassword(password); + return this; + } + } + + public TransactionNodeImpl withFirewallRules(List firewallRules) { + if (isInCreateMode()) { + this.innerModel().withFirewallRules(firewallRules); + return this; + } else { + this.updateTransactionNode.withFirewallRules(firewallRules); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/TransactionNodesClientImpl.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/TransactionNodesClientImpl.java new file mode 100644 index 0000000000000..060c450b4191b --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/TransactionNodesClientImpl.java @@ -0,0 +1,1922 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.blockchain.fluent.TransactionNodesClient; +import com.azure.resourcemanager.blockchain.fluent.models.ApiKeyCollectionInner; +import com.azure.resourcemanager.blockchain.fluent.models.TransactionNodeInner; +import com.azure.resourcemanager.blockchain.models.ApiKey; +import com.azure.resourcemanager.blockchain.models.TransactionNodeCollection; +import com.azure.resourcemanager.blockchain.models.TransactionNodeUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TransactionNodesClient. */ +public final class TransactionNodesClientImpl implements TransactionNodesClient { + private final ClientLogger logger = new ClientLogger(TransactionNodesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final TransactionNodesService service; + + /** The service client containing this operation class. */ + private final BlockchainManagementClientImpl client; + + /** + * Initializes an instance of TransactionNodesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TransactionNodesClientImpl(BlockchainManagementClientImpl client) { + this.service = + RestProxy.create(TransactionNodesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for BlockchainManagementClientTransactionNodes to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "BlockchainManagement") + private interface TransactionNodesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Blockchain" + + "/blockchainMembers/{blockchainMemberName}/transactionNodes/{transactionNodeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("blockchainMemberName") String blockchainMemberName, + @PathParam("transactionNodeName") String transactionNodeName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Blockchain" + + "/blockchainMembers/{blockchainMemberName}/transactionNodes/{transactionNodeName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("blockchainMemberName") String blockchainMemberName, + @PathParam("transactionNodeName") String transactionNodeName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @BodyParam("application/json") TransactionNodeInner transactionNode, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Blockchain" + + "/blockchainMembers/{blockchainMemberName}/transactionNodes/{transactionNodeName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("blockchainMemberName") String blockchainMemberName, + @PathParam("transactionNodeName") String transactionNodeName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Blockchain" + + "/blockchainMembers/{blockchainMemberName}/transactionNodes/{transactionNodeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("blockchainMemberName") String blockchainMemberName, + @PathParam("transactionNodeName") String transactionNodeName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @BodyParam("application/json") TransactionNodeUpdate transactionNode, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Blockchain" + + "/blockchainMembers/{blockchainMemberName}/transactionNodes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("blockchainMemberName") String blockchainMemberName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Blockchain" + + "/blockchainMembers/{blockchainMemberName}/transactionNodes/{transactionNodeName}/listApiKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listApiKeys( + @HostParam("$host") String endpoint, + @PathParam("blockchainMemberName") String blockchainMemberName, + @PathParam("transactionNodeName") String transactionNodeName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Blockchain" + + "/blockchainMembers/{blockchainMemberName}/transactionNodes/{transactionNodeName}/regenerateApiKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listRegenerateApiKeys( + @HostParam("$host") String endpoint, + @PathParam("blockchainMemberName") String blockchainMemberName, + @PathParam("transactionNodeName") String transactionNodeName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @BodyParam("application/json") ApiKey apiKey, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the details of the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the transaction node along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String blockchainMemberName, String transactionNodeName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (transactionNodeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter transactionNodeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + blockchainMemberName, + transactionNodeName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the details of the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the transaction node along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String blockchainMemberName, String transactionNodeName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (transactionNodeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter transactionNodeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + blockchainMemberName, + transactionNodeName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context); + } + + /** + * Get the details of the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the transaction node on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String blockchainMemberName, String transactionNodeName, String resourceGroupName) { + return getWithResponseAsync(blockchainMemberName, transactionNodeName, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the details of the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the transaction node. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TransactionNodeInner get(String blockchainMemberName, String transactionNodeName, String resourceGroupName) { + return getAsync(blockchainMemberName, transactionNodeName, resourceGroupName).block(); + } + + /** + * Get the details of the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the transaction node along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String blockchainMemberName, String transactionNodeName, String resourceGroupName, Context context) { + return getWithResponseAsync(blockchainMemberName, transactionNodeName, resourceGroupName, context).block(); + } + + /** + * Create or update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param transactionNode Payload to create the transaction node. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + TransactionNodeInner transactionNode) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (transactionNodeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter transactionNodeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (transactionNode != null) { + transactionNode.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + blockchainMemberName, + transactionNodeName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + transactionNode, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param transactionNode Payload to create the transaction node. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + TransactionNodeInner transactionNode, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (transactionNodeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter transactionNodeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (transactionNode != null) { + transactionNode.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + blockchainMemberName, + transactionNodeName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + transactionNode, + accept, + context); + } + + /** + * Create or update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param transactionNode Payload to create the transaction node. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TransactionNodeInner> beginCreateAsync( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + TransactionNodeInner transactionNode) { + Mono>> mono = + createWithResponseAsync(blockchainMemberName, transactionNodeName, resourceGroupName, transactionNode); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + TransactionNodeInner.class, + TransactionNodeInner.class, + this.client.getContext()); + } + + /** + * Create or update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param transactionNode Payload to create the transaction node. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TransactionNodeInner> beginCreateAsync( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + TransactionNodeInner transactionNode, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + blockchainMemberName, transactionNodeName, resourceGroupName, transactionNode, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TransactionNodeInner.class, TransactionNodeInner.class, context); + } + + /** + * Create or update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param transactionNode Payload to create the transaction node. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TransactionNodeInner> beginCreate( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + TransactionNodeInner transactionNode) { + return beginCreateAsync(blockchainMemberName, transactionNodeName, resourceGroupName, transactionNode) + .getSyncPoller(); + } + + /** + * Create or update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param transactionNode Payload to create the transaction node. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TransactionNodeInner> beginCreate( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + TransactionNodeInner transactionNode, + Context context) { + return beginCreateAsync(blockchainMemberName, transactionNodeName, resourceGroupName, transactionNode, context) + .getSyncPoller(); + } + + /** + * Create or update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param transactionNode Payload to create the transaction node. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + TransactionNodeInner transactionNode) { + return beginCreateAsync(blockchainMemberName, transactionNodeName, resourceGroupName, transactionNode) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String blockchainMemberName, String transactionNodeName, String resourceGroupName) { + final TransactionNodeInner transactionNode = null; + return beginCreateAsync(blockchainMemberName, transactionNodeName, resourceGroupName, transactionNode) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param transactionNode Payload to create the transaction node. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + TransactionNodeInner transactionNode, + Context context) { + return beginCreateAsync(blockchainMemberName, transactionNodeName, resourceGroupName, transactionNode, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param transactionNode Payload to create the transaction node. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TransactionNodeInner create( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + TransactionNodeInner transactionNode) { + return createAsync(blockchainMemberName, transactionNodeName, resourceGroupName, transactionNode).block(); + } + + /** + * Create or update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TransactionNodeInner create( + String blockchainMemberName, String transactionNodeName, String resourceGroupName) { + final TransactionNodeInner transactionNode = null; + return createAsync(blockchainMemberName, transactionNodeName, resourceGroupName, transactionNode).block(); + } + + /** + * Create or update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param transactionNode Payload to create the transaction node. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TransactionNodeInner create( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + TransactionNodeInner transactionNode, + Context context) { + return createAsync(blockchainMemberName, transactionNodeName, resourceGroupName, transactionNode, context) + .block(); + } + + /** + * Delete the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String blockchainMemberName, String transactionNodeName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (transactionNodeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter transactionNodeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + blockchainMemberName, + transactionNodeName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String blockchainMemberName, String transactionNodeName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (transactionNodeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter transactionNodeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + blockchainMemberName, + transactionNodeName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + context); + } + + /** + * Delete the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String blockchainMemberName, String transactionNodeName, String resourceGroupName) { + Mono>> mono = + deleteWithResponseAsync(blockchainMemberName, transactionNodeName, resourceGroupName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String blockchainMemberName, String transactionNodeName, String resourceGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(blockchainMemberName, transactionNodeName, resourceGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String blockchainMemberName, String transactionNodeName, String resourceGroupName) { + return beginDeleteAsync(blockchainMemberName, transactionNodeName, resourceGroupName).getSyncPoller(); + } + + /** + * Delete the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String blockchainMemberName, String transactionNodeName, String resourceGroupName, Context context) { + return beginDeleteAsync(blockchainMemberName, transactionNodeName, resourceGroupName, context).getSyncPoller(); + } + + /** + * Delete the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String blockchainMemberName, String transactionNodeName, String resourceGroupName) { + return beginDeleteAsync(blockchainMemberName, transactionNodeName, resourceGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String blockchainMemberName, String transactionNodeName, String resourceGroupName, Context context) { + return beginDeleteAsync(blockchainMemberName, transactionNodeName, resourceGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String blockchainMemberName, String transactionNodeName, String resourceGroupName) { + deleteAsync(blockchainMemberName, transactionNodeName, resourceGroupName).block(); + } + + /** + * Delete the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String blockchainMemberName, String transactionNodeName, String resourceGroupName, Context context) { + deleteAsync(blockchainMemberName, transactionNodeName, resourceGroupName, context).block(); + } + + /** + * Update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param transactionNode Payload to create the transaction node. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + TransactionNodeUpdate transactionNode) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (transactionNodeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter transactionNodeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (transactionNode != null) { + transactionNode.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + blockchainMemberName, + transactionNodeName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + transactionNode, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param transactionNode Payload to create the transaction node. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + TransactionNodeUpdate transactionNode, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (transactionNodeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter transactionNodeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (transactionNode != null) { + transactionNode.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + blockchainMemberName, + transactionNodeName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + transactionNode, + accept, + context); + } + + /** + * Update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param transactionNode Payload to create the transaction node. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + TransactionNodeUpdate transactionNode) { + return updateWithResponseAsync(blockchainMemberName, transactionNodeName, resourceGroupName, transactionNode) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String blockchainMemberName, String transactionNodeName, String resourceGroupName) { + final TransactionNodeUpdate transactionNode = null; + return updateWithResponseAsync(blockchainMemberName, transactionNodeName, resourceGroupName, transactionNode) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TransactionNodeInner update( + String blockchainMemberName, String transactionNodeName, String resourceGroupName) { + final TransactionNodeUpdate transactionNode = null; + return updateAsync(blockchainMemberName, transactionNodeName, resourceGroupName, transactionNode).block(); + } + + /** + * Update the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param transactionNode Payload to create the transaction node. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return payload of the transaction node which is the request/response of the resource provider along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + TransactionNodeUpdate transactionNode, + Context context) { + return updateWithResponseAsync( + blockchainMemberName, transactionNodeName, resourceGroupName, transactionNode, context) + .block(); + } + + /** + * Lists the transaction nodes for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of transaction node payload which is exposed in the request/response of the resource provider + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String blockchainMemberName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + blockchainMemberName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the transaction nodes for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of transaction node payload which is exposed in the request/response of the resource provider + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String blockchainMemberName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + blockchainMemberName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the transaction nodes for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of transaction node payload which is exposed in the request/response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String blockchainMemberName, String resourceGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(blockchainMemberName, resourceGroupName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the transaction nodes for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of transaction node payload which is exposed in the request/response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String blockchainMemberName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(blockchainMemberName, resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the transaction nodes for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of transaction node payload which is exposed in the request/response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String blockchainMemberName, String resourceGroupName) { + return new PagedIterable<>(listAsync(blockchainMemberName, resourceGroupName)); + } + + /** + * Lists the transaction nodes for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of transaction node payload which is exposed in the request/response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String blockchainMemberName, String resourceGroupName, Context context) { + return new PagedIterable<>(listAsync(blockchainMemberName, resourceGroupName, context)); + } + + /** + * List the API keys for the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listApiKeysWithResponseAsync( + String blockchainMemberName, String transactionNodeName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (transactionNodeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter transactionNodeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listApiKeys( + this.client.getEndpoint(), + blockchainMemberName, + transactionNodeName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the API keys for the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listApiKeysWithResponseAsync( + String blockchainMemberName, String transactionNodeName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (transactionNodeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter transactionNodeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listApiKeys( + this.client.getEndpoint(), + blockchainMemberName, + transactionNodeName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context); + } + + /** + * List the API keys for the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listApiKeysAsync( + String blockchainMemberName, String transactionNodeName, String resourceGroupName) { + return listApiKeysWithResponseAsync(blockchainMemberName, transactionNodeName, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * List the API keys for the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiKeyCollectionInner listApiKeys( + String blockchainMemberName, String transactionNodeName, String resourceGroupName) { + return listApiKeysAsync(blockchainMemberName, transactionNodeName, resourceGroupName).block(); + } + + /** + * List the API keys for the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listApiKeysWithResponse( + String blockchainMemberName, String transactionNodeName, String resourceGroupName, Context context) { + return listApiKeysWithResponseAsync(blockchainMemberName, transactionNodeName, resourceGroupName, context) + .block(); + } + + /** + * Regenerate the API keys for the blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param apiKey api key to be regenerated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRegenerateApiKeysWithResponseAsync( + String blockchainMemberName, String transactionNodeName, String resourceGroupName, ApiKey apiKey) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (transactionNodeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter transactionNodeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (apiKey != null) { + apiKey.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listRegenerateApiKeys( + this.client.getEndpoint(), + blockchainMemberName, + transactionNodeName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + apiKey, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Regenerate the API keys for the blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param apiKey api key to be regenerated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRegenerateApiKeysWithResponseAsync( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + ApiKey apiKey, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (blockchainMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter blockchainMemberName is required and cannot be null.")); + } + if (transactionNodeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter transactionNodeName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (apiKey != null) { + apiKey.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listRegenerateApiKeys( + this.client.getEndpoint(), + blockchainMemberName, + transactionNodeName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + apiKey, + accept, + context); + } + + /** + * Regenerate the API keys for the blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param apiKey api key to be regenerated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listRegenerateApiKeysAsync( + String blockchainMemberName, String transactionNodeName, String resourceGroupName, ApiKey apiKey) { + return listRegenerateApiKeysWithResponseAsync( + blockchainMemberName, transactionNodeName, resourceGroupName, apiKey) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Regenerate the API keys for the blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listRegenerateApiKeysAsync( + String blockchainMemberName, String transactionNodeName, String resourceGroupName) { + final ApiKey apiKey = null; + return listRegenerateApiKeysWithResponseAsync( + blockchainMemberName, transactionNodeName, resourceGroupName, apiKey) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Regenerate the API keys for the blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiKeyCollectionInner listRegenerateApiKeys( + String blockchainMemberName, String transactionNodeName, String resourceGroupName) { + final ApiKey apiKey = null; + return listRegenerateApiKeysAsync(blockchainMemberName, transactionNodeName, resourceGroupName, apiKey).block(); + } + + /** + * Regenerate the API keys for the blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param apiKey api key to be regenerated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listRegenerateApiKeysWithResponse( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + ApiKey apiKey, + Context context) { + return listRegenerateApiKeysWithResponseAsync( + blockchainMemberName, transactionNodeName, resourceGroupName, apiKey, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of transaction node payload which is exposed in the request/response of the resource provider + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of transaction node payload which is exposed in the request/response of the resource provider + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/TransactionNodesImpl.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/TransactionNodesImpl.java new file mode 100644 index 0000000000000..e92d61e630e3e --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/TransactionNodesImpl.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.fluent.TransactionNodesClient; +import com.azure.resourcemanager.blockchain.fluent.models.ApiKeyCollectionInner; +import com.azure.resourcemanager.blockchain.fluent.models.TransactionNodeInner; +import com.azure.resourcemanager.blockchain.models.ApiKey; +import com.azure.resourcemanager.blockchain.models.ApiKeyCollection; +import com.azure.resourcemanager.blockchain.models.TransactionNode; +import com.azure.resourcemanager.blockchain.models.TransactionNodes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class TransactionNodesImpl implements TransactionNodes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TransactionNodesImpl.class); + + private final TransactionNodesClient innerClient; + + private final com.azure.resourcemanager.blockchain.BlockchainManager serviceManager; + + public TransactionNodesImpl( + TransactionNodesClient innerClient, com.azure.resourcemanager.blockchain.BlockchainManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public TransactionNode get(String blockchainMemberName, String transactionNodeName, String resourceGroupName) { + TransactionNodeInner inner = + this.serviceClient().get(blockchainMemberName, transactionNodeName, resourceGroupName); + if (inner != null) { + return new TransactionNodeImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String blockchainMemberName, String transactionNodeName, String resourceGroupName, Context context) { + Response inner = + this.serviceClient().getWithResponse(blockchainMemberName, transactionNodeName, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TransactionNodeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String blockchainMemberName, String transactionNodeName, String resourceGroupName) { + this.serviceClient().delete(blockchainMemberName, transactionNodeName, resourceGroupName); + } + + public void delete( + String blockchainMemberName, String transactionNodeName, String resourceGroupName, Context context) { + this.serviceClient().delete(blockchainMemberName, transactionNodeName, resourceGroupName, context); + } + + public PagedIterable list(String blockchainMemberName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().list(blockchainMemberName, resourceGroupName); + return Utils.mapPage(inner, inner1 -> new TransactionNodeImpl(inner1, this.manager())); + } + + public PagedIterable list(String blockchainMemberName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().list(blockchainMemberName, resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new TransactionNodeImpl(inner1, this.manager())); + } + + public ApiKeyCollection listApiKeys( + String blockchainMemberName, String transactionNodeName, String resourceGroupName) { + ApiKeyCollectionInner inner = + this.serviceClient().listApiKeys(blockchainMemberName, transactionNodeName, resourceGroupName); + if (inner != null) { + return new ApiKeyCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listApiKeysWithResponse( + String blockchainMemberName, String transactionNodeName, String resourceGroupName, Context context) { + Response inner = + this + .serviceClient() + .listApiKeysWithResponse(blockchainMemberName, transactionNodeName, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApiKeyCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApiKeyCollection listRegenerateApiKeys( + String blockchainMemberName, String transactionNodeName, String resourceGroupName) { + ApiKeyCollectionInner inner = + this.serviceClient().listRegenerateApiKeys(blockchainMemberName, transactionNodeName, resourceGroupName); + if (inner != null) { + return new ApiKeyCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listRegenerateApiKeysWithResponse( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + ApiKey apiKey, + Context context) { + Response inner = + this + .serviceClient() + .listRegenerateApiKeysWithResponse( + blockchainMemberName, transactionNodeName, resourceGroupName, apiKey, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApiKeyCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public TransactionNode getById(String id) { + String blockchainMemberName = Utils.getValueFromIdByName(id, "blockchainMembers"); + if (blockchainMemberName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'blockchainMembers'.", id))); + } + String transactionNodeName = Utils.getValueFromIdByName(id, "transactionNodes"); + if (transactionNodeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'transactionNodes'.", id))); + } + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + return this + .getWithResponse(blockchainMemberName, transactionNodeName, resourceGroupName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String blockchainMemberName = Utils.getValueFromIdByName(id, "blockchainMembers"); + if (blockchainMemberName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'blockchainMembers'.", id))); + } + String transactionNodeName = Utils.getValueFromIdByName(id, "transactionNodes"); + if (transactionNodeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'transactionNodes'.", id))); + } + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + return this.getWithResponse(blockchainMemberName, transactionNodeName, resourceGroupName, context); + } + + public void deleteById(String id) { + String blockchainMemberName = Utils.getValueFromIdByName(id, "blockchainMembers"); + if (blockchainMemberName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'blockchainMembers'.", id))); + } + String transactionNodeName = Utils.getValueFromIdByName(id, "transactionNodes"); + if (transactionNodeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'transactionNodes'.", id))); + } + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + this.delete(blockchainMemberName, transactionNodeName, resourceGroupName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String blockchainMemberName = Utils.getValueFromIdByName(id, "blockchainMembers"); + if (blockchainMemberName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'blockchainMembers'.", id))); + } + String transactionNodeName = Utils.getValueFromIdByName(id, "transactionNodes"); + if (transactionNodeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'transactionNodes'.", id))); + } + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + this.delete(blockchainMemberName, transactionNodeName, resourceGroupName, context); + } + + private TransactionNodesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.blockchain.BlockchainManager manager() { + return this.serviceManager; + } + + public TransactionNodeImpl define(String name) { + return new TransactionNodeImpl(name, this.manager()); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/Utils.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/Utils.java new file mode 100644 index 0000000000000..1b685108520fa --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/package-info.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/package-info.java new file mode 100644 index 0000000000000..0815f91f8d265 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for BlockchainManagementClient. REST API for Azure Blockchain Service. */ +package com.azure.resourcemanager.blockchain.implementation; diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ApiKey.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ApiKey.java new file mode 100644 index 0000000000000..2d10af3e3ac0f --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ApiKey.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** API key payload which is exposed in the request/response of the resource provider. */ +@Fluent +public final class ApiKey { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiKey.class); + + /* + * Gets or sets the API key name. + */ + @JsonProperty(value = "keyName") + private String keyName; + + /* + * Gets or sets the API key value. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the keyName property: Gets or sets the API key name. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: Gets or sets the API key name. + * + * @param keyName the keyName value to set. + * @return the ApiKey object itself. + */ + public ApiKey withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the value property: Gets or sets the API key value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Gets or sets the API key value. + * + * @param value the value value to set. + * @return the ApiKey object itself. + */ + public ApiKey withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ApiKeyCollection.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ApiKeyCollection.java new file mode 100644 index 0000000000000..7e6ae2b2f0b16 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ApiKeyCollection.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.resourcemanager.blockchain.fluent.models.ApiKeyCollectionInner; +import java.util.List; + +/** An immutable client-side representation of ApiKeyCollection. */ +public interface ApiKeyCollection { + /** + * Gets the keys property: Gets or sets the collection of API key. + * + * @return the keys value. + */ + List keys(); + + /** + * Gets the inner com.azure.resourcemanager.blockchain.fluent.models.ApiKeyCollectionInner object. + * + * @return the inner object. + */ + ApiKeyCollectionInner innerModel(); +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainMember.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainMember.java new file mode 100644 index 0000000000000..2894f788c3774 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainMember.java @@ -0,0 +1,481 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.blockchain.fluent.models.BlockchainMemberInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of BlockchainMember. */ +public interface BlockchainMember { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the sku property: Gets or sets the blockchain member Sku. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the protocol property: Gets or sets the blockchain protocol. + * + * @return the protocol value. + */ + BlockchainProtocol protocol(); + + /** + * Gets the validatorNodesSku property: Gets or sets the blockchain validator nodes Sku. + * + * @return the validatorNodesSku value. + */ + BlockchainMemberNodesSku validatorNodesSku(); + + /** + * Gets the provisioningState property: Gets or sets the blockchain member provision state. + * + * @return the provisioningState value. + */ + BlockchainMemberProvisioningState provisioningState(); + + /** + * Gets the dns property: Gets the dns endpoint of the blockchain member. + * + * @return the dns value. + */ + String dns(); + + /** + * Gets the username property: Gets the auth user name of the blockchain member. + * + * @return the username value. + */ + String username(); + + /** + * Gets the password property: Sets the basic auth password of the blockchain member. + * + * @return the password value. + */ + String password(); + + /** + * Gets the consortium property: Gets or sets the consortium for the blockchain member. + * + * @return the consortium value. + */ + String consortium(); + + /** + * Gets the consortiumManagementAccountAddress property: Gets the managed consortium management account address. + * + * @return the consortiumManagementAccountAddress value. + */ + String consortiumManagementAccountAddress(); + + /** + * Gets the consortiumManagementAccountPassword property: Sets the managed consortium management account password. + * + * @return the consortiumManagementAccountPassword value. + */ + String consortiumManagementAccountPassword(); + + /** + * Gets the consortiumRole property: Gets the role of the member in the consortium. + * + * @return the consortiumRole value. + */ + String consortiumRole(); + + /** + * Gets the consortiumMemberDisplayName property: Gets the display name of the member in the consortium. + * + * @return the consortiumMemberDisplayName value. + */ + String consortiumMemberDisplayName(); + + /** + * Gets the rootContractAddress property: Gets the Ethereum root contract address of the blockchain. + * + * @return the rootContractAddress value. + */ + String rootContractAddress(); + + /** + * Gets the publicKey property: Gets the public key of the blockchain member (default transaction node). + * + * @return the publicKey value. + */ + String publicKey(); + + /** + * Gets the firewallRules property: Gets or sets firewall rules. + * + * @return the firewallRules value. + */ + List firewallRules(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.blockchain.fluent.models.BlockchainMemberInner object. + * + * @return the inner object. + */ + BlockchainMemberInner innerModel(); + + /** The entirety of the BlockchainMember definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The BlockchainMember definition stages. */ + interface DefinitionStages { + /** The first stage of the BlockchainMember definition. */ + interface Blank extends WithLocation { + } + /** The stage of the BlockchainMember definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the BlockchainMember definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the BlockchainMember definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithSku, + DefinitionStages.WithProtocol, + DefinitionStages.WithValidatorNodesSku, + DefinitionStages.WithPassword, + DefinitionStages.WithConsortium, + DefinitionStages.WithConsortiumManagementAccountPassword, + DefinitionStages.WithConsortiumRole, + DefinitionStages.WithConsortiumMemberDisplayName, + DefinitionStages.WithFirewallRules { + /** + * Executes the create request. + * + * @return the created resource. + */ + BlockchainMember create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BlockchainMember create(Context context); + } + /** The stage of the BlockchainMember definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the BlockchainMember definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Gets or sets the blockchain member Sku.. + * + * @param sku Gets or sets the blockchain member Sku. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** The stage of the BlockchainMember definition allowing to specify protocol. */ + interface WithProtocol { + /** + * Specifies the protocol property: Gets or sets the blockchain protocol.. + * + * @param protocol Gets or sets the blockchain protocol. + * @return the next definition stage. + */ + WithCreate withProtocol(BlockchainProtocol protocol); + } + /** The stage of the BlockchainMember definition allowing to specify validatorNodesSku. */ + interface WithValidatorNodesSku { + /** + * Specifies the validatorNodesSku property: Gets or sets the blockchain validator nodes Sku.. + * + * @param validatorNodesSku Gets or sets the blockchain validator nodes Sku. + * @return the next definition stage. + */ + WithCreate withValidatorNodesSku(BlockchainMemberNodesSku validatorNodesSku); + } + /** The stage of the BlockchainMember definition allowing to specify password. */ + interface WithPassword { + /** + * Specifies the password property: Sets the basic auth password of the blockchain member.. + * + * @param password Sets the basic auth password of the blockchain member. + * @return the next definition stage. + */ + WithCreate withPassword(String password); + } + /** The stage of the BlockchainMember definition allowing to specify consortium. */ + interface WithConsortium { + /** + * Specifies the consortium property: Gets or sets the consortium for the blockchain member.. + * + * @param consortium Gets or sets the consortium for the blockchain member. + * @return the next definition stage. + */ + WithCreate withConsortium(String consortium); + } + /** The stage of the BlockchainMember definition allowing to specify consortiumManagementAccountPassword. */ + interface WithConsortiumManagementAccountPassword { + /** + * Specifies the consortiumManagementAccountPassword property: Sets the managed consortium management + * account password.. + * + * @param consortiumManagementAccountPassword Sets the managed consortium management account password. + * @return the next definition stage. + */ + WithCreate withConsortiumManagementAccountPassword(String consortiumManagementAccountPassword); + } + /** The stage of the BlockchainMember definition allowing to specify consortiumRole. */ + interface WithConsortiumRole { + /** + * Specifies the consortiumRole property: Gets the role of the member in the consortium.. + * + * @param consortiumRole Gets the role of the member in the consortium. + * @return the next definition stage. + */ + WithCreate withConsortiumRole(String consortiumRole); + } + /** The stage of the BlockchainMember definition allowing to specify consortiumMemberDisplayName. */ + interface WithConsortiumMemberDisplayName { + /** + * Specifies the consortiumMemberDisplayName property: Gets the display name of the member in the + * consortium.. + * + * @param consortiumMemberDisplayName Gets the display name of the member in the consortium. + * @return the next definition stage. + */ + WithCreate withConsortiumMemberDisplayName(String consortiumMemberDisplayName); + } + /** The stage of the BlockchainMember definition allowing to specify firewallRules. */ + interface WithFirewallRules { + /** + * Specifies the firewallRules property: Gets or sets firewall rules. + * + * @param firewallRules Gets or sets firewall rules. + * @return the next definition stage. + */ + WithCreate withFirewallRules(List firewallRules); + } + } + /** + * Begins update for the BlockchainMember resource. + * + * @return the stage of resource update. + */ + BlockchainMember.Update update(); + + /** The template for BlockchainMember update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithConsortiumManagementAccountPassword, + UpdateStages.WithPassword, + UpdateStages.WithFirewallRules { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BlockchainMember apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BlockchainMember apply(Context context); + } + /** The BlockchainMember update stages. */ + interface UpdateStages { + /** The stage of the BlockchainMember update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Tags of the service which is a list of key value pairs that describes the + * resource.. + * + * @param tags Tags of the service which is a list of key value pairs that describes the resource. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the BlockchainMember update allowing to specify consortiumManagementAccountPassword. */ + interface WithConsortiumManagementAccountPassword { + /** + * Specifies the consortiumManagementAccountPassword property: Sets the managed consortium management + * account password.. + * + * @param consortiumManagementAccountPassword Sets the managed consortium management account password. + * @return the next definition stage. + */ + Update withConsortiumManagementAccountPassword(String consortiumManagementAccountPassword); + } + /** The stage of the BlockchainMember update allowing to specify password. */ + interface WithPassword { + /** + * Specifies the password property: Sets the transaction node dns endpoint basic auth password.. + * + * @param password Sets the transaction node dns endpoint basic auth password. + * @return the next definition stage. + */ + Update withPassword(String password); + } + /** The stage of the BlockchainMember update allowing to specify firewallRules. */ + interface WithFirewallRules { + /** + * Specifies the firewallRules property: Gets or sets the firewall rules.. + * + * @param firewallRules Gets or sets the firewall rules. + * @return the next definition stage. + */ + Update withFirewallRules(List firewallRules); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BlockchainMember refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BlockchainMember refresh(Context context); + + /** + * Lists the API keys for a blockchain member. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider. + */ + ApiKeyCollection listApiKeys(); + + /** + * Lists the API keys for a blockchain member. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response}. + */ + Response listApiKeysWithResponse(Context context); + + /** + * Regenerate the API keys for a blockchain member. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider. + */ + ApiKeyCollection listRegenerateApiKeys(); + + /** + * Regenerate the API keys for a blockchain member. + * + * @param apiKey api key to be regenerate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response}. + */ + Response listRegenerateApiKeysWithResponse(ApiKey apiKey, Context context); +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainMemberCollection.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainMemberCollection.java new file mode 100644 index 0000000000000..ed503a217678e --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainMemberCollection.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.fluent.models.BlockchainMemberInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of the blockchain member payload which is exposed in the request/response of the resource provider. */ +@Fluent +public final class BlockchainMemberCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BlockchainMemberCollection.class); + + /* + * Gets or sets the collection of blockchain members. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets the URL, that the client should use to fetch the next page + * (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Gets or sets the collection of blockchain members. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets the collection of blockchain members. + * + * @param value the value value to set. + * @return the BlockchainMemberCollection object itself. + */ + public BlockchainMemberCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets the URL, that the client should use to fetch the next page (per server + * side paging). It's null for now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets the URL, that the client should use to fetch the next page (per server + * side paging). It's null for now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the BlockchainMemberCollection object itself. + */ + public BlockchainMemberCollection withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainMemberNodesSku.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainMemberNodesSku.java new file mode 100644 index 0000000000000..8e198c8bc9d1b --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainMemberNodesSku.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Payload of the blockchain member nodes Sku for a blockchain member. */ +@Fluent +public final class BlockchainMemberNodesSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BlockchainMemberNodesSku.class); + + /* + * Gets or sets the nodes capacity. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get the capacity property: Gets or sets the nodes capacity. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Gets or sets the nodes capacity. + * + * @param capacity the capacity value to set. + * @return the BlockchainMemberNodesSku object itself. + */ + public BlockchainMemberNodesSku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainMemberOperationResults.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainMemberOperationResults.java new file mode 100644 index 0000000000000..848960acc1cc2 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainMemberOperationResults.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of BlockchainMemberOperationResults. */ +public interface BlockchainMemberOperationResults { + /** + * Get Async operation result. + * + * @param locationName Location name. + * @param operationId Operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return async operation result. + */ + OperationResult get(String locationName, String operationId); + + /** + * Get Async operation result. + * + * @param locationName Location name. + * @param operationId Operation Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return async operation result along with {@link Response}. + */ + Response getWithResponse(String locationName, String operationId, Context context); +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainMemberProvisioningState.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainMemberProvisioningState.java new file mode 100644 index 0000000000000..18f98885ac3c6 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainMemberProvisioningState.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BlockchainMemberProvisioningState. */ +public final class BlockchainMemberProvisioningState extends ExpandableStringEnum { + /** Static value NotSpecified for BlockchainMemberProvisioningState. */ + public static final BlockchainMemberProvisioningState NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Updating for BlockchainMemberProvisioningState. */ + public static final BlockchainMemberProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for BlockchainMemberProvisioningState. */ + public static final BlockchainMemberProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for BlockchainMemberProvisioningState. */ + public static final BlockchainMemberProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for BlockchainMemberProvisioningState. */ + public static final BlockchainMemberProvisioningState FAILED = fromString("Failed"); + + /** Static value Stale for BlockchainMemberProvisioningState. */ + public static final BlockchainMemberProvisioningState STALE = fromString("Stale"); + + /** + * Creates or finds a BlockchainMemberProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding BlockchainMemberProvisioningState. + */ + @JsonCreator + public static BlockchainMemberProvisioningState fromString(String name) { + return fromString(name, BlockchainMemberProvisioningState.class); + } + + /** @return known BlockchainMemberProvisioningState values. */ + public static Collection values() { + return values(BlockchainMemberProvisioningState.class); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainMemberUpdate.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainMemberUpdate.java new file mode 100644 index 0000000000000..d1bfcdcb9ae24 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainMemberUpdate.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.fluent.models.BlockchainMemberPropertiesUpdate; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Update the payload of the blockchain member which is exposed in the request/response of the resource provider. */ +@Fluent +public final class BlockchainMemberUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BlockchainMemberUpdate.class); + + /* + * Tags of the service which is a list of key value pairs that describes + * the resource. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * Gets or sets the blockchain member update properties. + */ + @JsonProperty(value = "properties") + private BlockchainMemberPropertiesUpdate innerProperties; + + /** + * Get the tags property: Tags of the service which is a list of key value pairs that describes the resource. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Tags of the service which is a list of key value pairs that describes the resource. + * + * @param tags the tags value to set. + * @return the BlockchainMemberUpdate object itself. + */ + public BlockchainMemberUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the innerProperties property: Gets or sets the blockchain member update properties. + * + * @return the innerProperties value. + */ + private BlockchainMemberPropertiesUpdate innerProperties() { + return this.innerProperties; + } + + /** + * Get the consortiumManagementAccountPassword property: Sets the managed consortium management account password. + * + * @return the consortiumManagementAccountPassword value. + */ + public String consortiumManagementAccountPassword() { + return this.innerProperties() == null ? null : this.innerProperties().consortiumManagementAccountPassword(); + } + + /** + * Set the consortiumManagementAccountPassword property: Sets the managed consortium management account password. + * + * @param consortiumManagementAccountPassword the consortiumManagementAccountPassword value to set. + * @return the BlockchainMemberUpdate object itself. + */ + public BlockchainMemberUpdate withConsortiumManagementAccountPassword(String consortiumManagementAccountPassword) { + if (this.innerProperties() == null) { + this.innerProperties = new BlockchainMemberPropertiesUpdate(); + } + this.innerProperties().withConsortiumManagementAccountPassword(consortiumManagementAccountPassword); + return this; + } + + /** + * Get the password property: Sets the transaction node dns endpoint basic auth password. + * + * @return the password value. + */ + public String password() { + return this.innerProperties() == null ? null : this.innerProperties().password(); + } + + /** + * Set the password property: Sets the transaction node dns endpoint basic auth password. + * + * @param password the password value to set. + * @return the BlockchainMemberUpdate object itself. + */ + public BlockchainMemberUpdate withPassword(String password) { + if (this.innerProperties() == null) { + this.innerProperties = new BlockchainMemberPropertiesUpdate(); + } + this.innerProperties().withPassword(password); + return this; + } + + /** + * Get the firewallRules property: Gets or sets the firewall rules. + * + * @return the firewallRules value. + */ + public List firewallRules() { + return this.innerProperties() == null ? null : this.innerProperties().firewallRules(); + } + + /** + * Set the firewallRules property: Gets or sets the firewall rules. + * + * @param firewallRules the firewallRules value to set. + * @return the BlockchainMemberUpdate object itself. + */ + public BlockchainMemberUpdate withFirewallRules(List firewallRules) { + if (this.innerProperties() == null) { + this.innerProperties = new BlockchainMemberPropertiesUpdate(); + } + this.innerProperties().withFirewallRules(firewallRules); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainMembers.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainMembers.java new file mode 100644 index 0000000000000..b254be4d93ea0 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainMembers.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of BlockchainMembers. */ +public interface BlockchainMembers { + /** + * Get details about a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about a blockchain member. + */ + BlockchainMember getByResourceGroup(String resourceGroupName, String blockchainMemberName); + + /** + * Get details about a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about a blockchain member along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String blockchainMemberName, Context context); + + /** + * Delete a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String blockchainMemberName); + + /** + * Delete a blockchain member. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param blockchainMemberName Blockchain member name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String blockchainMemberName, Context context); + + /** + * Lists the blockchain members for a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists the blockchain members for a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists the blockchain members for a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider. + */ + PagedIterable list(); + + /** + * Lists the blockchain members for a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the blockchain member payload which is exposed in the request/response of the resource + * provider. + */ + PagedIterable list(Context context); + + /** + * Lists the consortium members for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of consortium payload. + */ + PagedIterable listConsortiumMembers(String blockchainMemberName, String resourceGroupName); + + /** + * Lists the consortium members for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of consortium payload. + */ + PagedIterable listConsortiumMembers( + String blockchainMemberName, String resourceGroupName, Context context); + + /** + * Lists the API keys for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider. + */ + ApiKeyCollection listApiKeys(String blockchainMemberName, String resourceGroupName); + + /** + * Lists the API keys for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response}. + */ + Response listApiKeysWithResponse( + String blockchainMemberName, String resourceGroupName, Context context); + + /** + * Regenerate the API keys for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider. + */ + ApiKeyCollection listRegenerateApiKeys(String blockchainMemberName, String resourceGroupName); + + /** + * Regenerate the API keys for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param apiKey api key to be regenerate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response}. + */ + Response listRegenerateApiKeysWithResponse( + String blockchainMemberName, String resourceGroupName, ApiKey apiKey, Context context); + + /** + * Get details about a blockchain member. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about a blockchain member along with {@link Response}. + */ + BlockchainMember getById(String id); + + /** + * Get details about a blockchain member. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about a blockchain member along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a blockchain member. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a blockchain member. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new BlockchainMember resource. + * + * @param name resource name. + * @return the first stage of the new BlockchainMember definition. + */ + BlockchainMember.DefinitionStages.Blank define(String name); +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainProtocol.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainProtocol.java new file mode 100644 index 0000000000000..f2c3803090b6e --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/BlockchainProtocol.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BlockchainProtocol. */ +public final class BlockchainProtocol extends ExpandableStringEnum { + /** Static value NotSpecified for BlockchainProtocol. */ + public static final BlockchainProtocol NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Parity for BlockchainProtocol. */ + public static final BlockchainProtocol PARITY = fromString("Parity"); + + /** Static value Quorum for BlockchainProtocol. */ + public static final BlockchainProtocol QUORUM = fromString("Quorum"); + + /** Static value Corda for BlockchainProtocol. */ + public static final BlockchainProtocol CORDA = fromString("Corda"); + + /** + * Creates or finds a BlockchainProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding BlockchainProtocol. + */ + @JsonCreator + public static BlockchainProtocol fromString(String name) { + return fromString(name, BlockchainProtocol.class); + } + + /** @return known BlockchainProtocol values. */ + public static Collection values() { + return values(BlockchainProtocol.class); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/Consortium.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/Consortium.java new file mode 100644 index 0000000000000..5a116749d40db --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/Consortium.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Consortium payload. */ +@Fluent +public final class Consortium { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Consortium.class); + + /* + * Gets or sets the blockchain member name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets or sets the protocol for the consortium. + */ + @JsonProperty(value = "protocol") + private BlockchainProtocol protocol; + + /** + * Get the name property: Gets or sets the blockchain member name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or sets the blockchain member name. + * + * @param name the name value to set. + * @return the Consortium object itself. + */ + public Consortium withName(String name) { + this.name = name; + return this; + } + + /** + * Get the protocol property: Gets or sets the protocol for the consortium. + * + * @return the protocol value. + */ + public BlockchainProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Gets or sets the protocol for the consortium. + * + * @param protocol the protocol value to set. + * @return the Consortium object itself. + */ + public Consortium withProtocol(BlockchainProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ConsortiumCollection.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ConsortiumCollection.java new file mode 100644 index 0000000000000..a3fa8ee7b4fdf --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ConsortiumCollection.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.resourcemanager.blockchain.fluent.models.ConsortiumCollectionInner; +import java.util.List; + +/** An immutable client-side representation of ConsortiumCollection. */ +public interface ConsortiumCollection { + /** + * Gets the value property: Gets or sets the collection of consortiums. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.blockchain.fluent.models.ConsortiumCollectionInner object. + * + * @return the inner object. + */ + ConsortiumCollectionInner innerModel(); +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ConsortiumMember.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ConsortiumMember.java new file mode 100644 index 0000000000000..0e9ac7d207041 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ConsortiumMember.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.resourcemanager.blockchain.fluent.models.ConsortiumMemberInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of ConsortiumMember. */ +public interface ConsortiumMember { + /** + * Gets the name property: Gets the consortium member name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the displayName property: Gets the consortium member display name. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the subscriptionId property: Gets the consortium member subscription id. + * + * @return the subscriptionId value. + */ + String subscriptionId(); + + /** + * Gets the role property: Gets the consortium member role. + * + * @return the role value. + */ + String role(); + + /** + * Gets the status property: Gets the consortium member status. + * + * @return the status value. + */ + String status(); + + /** + * Gets the joinDate property: Gets the consortium member join date. + * + * @return the joinDate value. + */ + OffsetDateTime joinDate(); + + /** + * Gets the dateModified property: Gets the consortium member modified date. + * + * @return the dateModified value. + */ + OffsetDateTime dateModified(); + + /** + * Gets the inner com.azure.resourcemanager.blockchain.fluent.models.ConsortiumMemberInner object. + * + * @return the inner object. + */ + ConsortiumMemberInner innerModel(); +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ConsortiumMemberCollection.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ConsortiumMemberCollection.java new file mode 100644 index 0000000000000..5c0a7211d21bc --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ConsortiumMemberCollection.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.fluent.models.ConsortiumMemberInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of consortium payload. */ +@Fluent +public final class ConsortiumMemberCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConsortiumMemberCollection.class); + + /* + * Gets or sets the collection of consortiums. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets the URL, that the client should use to fetch the next page + * (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Gets or sets the collection of consortiums. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets the collection of consortiums. + * + * @param value the value value to set. + * @return the ConsortiumMemberCollection object itself. + */ + public ConsortiumMemberCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets the URL, that the client should use to fetch the next page (per server + * side paging). It's null for now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets the URL, that the client should use to fetch the next page (per server + * side paging). It's null for now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the ConsortiumMemberCollection object itself. + */ + public ConsortiumMemberCollection withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/FirewallRule.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/FirewallRule.java new file mode 100644 index 0000000000000..19aca46888b03 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/FirewallRule.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Ip range for firewall rules. */ +@Fluent +public final class FirewallRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallRule.class); + + /* + * Gets or sets the name of the firewall rules. + */ + @JsonProperty(value = "ruleName") + private String ruleName; + + /* + * Gets or sets the start IP address of the firewall rule range. + */ + @JsonProperty(value = "startIpAddress") + private String startIpAddress; + + /* + * Gets or sets the end IP address of the firewall rule range. + */ + @JsonProperty(value = "endIpAddress") + private String endIpAddress; + + /** + * Get the ruleName property: Gets or sets the name of the firewall rules. + * + * @return the ruleName value. + */ + public String ruleName() { + return this.ruleName; + } + + /** + * Set the ruleName property: Gets or sets the name of the firewall rules. + * + * @param ruleName the ruleName value to set. + * @return the FirewallRule object itself. + */ + public FirewallRule withRuleName(String ruleName) { + this.ruleName = ruleName; + return this; + } + + /** + * Get the startIpAddress property: Gets or sets the start IP address of the firewall rule range. + * + * @return the startIpAddress value. + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Set the startIpAddress property: Gets or sets the start IP address of the firewall rule range. + * + * @param startIpAddress the startIpAddress value to set. + * @return the FirewallRule object itself. + */ + public FirewallRule withStartIpAddress(String startIpAddress) { + this.startIpAddress = startIpAddress; + return this; + } + + /** + * Get the endIpAddress property: Gets or sets the end IP address of the firewall rule range. + * + * @return the endIpAddress value. + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Set the endIpAddress property: Gets or sets the end IP address of the firewall rule range. + * + * @param endIpAddress the endIpAddress value to set. + * @return the FirewallRule object itself. + */ + public FirewallRule withEndIpAddress(String endIpAddress) { + this.endIpAddress = endIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/Locations.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/Locations.java new file mode 100644 index 0000000000000..5138a2d894fc8 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/Locations.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Locations. */ +public interface Locations { + /** + * To check whether a resource name is available. + * + * @param locationName Location Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability payload which is exposed in the response of the resource provider. + */ + NameAvailability checkNameAvailability(String locationName); + + /** + * To check whether a resource name is available. + * + * @param locationName Location Name. + * @param nameAvailabilityRequest Name availability request payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability payload which is exposed in the response of the resource provider along with {@link + * Response}. + */ + Response checkNameAvailabilityWithResponse( + String locationName, NameAvailabilityRequest nameAvailabilityRequest, Context context); + + /** + * Lists the available consortiums for a subscription. + * + * @param locationName Location Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the consortium payload. + */ + ConsortiumCollection listConsortiums(String locationName); + + /** + * Lists the available consortiums for a subscription. + * + * @param locationName Location Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the consortium payload along with {@link Response}. + */ + Response listConsortiumsWithResponse(String locationName, Context context); +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/NameAvailability.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/NameAvailability.java new file mode 100644 index 0000000000000..cc86e6288d21f --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/NameAvailability.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.resourcemanager.blockchain.fluent.models.NameAvailabilityInner; + +/** An immutable client-side representation of NameAvailability. */ +public interface NameAvailability { + /** + * Gets the nameAvailable property: Gets or sets the value indicating whether the name is available. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the message property: Gets or sets the message. + * + * @return the message value. + */ + String message(); + + /** + * Gets the reason property: Gets or sets the name availability reason. + * + * @return the reason value. + */ + NameAvailabilityReason reason(); + + /** + * Gets the inner com.azure.resourcemanager.blockchain.fluent.models.NameAvailabilityInner object. + * + * @return the inner object. + */ + NameAvailabilityInner innerModel(); +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/NameAvailabilityReason.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/NameAvailabilityReason.java new file mode 100644 index 0000000000000..c1e66e72a0586 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/NameAvailabilityReason.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NameAvailabilityReason. */ +public final class NameAvailabilityReason extends ExpandableStringEnum { + /** Static value NotSpecified for NameAvailabilityReason. */ + public static final NameAvailabilityReason NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value AlreadyExists for NameAvailabilityReason. */ + public static final NameAvailabilityReason ALREADY_EXISTS = fromString("AlreadyExists"); + + /** Static value Invalid for NameAvailabilityReason. */ + public static final NameAvailabilityReason INVALID = fromString("Invalid"); + + /** + * Creates or finds a NameAvailabilityReason from its string representation. + * + * @param name a name to look for. + * @return the corresponding NameAvailabilityReason. + */ + @JsonCreator + public static NameAvailabilityReason fromString(String name) { + return fromString(name, NameAvailabilityReason.class); + } + + /** @return known NameAvailabilityReason values. */ + public static Collection values() { + return values(NameAvailabilityReason.class); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/NameAvailabilityRequest.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/NameAvailabilityRequest.java new file mode 100644 index 0000000000000..ad47d1692f7bf --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/NameAvailabilityRequest.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Name availability request payload which is exposed in the request of the resource provider. */ +@Fluent +public final class NameAvailabilityRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NameAvailabilityRequest.class); + + /* + * Gets or sets the name to check. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets or sets the type of the resource to check. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the name property: Gets or sets the name to check. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or sets the name to check. + * + * @param name the name value to set. + * @return the NameAvailabilityRequest object itself. + */ + public NameAvailabilityRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Gets or sets the type of the resource to check. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Gets or sets the type of the resource to check. + * + * @param type the type value to set. + * @return the NameAvailabilityRequest object itself. + */ + public NameAvailabilityRequest withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/NodeProvisioningState.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/NodeProvisioningState.java new file mode 100644 index 0000000000000..7e1676de2824e --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/NodeProvisioningState.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NodeProvisioningState. */ +public final class NodeProvisioningState extends ExpandableStringEnum { + /** Static value NotSpecified for NodeProvisioningState. */ + public static final NodeProvisioningState NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Updating for NodeProvisioningState. */ + public static final NodeProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for NodeProvisioningState. */ + public static final NodeProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for NodeProvisioningState. */ + public static final NodeProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for NodeProvisioningState. */ + public static final NodeProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a NodeProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding NodeProvisioningState. + */ + @JsonCreator + public static NodeProvisioningState fromString(String name) { + return fromString(name, NodeProvisioningState.class); + } + + /** @return known NodeProvisioningState values. */ + public static Collection values() { + return values(NodeProvisioningState.class); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/OperationResult.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/OperationResult.java new file mode 100644 index 0000000000000..238b25b12747d --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/OperationResult.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.resourcemanager.blockchain.fluent.models.OperationResultInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of OperationResult. */ +public interface OperationResult { + /** + * Gets the name property: Gets or sets the operation name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the startTime property: Gets or sets the operation start time. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: Gets or sets the operation end time. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the inner com.azure.resourcemanager.blockchain.fluent.models.OperationResultInner object. + * + * @return the inner object. + */ + OperationResultInner innerModel(); +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/Operations.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/Operations.java new file mode 100644 index 0000000000000..de34e72d4a0c6 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists the available operations of Microsoft.Blockchain resource provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of operation payload which is exposed in the response of the resource provider. + */ + PagedIterable list(); + + /** + * Lists the available operations of Microsoft.Blockchain resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of operation payload which is exposed in the response of the resource provider. + */ + PagedIterable list(Context context); +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ResourceProviderOperation.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ResourceProviderOperation.java new file mode 100644 index 0000000000000..8d6488f1ca2d5 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ResourceProviderOperation.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.resourcemanager.blockchain.fluent.models.ResourceProviderOperationInner; + +/** An immutable client-side representation of ResourceProviderOperation. */ +public interface ResourceProviderOperation { + /** + * Gets the origin property: Gets or sets the origin. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the name property: Gets or sets the operation name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Gets or sets a value indicating whether the operation is a data action or not. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Gets or sets operation display. + * + * @return the display value. + */ + ResourceProviderOperationDisplay display(); + + /** + * Gets the inner com.azure.resourcemanager.blockchain.fluent.models.ResourceProviderOperationInner object. + * + * @return the inner object. + */ + ResourceProviderOperationInner innerModel(); +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ResourceProviderOperationCollection.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ResourceProviderOperationCollection.java new file mode 100644 index 0000000000000..9711eb10a5147 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ResourceProviderOperationCollection.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.fluent.models.ResourceProviderOperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of operation payload which is exposed in the response of the resource provider. */ +@Fluent +public final class ResourceProviderOperationCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProviderOperationCollection.class); + + /* + * Gets or sets the collection of operations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets the URL, that the client should use to fetch the next page + * (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Gets or sets the collection of operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets the collection of operations. + * + * @param value the value value to set. + * @return the ResourceProviderOperationCollection object itself. + */ + public ResourceProviderOperationCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets the URL, that the client should use to fetch the next page (per server + * side paging). It's null for now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets the URL, that the client should use to fetch the next page (per server + * side paging). It's null for now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the ResourceProviderOperationCollection object itself. + */ + public ResourceProviderOperationCollection withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ResourceProviderOperationDisplay.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ResourceProviderOperationDisplay.java new file mode 100644 index 0000000000000..311793b097216 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ResourceProviderOperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operation display payload which is exposed in the response of the resource provider. */ +@Fluent +public final class ResourceProviderOperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProviderOperationDisplay.class); + + /* + * Gets or sets the name of the provider for display purposes. + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Gets or sets the name of the resource type for display purposes. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Gets or sets the name of the operation for display purposes. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Gets or sets the description of the provider for display purposes. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: Gets or sets the name of the provider for display purposes. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Gets or sets the name of the provider for display purposes. + * + * @param provider the provider value to set. + * @return the ResourceProviderOperationDisplay object itself. + */ + public ResourceProviderOperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Gets or sets the name of the resource type for display purposes. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Gets or sets the name of the resource type for display purposes. + * + * @param resource the resource value to set. + * @return the ResourceProviderOperationDisplay object itself. + */ + public ResourceProviderOperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Gets or sets the name of the operation for display purposes. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Gets or sets the name of the operation for display purposes. + * + * @param operation the operation value to set. + * @return the ResourceProviderOperationDisplay object itself. + */ + public ResourceProviderOperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Gets or sets the description of the provider for display purposes. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Gets or sets the description of the provider for display purposes. + * + * @param description the description value to set. + * @return the ResourceProviderOperationDisplay object itself. + */ + public ResourceProviderOperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ResourceTypeSku.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ResourceTypeSku.java new file mode 100644 index 0000000000000..75572aac98679 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ResourceTypeSku.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Resource type Sku. */ +@Fluent +public final class ResourceTypeSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceTypeSku.class); + + /* + * Gets or sets the resource type + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /* + * Gets or sets the Skus + */ + @JsonProperty(value = "skus") + private List skus; + + /** + * Get the resourceType property: Gets or sets the resource type. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: Gets or sets the resource type. + * + * @param resourceType the resourceType value to set. + * @return the ResourceTypeSku object itself. + */ + public ResourceTypeSku withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the skus property: Gets or sets the Skus. + * + * @return the skus value. + */ + public List skus() { + return this.skus; + } + + /** + * Set the skus property: Gets or sets the Skus. + * + * @param skus the skus value to set. + * @return the ResourceTypeSku object itself. + */ + public ResourceTypeSku withSkus(List skus) { + this.skus = skus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (skus() != null) { + skus().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ResourceTypeSkuCollection.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ResourceTypeSkuCollection.java new file mode 100644 index 0000000000000..3c80d9c29a9b7 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/ResourceTypeSkuCollection.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.resourcemanager.blockchain.fluent.models.ResourceTypeSkuCollectionInner; +import java.util.List; + +/** An immutable client-side representation of ResourceTypeSkuCollection. */ +public interface ResourceTypeSkuCollection { + /** + * Gets the value property: Gets or sets the collection of resource type Sku. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.blockchain.fluent.models.ResourceTypeSkuCollectionInner object. + * + * @return the inner object. + */ + ResourceTypeSkuCollectionInner innerModel(); +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/Sku.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/Sku.java new file mode 100644 index 0000000000000..39bd10b0152e8 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/Sku.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Blockchain member Sku in payload. */ +@Fluent +public final class Sku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); + + /* + * Gets or sets Sku name + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets or sets Sku tier + */ + @JsonProperty(value = "tier") + private String tier; + + /** + * Get the name property: Gets or sets Sku name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or sets Sku name. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Gets or sets Sku tier. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: Gets or sets Sku tier. + * + * @param tier the tier value to set. + * @return the Sku object itself. + */ + public Sku withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/SkuSetting.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/SkuSetting.java new file mode 100644 index 0000000000000..9543701245576 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/SkuSetting.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Sku Setting. */ +@Fluent +public final class SkuSetting { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuSetting.class); + + /* + * Gets or sets the Sku name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets or sets the Sku tier. + */ + @JsonProperty(value = "tier") + private String tier; + + /* + * Gets or sets the locations. + */ + @JsonProperty(value = "locations") + private List locations; + + /* + * Gets or sets the required features. + */ + @JsonProperty(value = "requiredFeatures") + private List requiredFeatures; + + /** + * Get the name property: Gets or sets the Sku name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or sets the Sku name. + * + * @param name the name value to set. + * @return the SkuSetting object itself. + */ + public SkuSetting withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Gets or sets the Sku tier. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: Gets or sets the Sku tier. + * + * @param tier the tier value to set. + * @return the SkuSetting object itself. + */ + public SkuSetting withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the locations property: Gets or sets the locations. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Set the locations property: Gets or sets the locations. + * + * @param locations the locations value to set. + * @return the SkuSetting object itself. + */ + public SkuSetting withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get the requiredFeatures property: Gets or sets the required features. + * + * @return the requiredFeatures value. + */ + public List requiredFeatures() { + return this.requiredFeatures; + } + + /** + * Set the requiredFeatures property: Gets or sets the required features. + * + * @param requiredFeatures the requiredFeatures value to set. + * @return the SkuSetting object itself. + */ + public SkuSetting withRequiredFeatures(List requiredFeatures) { + this.requiredFeatures = requiredFeatures; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/Skus.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/Skus.java new file mode 100644 index 0000000000000..9bc9df759d52b --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/Skus.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Skus. */ +public interface Skus { + /** + * Lists the Skus of the resource type. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the resource type Sku. + */ + ResourceTypeSkuCollection list(); + + /** + * Lists the Skus of the resource type. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the resource type Sku along with {@link Response}. + */ + Response listWithResponse(Context context); +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/TransactionNode.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/TransactionNode.java new file mode 100644 index 0000000000000..0467ffb730768 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/TransactionNode.java @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.blockchain.fluent.models.TransactionNodeInner; +import java.util.List; + +/** An immutable client-side representation of TransactionNode. */ +public interface TransactionNode { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: Gets or sets the transaction node location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the provisioningState property: Gets or sets the blockchain member provision state. + * + * @return the provisioningState value. + */ + NodeProvisioningState provisioningState(); + + /** + * Gets the dns property: Gets or sets the transaction node dns endpoint. + * + * @return the dns value. + */ + String dns(); + + /** + * Gets the publicKey property: Gets or sets the transaction node public key. + * + * @return the publicKey value. + */ + String publicKey(); + + /** + * Gets the username property: Gets or sets the transaction node dns endpoint basic auth user name. + * + * @return the username value. + */ + String username(); + + /** + * Gets the password property: Sets the transaction node dns endpoint basic auth password. + * + * @return the password value. + */ + String password(); + + /** + * Gets the firewallRules property: Gets or sets the firewall rules. + * + * @return the firewallRules value. + */ + List firewallRules(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.blockchain.fluent.models.TransactionNodeInner object. + * + * @return the inner object. + */ + TransactionNodeInner innerModel(); + + /** The entirety of the TransactionNode definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The TransactionNode definition stages. */ + interface DefinitionStages { + /** The first stage of the TransactionNode definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the TransactionNode definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies blockchainMemberName, resourceGroupName. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @return the next definition stage. + */ + WithCreate withExistingBlockchainMember(String blockchainMemberName, String resourceGroupName); + } + /** + * The stage of the TransactionNode definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithLocation, DefinitionStages.WithPassword, DefinitionStages.WithFirewallRules { + /** + * Executes the create request. + * + * @return the created resource. + */ + TransactionNode create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + TransactionNode create(Context context); + } + /** The stage of the TransactionNode definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location Gets or sets the transaction node location. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location Gets or sets the transaction node location. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** The stage of the TransactionNode definition allowing to specify password. */ + interface WithPassword { + /** + * Specifies the password property: Sets the transaction node dns endpoint basic auth password.. + * + * @param password Sets the transaction node dns endpoint basic auth password. + * @return the next definition stage. + */ + WithCreate withPassword(String password); + } + /** The stage of the TransactionNode definition allowing to specify firewallRules. */ + interface WithFirewallRules { + /** + * Specifies the firewallRules property: Gets or sets the firewall rules.. + * + * @param firewallRules Gets or sets the firewall rules. + * @return the next definition stage. + */ + WithCreate withFirewallRules(List firewallRules); + } + } + /** + * Begins update for the TransactionNode resource. + * + * @return the stage of resource update. + */ + TransactionNode.Update update(); + + /** The template for TransactionNode update. */ + interface Update extends UpdateStages.WithPassword, UpdateStages.WithFirewallRules { + /** + * Executes the update request. + * + * @return the updated resource. + */ + TransactionNode apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + TransactionNode apply(Context context); + } + /** The TransactionNode update stages. */ + interface UpdateStages { + /** The stage of the TransactionNode update allowing to specify password. */ + interface WithPassword { + /** + * Specifies the password property: Sets the transaction node dns endpoint basic auth password.. + * + * @param password Sets the transaction node dns endpoint basic auth password. + * @return the next definition stage. + */ + Update withPassword(String password); + } + /** The stage of the TransactionNode update allowing to specify firewallRules. */ + interface WithFirewallRules { + /** + * Specifies the firewallRules property: Gets or sets the firewall rules.. + * + * @param firewallRules Gets or sets the firewall rules. + * @return the next definition stage. + */ + Update withFirewallRules(List firewallRules); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + TransactionNode refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + TransactionNode refresh(Context context); + + /** + * List the API keys for the transaction node. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider. + */ + ApiKeyCollection listApiKeys(); + + /** + * List the API keys for the transaction node. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response}. + */ + Response listApiKeysWithResponse(Context context); + + /** + * Regenerate the API keys for the blockchain member. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider. + */ + ApiKeyCollection listRegenerateApiKeys(); + + /** + * Regenerate the API keys for the blockchain member. + * + * @param apiKey api key to be regenerated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response}. + */ + Response listRegenerateApiKeysWithResponse(ApiKey apiKey, Context context); +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/TransactionNodeCollection.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/TransactionNodeCollection.java new file mode 100644 index 0000000000000..ea4680197490b --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/TransactionNodeCollection.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.fluent.models.TransactionNodeInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of transaction node payload which is exposed in the request/response of the resource provider. */ +@Fluent +public final class TransactionNodeCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TransactionNodeCollection.class); + + /* + * Gets or sets the collection of transaction nodes. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets the URL, that the client should use to fetch the next page + * (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Gets or sets the collection of transaction nodes. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets the collection of transaction nodes. + * + * @param value the value value to set. + * @return the TransactionNodeCollection object itself. + */ + public TransactionNodeCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets the URL, that the client should use to fetch the next page (per server + * side paging). It's null for now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets the URL, that the client should use to fetch the next page (per server + * side paging). It's null for now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the TransactionNodeCollection object itself. + */ + public TransactionNodeCollection withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/TransactionNodeUpdate.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/TransactionNodeUpdate.java new file mode 100644 index 0000000000000..1d9489cb9a797 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/TransactionNodeUpdate.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.blockchain.fluent.models.TransactionNodePropertiesUpdate; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Update the transaction node payload which is exposed in the request/response of the resource provider. */ +@Fluent +public final class TransactionNodeUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TransactionNodeUpdate.class); + + /* + * Gets or sets the transaction node update properties. + */ + @JsonProperty(value = "properties") + private TransactionNodePropertiesUpdate innerProperties; + + /** + * Get the innerProperties property: Gets or sets the transaction node update properties. + * + * @return the innerProperties value. + */ + private TransactionNodePropertiesUpdate innerProperties() { + return this.innerProperties; + } + + /** + * Get the password property: Sets the transaction node dns endpoint basic auth password. + * + * @return the password value. + */ + public String password() { + return this.innerProperties() == null ? null : this.innerProperties().password(); + } + + /** + * Set the password property: Sets the transaction node dns endpoint basic auth password. + * + * @param password the password value to set. + * @return the TransactionNodeUpdate object itself. + */ + public TransactionNodeUpdate withPassword(String password) { + if (this.innerProperties() == null) { + this.innerProperties = new TransactionNodePropertiesUpdate(); + } + this.innerProperties().withPassword(password); + return this; + } + + /** + * Get the firewallRules property: Gets or sets the firewall rules. + * + * @return the firewallRules value. + */ + public List firewallRules() { + return this.innerProperties() == null ? null : this.innerProperties().firewallRules(); + } + + /** + * Set the firewallRules property: Gets or sets the firewall rules. + * + * @param firewallRules the firewallRules value to set. + * @return the TransactionNodeUpdate object itself. + */ + public TransactionNodeUpdate withFirewallRules(List firewallRules) { + if (this.innerProperties() == null) { + this.innerProperties = new TransactionNodePropertiesUpdate(); + } + this.innerProperties().withFirewallRules(firewallRules); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/TransactionNodes.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/TransactionNodes.java new file mode 100644 index 0000000000000..f7a6b4117e627 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/TransactionNodes.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of TransactionNodes. */ +public interface TransactionNodes { + /** + * Get the details of the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the transaction node. + */ + TransactionNode get(String blockchainMemberName, String transactionNodeName, String resourceGroupName); + + /** + * Get the details of the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the transaction node along with {@link Response}. + */ + Response getWithResponse( + String blockchainMemberName, String transactionNodeName, String resourceGroupName, Context context); + + /** + * Delete the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String blockchainMemberName, String transactionNodeName, String resourceGroupName); + + /** + * Delete the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String blockchainMemberName, String transactionNodeName, String resourceGroupName, Context context); + + /** + * Lists the transaction nodes for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of transaction node payload which is exposed in the request/response of the resource provider. + */ + PagedIterable list(String blockchainMemberName, String resourceGroupName); + + /** + * Lists the transaction nodes for a blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of transaction node payload which is exposed in the request/response of the resource provider. + */ + PagedIterable list(String blockchainMemberName, String resourceGroupName, Context context); + + /** + * List the API keys for the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider. + */ + ApiKeyCollection listApiKeys(String blockchainMemberName, String transactionNodeName, String resourceGroupName); + + /** + * List the API keys for the transaction node. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response}. + */ + Response listApiKeysWithResponse( + String blockchainMemberName, String transactionNodeName, String resourceGroupName, Context context); + + /** + * Regenerate the API keys for the blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider. + */ + ApiKeyCollection listRegenerateApiKeys( + String blockchainMemberName, String transactionNodeName, String resourceGroupName); + + /** + * Regenerate the API keys for the blockchain member. + * + * @param blockchainMemberName Blockchain member name. + * @param transactionNodeName Transaction node name. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param apiKey api key to be regenerated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of the API key payload which is exposed in the response of the resource provider along with + * {@link Response}. + */ + Response listRegenerateApiKeysWithResponse( + String blockchainMemberName, + String transactionNodeName, + String resourceGroupName, + ApiKey apiKey, + Context context); + + /** + * Get the details of the transaction node. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the transaction node along with {@link Response}. + */ + TransactionNode getById(String id); + + /** + * Get the details of the transaction node. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of the transaction node along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the transaction node. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the transaction node. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new TransactionNode resource. + * + * @param name resource name. + * @return the first stage of the new TransactionNode definition. + */ + TransactionNode.DefinitionStages.Blank define(String name); +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/package-info.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/package-info.java new file mode 100644 index 0000000000000..a9a0332c4fbb3 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for BlockchainManagementClient. REST API for Azure Blockchain Service. */ +package com.azure.resourcemanager.blockchain.models; diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/package-info.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/package-info.java new file mode 100644 index 0000000000000..882136f7c619d --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/com/azure/resourcemanager/blockchain/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for BlockchainManagementClient. REST API for Azure Blockchain Service. */ +package com.azure.resourcemanager.blockchain; diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/module-info.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/module-info.java new file mode 100644 index 0000000000000..1e6da816109b1 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.blockchain { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.blockchain; + exports com.azure.resourcemanager.blockchain.fluent; + exports com.azure.resourcemanager.blockchain.fluent.models; + exports com.azure.resourcemanager.blockchain.models; + + opens com.azure.resourcemanager.blockchain.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.blockchain.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMemberOperationResultsGetSamples.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMemberOperationResultsGetSamples.java new file mode 100644 index 0000000000000..25287b7e933d5 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMemberOperationResultsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.generated; + +import com.azure.core.util.Context; + +/** Samples for BlockchainMemberOperationResults Get. */ +public final class BlockchainMemberOperationResultsGetSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/BlockchainMemberOperationResults_Get.json + */ + /** + * Sample code: BlockchainMemberOperationResults_Get. + * + * @param manager Entry point to BlockchainManager. + */ + public static void blockchainMemberOperationResultsGet( + com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager + .blockchainMemberOperationResults() + .getWithResponse("southeastasia", "12f4b309-01e3-4fcf-bc0b-1cc034ca03f8", Context.NONE); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersCreateSamples.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersCreateSamples.java new file mode 100644 index 0000000000000..659d4b52885bb --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersCreateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.generated; + +import com.azure.resourcemanager.blockchain.models.BlockchainMemberNodesSku; +import com.azure.resourcemanager.blockchain.models.BlockchainProtocol; + +/** Samples for BlockchainMembers Create. */ +public final class BlockchainMembersCreateSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/BlockchainMembers_Create.json + */ + /** + * Sample code: BlockchainMembers_Create. + * + * @param manager Entry point to BlockchainManager. + */ + public static void blockchainMembersCreate(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager + .blockchainMembers() + .define("contosemember1") + .withRegion("southeastasia") + .withExistingResourceGroup("mygroup") + .withProtocol(BlockchainProtocol.QUORUM) + .withValidatorNodesSku(new BlockchainMemberNodesSku().withCapacity(2)) + .withPassword("") + .withConsortium("ContoseConsortium") + .withConsortiumManagementAccountPassword("") + .create(); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersDeleteSamples.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersDeleteSamples.java new file mode 100644 index 0000000000000..1260dc4bb0531 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.generated; + +import com.azure.core.util.Context; + +/** Samples for BlockchainMembers Delete. */ +public final class BlockchainMembersDeleteSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/BlockchainMembers_Delete.json + */ + /** + * Sample code: BlockchainMembers_Delete. + * + * @param manager Entry point to BlockchainManager. + */ + public static void blockchainMembersDelete(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.blockchainMembers().delete("mygroup", "contosemember1", Context.NONE); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersGetByResourceGroupSamples.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..6b2e905764dd3 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.generated; + +import com.azure.core.util.Context; + +/** Samples for BlockchainMembers GetByResourceGroup. */ +public final class BlockchainMembersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/BlockchainMembers_Get.json + */ + /** + * Sample code: BlockchainMembers_Get. + * + * @param manager Entry point to BlockchainManager. + */ + public static void blockchainMembersGet(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.blockchainMembers().getByResourceGroupWithResponse("mygroup", "contosemember1", Context.NONE); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersListApiKeysSamples.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersListApiKeysSamples.java new file mode 100644 index 0000000000000..b959dec7a05fa --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersListApiKeysSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.generated; + +import com.azure.core.util.Context; + +/** Samples for BlockchainMembers ListApiKeys. */ +public final class BlockchainMembersListApiKeysSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/BlockchainMembers_ListApiKeys.json + */ + /** + * Sample code: BlockchainMembers_ListApiKeys. + * + * @param manager Entry point to BlockchainManager. + */ + public static void blockchainMembersListApiKeys(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.blockchainMembers().listApiKeysWithResponse("contosemember1", "mygroup", Context.NONE); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersListByResourceGroupSamples.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersListByResourceGroupSamples.java new file mode 100644 index 0000000000000..ff811be815ec2 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.generated; + +import com.azure.core.util.Context; + +/** Samples for BlockchainMembers ListByResourceGroup. */ +public final class BlockchainMembersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/BlockchainMembers_List.json + */ + /** + * Sample code: BlockchainMembers_List. + * + * @param manager Entry point to BlockchainManager. + */ + public static void blockchainMembersList(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.blockchainMembers().listByResourceGroup("mygroup", Context.NONE); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersListConsortiumMembersSamples.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersListConsortiumMembersSamples.java new file mode 100644 index 0000000000000..37eac267d134b --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersListConsortiumMembersSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.generated; + +import com.azure.core.util.Context; + +/** Samples for BlockchainMembers ListConsortiumMembers. */ +public final class BlockchainMembersListConsortiumMembersSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/BlockchainMembers_ListConsortiumMembers.json + */ + /** + * Sample code: BlockchainMembers_ListConsortiumMembers. + * + * @param manager Entry point to BlockchainManager. + */ + public static void blockchainMembersListConsortiumMembers( + com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.blockchainMembers().listConsortiumMembers("contosemember1", "mygroup", Context.NONE); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersListRegenerateApiKeysSamples.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersListRegenerateApiKeysSamples.java new file mode 100644 index 0000000000000..a8bdbb638d8aa --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersListRegenerateApiKeysSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.blockchain.models.ApiKey; + +/** Samples for BlockchainMembers ListRegenerateApiKeys. */ +public final class BlockchainMembersListRegenerateApiKeysSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/BlockchainMembers_ListRegenerateApiKeys.json + */ + /** + * Sample code: BlockchainMembers_ListRegenerateApiKeys. + * + * @param manager Entry point to BlockchainManager. + */ + public static void blockchainMembersListRegenerateApiKeys( + com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager + .blockchainMembers() + .listRegenerateApiKeysWithResponse( + "contosemember1", "mygroup", new ApiKey().withKeyName("key1"), Context.NONE); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersListSamples.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersListSamples.java new file mode 100644 index 0000000000000..f9bbc2bd9a9b6 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.generated; + +import com.azure.core.util.Context; + +/** Samples for BlockchainMembers List. */ +public final class BlockchainMembersListSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/BlockchainMembers_ListAll.json + */ + /** + * Sample code: BlockchainMembers_ListAll. + * + * @param manager Entry point to BlockchainManager. + */ + public static void blockchainMembersListAll(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.blockchainMembers().list(Context.NONE); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersUpdateSamples.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersUpdateSamples.java new file mode 100644 index 0000000000000..5e2fa14f95011 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/BlockchainMembersUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.blockchain.models.BlockchainMember; + +/** Samples for BlockchainMembers Update. */ +public final class BlockchainMembersUpdateSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/BlockchainMembers_Update.json + */ + /** + * Sample code: BlockchainMembers_Update. + * + * @param manager Entry point to BlockchainManager. + */ + public static void blockchainMembersUpdate(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + BlockchainMember resource = + manager + .blockchainMembers() + .getByResourceGroupWithResponse("mygroup", "ContoseMember1", Context.NONE) + .getValue(); + resource + .update() + .withConsortiumManagementAccountPassword("") + .withPassword("") + .apply(); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/LocationsCheckNameAvailabilitySamples.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/LocationsCheckNameAvailabilitySamples.java new file mode 100644 index 0000000000000..befc083a39967 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/LocationsCheckNameAvailabilitySamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.blockchain.models.NameAvailabilityRequest; + +/** Samples for Locations CheckNameAvailability. */ +public final class LocationsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/Locations_CheckNameAvailability.json + */ + /** + * Sample code: Locations_CheckNameAvailability. + * + * @param manager Entry point to BlockchainManager. + */ + public static void locationsCheckNameAvailability(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager + .locations() + .checkNameAvailabilityWithResponse( + "southeastasia", + new NameAvailabilityRequest() + .withName("contosemember1") + .withType("Microsoft.Blockchain/blockchainMembers"), + Context.NONE); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/LocationsListConsortiumsSamples.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/LocationsListConsortiumsSamples.java new file mode 100644 index 0000000000000..ede817c49d860 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/LocationsListConsortiumsSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.generated; + +import com.azure.core.util.Context; + +/** Samples for Locations ListConsortiums. */ +public final class LocationsListConsortiumsSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/Locations_ListConsortiums.json + */ + /** + * Sample code: Locations_ListConsortiums. + * + * @param manager Entry point to BlockchainManager. + */ + public static void locationsListConsortiums(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.locations().listConsortiumsWithResponse("southeastasia", Context.NONE); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/OperationsListSamples.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..b4d79d4f3203d --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/Operations_List.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to BlockchainManager. + */ + public static void operationsList(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/SkusListSamples.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/SkusListSamples.java new file mode 100644 index 0000000000000..a77a91a30f5a1 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/SkusListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.generated; + +import com.azure.core.util.Context; + +/** Samples for Skus List. */ +public final class SkusListSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/Skus_List.json + */ + /** + * Sample code: Skus_List. + * + * @param manager Entry point to BlockchainManager. + */ + public static void skusList(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.skus().listWithResponse(Context.NONE); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/TransactionNodesCreateSamples.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/TransactionNodesCreateSamples.java new file mode 100644 index 0000000000000..69896b1a2b30b --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/TransactionNodesCreateSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.generated; + +/** Samples for TransactionNodes Create. */ +public final class TransactionNodesCreateSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/TransactionNodes_Create.json + */ + /** + * Sample code: TransactionNodes_Create. + * + * @param manager Entry point to BlockchainManager. + */ + public static void transactionNodesCreate(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager + .transactionNodes() + .define("txnode2") + .withExistingBlockchainMember("contosemember1", "mygroup") + .withRegion("southeastasia") + .withPassword("") + .create(); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/TransactionNodesDeleteSamples.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/TransactionNodesDeleteSamples.java new file mode 100644 index 0000000000000..18866784b67db --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/TransactionNodesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.generated; + +import com.azure.core.util.Context; + +/** Samples for TransactionNodes Delete. */ +public final class TransactionNodesDeleteSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/TransactionNodes_Delete.json + */ + /** + * Sample code: TransactionNodes_Delete. + * + * @param manager Entry point to BlockchainManager. + */ + public static void transactionNodesDelete(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.transactionNodes().delete("contosemember1", "txNode2", "mygroup", Context.NONE); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/TransactionNodesGetSamples.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/TransactionNodesGetSamples.java new file mode 100644 index 0000000000000..0577504b3ac6e --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/TransactionNodesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.generated; + +import com.azure.core.util.Context; + +/** Samples for TransactionNodes Get. */ +public final class TransactionNodesGetSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/TransactionNodes_Get.json + */ + /** + * Sample code: TransactionNodes_Get. + * + * @param manager Entry point to BlockchainManager. + */ + public static void transactionNodesGet(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.transactionNodes().getWithResponse("contosemember1", "txnode2", "mygroup", Context.NONE); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/TransactionNodesListApiKeysSamples.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/TransactionNodesListApiKeysSamples.java new file mode 100644 index 0000000000000..4147ff05826cf --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/TransactionNodesListApiKeysSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.generated; + +import com.azure.core.util.Context; + +/** Samples for TransactionNodes ListApiKeys. */ +public final class TransactionNodesListApiKeysSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/TransactionNodes_ListApiKeys.json + */ + /** + * Sample code: TransactionNodes_ListApiKeys. + * + * @param manager Entry point to BlockchainManager. + */ + public static void transactionNodesListApiKeys(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.transactionNodes().listApiKeysWithResponse("contosemember1", "txnode2", "mygroup", Context.NONE); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/TransactionNodesListRegenerateApiKeysSamples.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/TransactionNodesListRegenerateApiKeysSamples.java new file mode 100644 index 0000000000000..b9c4776b39fc4 --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/TransactionNodesListRegenerateApiKeysSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.blockchain.models.ApiKey; + +/** Samples for TransactionNodes ListRegenerateApiKeys. */ +public final class TransactionNodesListRegenerateApiKeysSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/TransactionNodes_ListRegenerateApiKeys.json + */ + /** + * Sample code: TransactionNodes_ListRegenerateApiKeys. + * + * @param manager Entry point to BlockchainManager. + */ + public static void transactionNodesListRegenerateApiKeys( + com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager + .transactionNodes() + .listRegenerateApiKeysWithResponse( + "contosemember1", "txnode2", "mygroup", new ApiKey().withKeyName("key1"), Context.NONE); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/TransactionNodesListSamples.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/TransactionNodesListSamples.java new file mode 100644 index 0000000000000..9ad01376572fc --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/TransactionNodesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.generated; + +import com.azure.core.util.Context; + +/** Samples for TransactionNodes List. */ +public final class TransactionNodesListSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/TransactionNodes_List.json + */ + /** + * Sample code: TransactionNodes_List. + * + * @param manager Entry point to BlockchainManager. + */ + public static void transactionNodesList(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + manager.transactionNodes().list("contosemember1", "mygroup", Context.NONE); + } +} diff --git a/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/TransactionNodesUpdateSamples.java b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/TransactionNodesUpdateSamples.java new file mode 100644 index 0000000000000..d80f92f2c0d3d --- /dev/null +++ b/sdk/blockchain/azure-resourcemanager-blockchain/src/samples/java/com/azure/resourcemanager/blockchain/generated/TransactionNodesUpdateSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.blockchain.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.blockchain.models.TransactionNode; + +/** Samples for TransactionNodes Update. */ +public final class TransactionNodesUpdateSamples { + /* + * x-ms-original-file: specification/blockchain/resource-manager/Microsoft.Blockchain/preview/2018-06-01-preview/examples/TransactionNodes_Update.json + */ + /** + * Sample code: TransactionNodes_Update. + * + * @param manager Entry point to BlockchainManager. + */ + public static void transactionNodesUpdate(com.azure.resourcemanager.blockchain.BlockchainManager manager) { + TransactionNode resource = + manager.transactionNodes().getWithResponse("contosemember1", "txnode2", "mygroup", Context.NONE).getValue(); + resource.update().withPassword("").apply(); + } +} diff --git a/sdk/blockchain/ci.yml b/sdk/blockchain/ci.yml new file mode 100644 index 0000000000000..27bdc047c3d97 --- /dev/null +++ b/sdk/blockchain/ci.yml @@ -0,0 +1,39 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/blockchain/ci.yml + - sdk/blockchain/azure-resourcemanager-blockchain/ + exclude: + - sdk/blockchain/pom.xml + - sdk/blockchain/azure-resourcemanager-blockchain/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/blockchain/ci.yml + - sdk/blockchain/azure-resourcemanager-blockchain/ + exclude: + - sdk/blockchain/pom.xml + - sdk/blockchain/azure-resourcemanager-blockchain/pom.xml + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: blockchain + Artifacts: + - name: azure-resourcemanager-blockchain + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerblockchain diff --git a/sdk/blockchain/pom.xml b/sdk/blockchain/pom.xml new file mode 100644 index 0000000000000..f53ab7e311871 --- /dev/null +++ b/sdk/blockchain/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-blockchain-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-blockchain + + + +