diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/CHANGELOG.md b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/CHANGELOG.md index 7f28c5662af9..572cfcbee039 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/CHANGELOG.md +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/CHANGELOG.md @@ -1,16 +1,80 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0-beta.4 (2024-04-23) -### Features Added +- Azure Resource Manager ConfidentialLedger client library for Java. This package contains Microsoft Azure SDK for ConfidentialLedger Management SDK. Microsoft Azure Confidential Compute Ledger Control Plane REST API version 2020-12-01-preview. Package tag package-preview-2023-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.ManagedCcfs` was modified + +* `update(java.lang.String,java.lang.String,fluent.models.ManagedCcfInner,com.azure.core.util.Context)` was removed +* `update(java.lang.String,java.lang.String,fluent.models.ManagedCcfInner)` was removed + +### Features Added + +* `models.ManagedCcfRestore` was added + +* `models.ManagedCcf$Update` was added + +* `models.ManagedCcfBackup` was added + +* `models.ConfidentialLedgerBackup` was added + +* `models.ManagedCcf$UpdateStages` was added + +* `models.ConfidentialLedgerBackupResponse` was added + +* `models.ManagedCcfRestoreResponse` was added + +* `models.ConfidentialLedgerRestore` was added + +* `models.ManagedCcfBackupResponse` was added + +* `models.ConfidentialLedgerRestoreResponse` was added + +* `models.LedgerSku` was added + +#### `models.ManagedCcfs` was modified + +* `backup(java.lang.String,java.lang.String,models.ManagedCcfBackup)` was added +* `restore(java.lang.String,java.lang.String,models.ManagedCcfRestore,com.azure.core.util.Context)` was added +* `backup(java.lang.String,java.lang.String,models.ManagedCcfBackup,com.azure.core.util.Context)` was added +* `restore(java.lang.String,java.lang.String,models.ManagedCcfRestore)` was added + +#### `models.LedgerProperties` was modified + +* `ledgerSku()` was added +* `withLedgerSku(models.LedgerSku)` was added + +#### `models.ManagedCcfProperties` was modified + +* `withRunningState(models.RunningState)` was added +* `runningState()` was added + +#### `models.ConfidentialLedger` was modified + +* `backup(models.ConfidentialLedgerBackup,com.azure.core.util.Context)` was added +* `backup(models.ConfidentialLedgerBackup)` was added +* `restore(models.ConfidentialLedgerRestore,com.azure.core.util.Context)` was added +* `restore(models.ConfidentialLedgerRestore)` was added + +#### `models.ManagedCcf` was modified + +* `restore(models.ManagedCcfRestore,com.azure.core.util.Context)` was added +* `backup(models.ManagedCcfBackup)` was added +* `resourceGroupName()` was added +* `backup(models.ManagedCcfBackup,com.azure.core.util.Context)` was added +* `restore(models.ManagedCcfRestore)` was added +* `update()` was added + +#### `models.Ledgers` was modified + +* `restore(java.lang.String,java.lang.String,models.ConfidentialLedgerRestore,com.azure.core.util.Context)` was added +* `backup(java.lang.String,java.lang.String,models.ConfidentialLedgerBackup)` was added +* `restore(java.lang.String,java.lang.String,models.ConfidentialLedgerRestore)` was added +* `backup(java.lang.String,java.lang.String,models.ConfidentialLedgerBackup,com.azure.core.util.Context)` was added -### Other Changes -- Migrate test recordings to assets repo. - ## 1.0.0-beta.3 (2023-04-20) - Azure Resource Manager ConfidentialLedger client library for Java. This package contains Microsoft Azure SDK for ConfidentialLedger Management SDK. Microsoft Azure Confidential Compute Ledger Control Plane REST API version 2020-12-01-preview. Package tag package-preview-2023-01. 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/confidentialledger/azure-resourcemanager-confidentialledger/README.md b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/README.md index e30d6ea60302..2429685e45bc 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/README.md +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/README.md @@ -2,7 +2,7 @@ Azure Resource Manager ConfidentialLedger client library for Java. -This package contains Microsoft Azure SDK for ConfidentialLedger Management SDK. Microsoft Azure Confidential Compute Ledger Control Plane REST API version 2020-12-01-preview. Package tag package-preview-2023-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for ConfidentialLedger Management SDK. Microsoft Azure Confidential Compute Ledger Control Plane REST API version 2020-12-01-preview. Package tag package-preview-2023-06. 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 @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-confidentialledger - 1.0.0-beta.3 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) @@ -45,7 +45,7 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. +By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. @@ -94,7 +94,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [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/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty @@ -103,3 +103,5 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fconfidentialledger%2Fazure-resourcemanager-confidentialledger%2FREADME.png) diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/SAMPLE.md b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/SAMPLE.md index 8a407664c47d..41defc744b91 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/SAMPLE.md +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/SAMPLE.md @@ -3,20 +3,24 @@ ## Ledger +- [Backup](#ledger_backup) - [Create](#ledger_create) - [Delete](#ledger_delete) - [GetByResourceGroup](#ledger_getbyresourcegroup) - [List](#ledger_list) - [ListByResourceGroup](#ledger_listbyresourcegroup) +- [Restore](#ledger_restore) - [Update](#ledger_update) ## ManagedCcf +- [Backup](#managedccf_backup) - [Create](#managedccf_create) - [Delete](#managedccf_delete) - [GetByResourceGroup](#managedccf_getbyresourcegroup) - [List](#managedccf_list) - [ListByResourceGroup](#managedccf_listbyresourcegroup) +- [Restore](#managedccf_restore) - [Update](#managedccf_update) ## Operations @@ -26,6 +30,33 @@ ## ResourceProvider - [CheckNameAvailability](#resourceprovider_checknameavailability) +### Ledger_Backup + +```java +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerBackup; + +/** + * Samples for Ledger Backup. + */ +public final class LedgerBackupSamples { + /* + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_Backup.json + */ + /** + * Sample code: ConfidentialLedgerBackup. + * + * @param manager Entry point to ConfidentialLedgerManager. + */ + public static void + confidentialLedgerBackup(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + manager.ledgers() + .backup("DummyResourceGroupName", "DummyLedgerName", + new ConfidentialLedgerBackup().withRestoreRegion("EastUS").withUri("DummySASUri"), + com.azure.core.util.Context.NONE); + } +} +``` + ### Ledger_Create ```java @@ -33,51 +64,44 @@ import com.azure.resourcemanager.confidentialledger.models.AadBasedSecurityPrinc import com.azure.resourcemanager.confidentialledger.models.CertBasedSecurityPrincipal; import com.azure.resourcemanager.confidentialledger.models.LedgerProperties; import com.azure.resourcemanager.confidentialledger.models.LedgerRoleName; +import com.azure.resourcemanager.confidentialledger.models.LedgerSku; import com.azure.resourcemanager.confidentialledger.models.LedgerType; import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for Ledger Create. */ +/** + * Samples for Ledger Create. + */ public final class LedgerCreateSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ConfidentialLedger_Create.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_Create.json */ /** * Sample code: ConfidentialLedgerCreate. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ - public static void confidentialLedgerCreate( - com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { - manager - .ledgers() + public static void + confidentialLedgerCreate(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + manager.ledgers() .define("DummyLedgerName") .withRegion("EastUS") .withExistingResourceGroup("DummyResourceGroupName") .withTags(mapOf("additionalProps1", "additional properties")) - .withProperties( - new LedgerProperties() - .withLedgerType(LedgerType.PUBLIC) - .withAadBasedSecurityPrincipals( - Arrays - .asList( - new AadBasedSecurityPrincipal() - .withPrincipalId("34621747-6fc8-4771-a2eb-72f31c461f2e") - .withTenantId("bce123b9-2b7b-4975-8360-5ca0b9b1cd08") - .withLedgerRoleName(LedgerRoleName.ADMINISTRATOR))) - .withCertBasedSecurityPrincipals( - Arrays - .asList( - new CertBasedSecurityPrincipal() - .withCert( - "-----BEGIN" - + " CERTIFICATE-----MIIBsjCCATigAwIBAgIUZWIbyG79TniQLd2UxJuU74tqrKcwCgYIKoZIzj0EAwMwEDEOMAwGA1UEAwwFdXNlcjAwHhcNMjEwMzE2MTgwNjExWhcNMjIwMzE2MTgwNjExWjAQMQ4wDAYDVQQDDAV1c2VyMDB2MBAGByqGSM49AgEGBSuBBAAiA2IABBiWSo/j8EFit7aUMm5lF+lUmCu+IgfnpFD+7QMgLKtxRJ3aGSqgS/GpqcYVGddnODtSarNE/HyGKUFUolLPQ5ybHcouUk0kyfA7XMeSoUA4lBz63Wha8wmXo+NdBRo39qNTMFEwHQYDVR0OBBYEFPtuhrwgGjDFHeUUT4nGsXaZn69KMB8GA1UdIwQYMBaAFPtuhrwgGjDFHeUUT4nGsXaZn69KMA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwMDaAAwZQIxAOnozm2CyqRwSSQLls5r+mUHRGRyXHXwYtM4Dcst/VEZdmS9fqvHRCHbjUlO/+HNfgIwMWZ4FmsjD3wnPxONOm9YdVn/PRD7SsPRPbOjwBiE4EBGaHDsLjYAGDSGi7NJnSkA-----END" - + " CERTIFICATE-----") - .withLedgerRoleName(LedgerRoleName.READER)))) + .withProperties(new LedgerProperties().withLedgerType(LedgerType.PUBLIC) + .withLedgerSku(LedgerSku.STANDARD) + .withAadBasedSecurityPrincipals(Arrays + .asList(new AadBasedSecurityPrincipal().withPrincipalId("34621747-6fc8-4771-a2eb-72f31c461f2e") + .withTenantId("bce123b9-2b7b-4975-8360-5ca0b9b1cd08") + .withLedgerRoleName(LedgerRoleName.ADMINISTRATOR))) + .withCertBasedSecurityPrincipals(Arrays.asList(new CertBasedSecurityPrincipal().withCert( + "-----BEGIN CERTIFICATE-----MIIBsjCCATigAwIBAgIUZWIbyG79TniQLd2UxJuU74tqrKcwCgYIKoZIzj0EAwMwEDEOMAwGA1UEAwwFdXNlcjAwHhcNMjEwMzE2MTgwNjExWhcNMjIwMzE2MTgwNjExWjAQMQ4wDAYDVQQDDAV1c2VyMDB2MBAGByqGSM49AgEGBSuBBAAiA2IABBiWSo/j8EFit7aUMm5lF+lUmCu+IgfnpFD+7QMgLKtxRJ3aGSqgS/GpqcYVGddnODtSarNE/HyGKUFUolLPQ5ybHcouUk0kyfA7XMeSoUA4lBz63Wha8wmXo+NdBRo39qNTMFEwHQYDVR0OBBYEFPtuhrwgGjDFHeUUT4nGsXaZn69KMB8GA1UdIwQYMBaAFPtuhrwgGjDFHeUUT4nGsXaZn69KMA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwMDaAAwZQIxAOnozm2CyqRwSSQLls5r+mUHRGRyXHXwYtM4Dcst/VEZdmS9fqvHRCHbjUlO/+HNfgIwMWZ4FmsjD3wnPxONOm9YdVn/PRD7SsPRPbOjwBiE4EBGaHDsLjYAGDSGi7NJnSkA-----END CERTIFICATE-----") + .withLedgerRoleName(LedgerRoleName.READER)))) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -94,18 +118,20 @@ public final class LedgerCreateSamples { ### Ledger_Delete ```java -/** Samples for Ledger Delete. */ +/** + * Samples for Ledger Delete. + */ public final class LedgerDeleteSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ConfidentialLedger_Delete.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_Delete.json */ /** * Sample code: ConfidentialLedgerDelete. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ - public static void confidentialLedgerDelete( - com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + public static void + confidentialLedgerDelete(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { manager.ledgers().delete("DummyResourceGroupName", "DummyLedgerName", com.azure.core.util.Context.NONE); } } @@ -114,22 +140,23 @@ public final class LedgerDeleteSamples { ### Ledger_GetByResourceGroup ```java -/** Samples for Ledger GetByResourceGroup. */ +/** + * Samples for Ledger GetByResourceGroup. + */ public final class LedgerGetByResourceGroupSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ConfidentialLedger_Get.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_Get.json */ /** * Sample code: ConfidentialLedgerGet. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ - public static void confidentialLedgerGet( - com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { - manager - .ledgers() - .getByResourceGroupWithResponse( - "DummyResourceGroupName", "DummyLedgerName", com.azure.core.util.Context.NONE); + public static void + confidentialLedgerGet(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + manager.ledgers() + .getByResourceGroupWithResponse("DummyResourceGroupName", "DummyLedgerName", + com.azure.core.util.Context.NONE); } } ``` @@ -137,18 +164,20 @@ public final class LedgerGetByResourceGroupSamples { ### Ledger_List ```java -/** Samples for Ledger List. */ +/** + * Samples for Ledger List. + */ public final class LedgerListSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ConfidentialLedger_ListBySub.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_ListBySub.json */ /** * Sample code: ConfidentialLedgerListBySub. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ - public static void confidentialLedgerListBySub( - com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + public static void + confidentialLedgerListBySub(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { manager.ledgers().list(null, com.azure.core.util.Context.NONE); } } @@ -157,23 +186,54 @@ public final class LedgerListSamples { ### Ledger_ListByResourceGroup ```java -/** Samples for Ledger ListByResourceGroup. */ +/** + * Samples for Ledger ListByResourceGroup. + */ public final class LedgerListByResourceGroupSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ConfidentialLedger_List.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_List.json */ /** * Sample code: ConfidentialLedgerList. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ - public static void confidentialLedgerList( - com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + public static void + confidentialLedgerList(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { manager.ledgers().listByResourceGroup("DummyResourceGroupName", null, com.azure.core.util.Context.NONE); } } ``` +### Ledger_Restore + +```java +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerRestore; + +/** + * Samples for Ledger Restore. + */ +public final class LedgerRestoreSamples { + /* + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_Restore.json + */ + /** + * Sample code: ConfidentialLedgerRestore. + * + * @param manager Entry point to ConfidentialLedgerManager. + */ + public static void + confidentialLedgerRestore(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + manager.ledgers() + .restore("DummyResourceGroupName", "DummyLedgerName", + new ConfidentialLedgerRestore().withFileShareName("DummyFileShareName") + .withRestoreRegion("EastUS") + .withUri("DummySASUri"), + com.azure.core.util.Context.NONE); + } +} +``` + ### Ledger_Update ```java @@ -187,49 +247,38 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for Ledger Update. */ +/** + * Samples for Ledger Update. + */ public final class LedgerUpdateSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ConfidentialLedger_Update.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_Update.json */ /** * Sample code: ConfidentialLedgerUpdate. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ - public static void confidentialLedgerUpdate( - com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { - ConfidentialLedger resource = - manager - .ledgers() - .getByResourceGroupWithResponse( - "DummyResourceGroupName", "DummyLedgerName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void + confidentialLedgerUpdate(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + ConfidentialLedger resource = manager.ledgers() + .getByResourceGroupWithResponse("DummyResourceGroupName", "DummyLedgerName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("additionProps2", "additional property value", "additionalProps1", "additional properties")) - .withProperties( - new LedgerProperties() - .withLedgerType(LedgerType.PUBLIC) - .withAadBasedSecurityPrincipals( - Arrays - .asList( - new AadBasedSecurityPrincipal() - .withPrincipalId("34621747-6fc8-4771-a2eb-72f31c461f2e") - .withTenantId("bce123b9-2b7b-4975-8360-5ca0b9b1cd08") - .withLedgerRoleName(LedgerRoleName.ADMINISTRATOR))) - .withCertBasedSecurityPrincipals( - Arrays - .asList( - new CertBasedSecurityPrincipal() - .withCert( - "-----BEGIN CERTIFICATE-----\n" - + "MIIDUjCCAjqgAwIBAgIQJ2IrDBawSkiAbkBYmiAopDANBgkqhkiG9w0BAQsFADAmMSQwIgYDVQQDExtTeW50aGV0aWNzIExlZGdlciBVc2VyIENlcnQwHhcNMjAwOTIzMjIxODQ2WhcNMjEwOTIzMjIyODQ2WjAmMSQwIgYDVQQDExtTeW50aGV0aWNzIExlZGdlciBVc2VyIENlcnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCX2s/Eu4q/eQ63N+Ugeg5oAciZua/YCJr41c/696szvSY7Zg1SNJlW88/nbz70+QpO55OmqlEE3QCU+T0Vl/h0Gf//n1PYcoBbTGUnYEmV+fTTHict6rFiEwrGJ62tvcpYgwapInSLyEeUzjki0zhOLJ1OfRnYd1eGnFVMpE5aVjiS8Q5dmTEUyd51EIprGE8RYAW9aeWSwTH7gjHUsRlJnHKcdhaK/v5QKJnNu5bzPFUcpC0ZBcizoMPAtroLAD4B68Jl0z3op18MgZe6lRrVoWuxfqnk5GojuB/Vu8ohAZKoFhQ6NB6r+LL2AUs+Zr7Bt26IkEdR178n9JMEA4gHAgMBAAGjfDB6MA4GA1UdDwEB/wQEAwIFoDAJBgNVHRMEAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAfBgNVHSMEGDAWgBS/a7PU9iOfOKEyZCp11Oen5VSuuDAdBgNVHQ4EFgQUv2uz1PYjnzihMmQqddTnp+VUrrgwDQYJKoZIhvcNAQELBQADggEBAF5q2fDwnse8egXhfaJCqqM969E9gSacqFmASpoDJPRPEX7gqoO7v1ww7nqRtRDoRiBvo/yNk7jlSAkRN3nRRnZLZZ3MYQdmCr4FGyIqRg4Y94+nja+Du9pDD761rxRktMVPSOaAVM/E5DQvscDlPvlPYe9mkcrLCE4DXYpiMmLT8Tm55LJJq5m07dVDgzAIR1L/hmEcbK0pnLgzciMtMLxGO2udnyyW/UW9WxnjvrrD2JluTHH9mVbb+XQP1oFtlRBfH7aui1ZgWfKvxrdP4zdK9QoWSUvRux3TLsGmHRBjBMtqYDY3y5mB+aNjLelvWpeVb0m2aOSVXynrLwNCAVA=\n" - + "-----END CERTIFICATE-----") - .withLedgerRoleName(LedgerRoleName.READER)))) + .withProperties(new LedgerProperties().withLedgerType(LedgerType.PUBLIC) + .withAadBasedSecurityPrincipals(Arrays + .asList(new AadBasedSecurityPrincipal().withPrincipalId("34621747-6fc8-4771-a2eb-72f31c461f2e") + .withTenantId("bce123b9-2b7b-4975-8360-5ca0b9b1cd08") + .withLedgerRoleName(LedgerRoleName.ADMINISTRATOR))) + .withCertBasedSecurityPrincipals(Arrays.asList(new CertBasedSecurityPrincipal().withCert( + "-----BEGIN CERTIFICATE-----\nMIIDUjCCAjqgAwIBAgIQJ2IrDBawSkiAbkBYmiAopDANBgkqhkiG9w0BAQsFADAmMSQwIgYDVQQDExtTeW50aGV0aWNzIExlZGdlciBVc2VyIENlcnQwHhcNMjAwOTIzMjIxODQ2WhcNMjEwOTIzMjIyODQ2WjAmMSQwIgYDVQQDExtTeW50aGV0aWNzIExlZGdlciBVc2VyIENlcnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCX2s/Eu4q/eQ63N+Ugeg5oAciZua/YCJr41c/696szvSY7Zg1SNJlW88/nbz70+QpO55OmqlEE3QCU+T0Vl/h0Gf//n1PYcoBbTGUnYEmV+fTTHict6rFiEwrGJ62tvcpYgwapInSLyEeUzjki0zhOLJ1OfRnYd1eGnFVMpE5aVjiS8Q5dmTEUyd51EIprGE8RYAW9aeWSwTH7gjHUsRlJnHKcdhaK/v5QKJnNu5bzPFUcpC0ZBcizoMPAtroLAD4B68Jl0z3op18MgZe6lRrVoWuxfqnk5GojuB/Vu8ohAZKoFhQ6NB6r+LL2AUs+Zr7Bt26IkEdR178n9JMEA4gHAgMBAAGjfDB6MA4GA1UdDwEB/wQEAwIFoDAJBgNVHRMEAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAfBgNVHSMEGDAWgBS/a7PU9iOfOKEyZCp11Oen5VSuuDAdBgNVHQ4EFgQUv2uz1PYjnzihMmQqddTnp+VUrrgwDQYJKoZIhvcNAQELBQADggEBAF5q2fDwnse8egXhfaJCqqM969E9gSacqFmASpoDJPRPEX7gqoO7v1ww7nqRtRDoRiBvo/yNk7jlSAkRN3nRRnZLZZ3MYQdmCr4FGyIqRg4Y94+nja+Du9pDD761rxRktMVPSOaAVM/E5DQvscDlPvlPYe9mkcrLCE4DXYpiMmLT8Tm55LJJq5m07dVDgzAIR1L/hmEcbK0pnLgzciMtMLxGO2udnyyW/UW9WxnjvrrD2JluTHH9mVbb+XQP1oFtlRBfH7aui1ZgWfKvxrdP4zdK9QoWSUvRux3TLsGmHRBjBMtqYDY3y5mB+aNjLelvWpeVb0m2aOSVXynrLwNCAVA=\n-----END CERTIFICATE-----") + .withLedgerRoleName(LedgerRoleName.READER)))) .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -243,6 +292,33 @@ public final class LedgerUpdateSamples { } ``` +### ManagedCcf_Backup + +```java +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfBackup; + +/** + * Samples for ManagedCcf Backup. + */ +public final class ManagedCcfBackupSamples { + /* + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_Backup.json + */ + /** + * Sample code: ManagedCCFBackup. + * + * @param manager Entry point to ConfidentialLedgerManager. + */ + public static void + managedCCFBackup(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + manager.managedCcfs() + .backup("DummyResourceGroupName", "DummyMccfAppName", + new ManagedCcfBackup().withRestoreRegion("EastUS").withUri("DummySASUri"), + com.azure.core.util.Context.NONE); + } +} +``` + ### ManagedCcf_Create ```java @@ -257,51 +333,40 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for ManagedCcf Create. */ +/** + * Samples for ManagedCcf Create. + */ public final class ManagedCcfCreateSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ManagedCCF_Create.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_Create.json */ /** * Sample code: ManagedCCFCreate. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ public static void managedCCFCreate(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) throws IOException { - manager - .managedCcfs() + manager.managedCcfs() .define("DummyMccfAppName") .withRegion("EastUS") .withExistingResourceGroup("DummyResourceGroupName") .withTags(mapOf("additionalProps1", "additional properties")) - .withProperties( - new ManagedCcfProperties() - .withMemberIdentityCertificates( - Arrays - .asList( - new MemberIdentityCertificate() - .withCertificate( - "-----BEGIN" - + " CERTIFICATE-----MIIBsjCCATigAwIBAgIUZWIbyG79TniQLd2UxJuU74tqrKcwCgYIKoZIzj0EAwMwEDEOMAwGA1UEAwwFdXNlcjAwHhcNMjEwMzE2MTgwNjExWhcNMjIwMzE2MTgwNjExWjAQMQ4wDAYDVQQDDAV1c2VyMDB2MBAGByqGSM49AgEGBSuBBAAiA2IABBiWSo/j8EFit7aUMm5lF+lUmCu+IgfnpFD+7QMgLKtxRJ3aGSqgS/GpqcYVGddnODtSarNE/HyGKUFUolLPQ5ybHcouUk0kyfA7XMeSoUA4lBz63Wha8wmXo+NdBRo39qNTMFEwHQYDVR0OBBYEFPtuhrwgGjDFHeUUT4nGsXaZn69KMB8GA1UdIwQYMBaAFPtuhrwgGjDFHeUUT4nGsXaZn69KMA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwMDaAAwZQIxAOnozm2CyqRwSSQLls5r+mUHRGRyXHXwYtM4Dcst/VEZdmS9fqvHRCHbjUlO/+HNfgIwMWZ4FmsjD3wnPxONOm9YdVn/PRD7SsPRPbOjwBiE4EBGaHDsLjYAGDSGi7NJnSkA-----END" - + " CERTIFICATE-----") - .withEncryptionkey("fakeTokenPlaceholder") - .withTags( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"additionalProps1\":\"additional properties\"}", - Object.class, - SerializerEncoding.JSON)))) - .withDeploymentType( - new DeploymentType() - .withLanguageRuntime(LanguageRuntime.CPP) - .withAppSourceUri( - "https://myaccount.blob.core.windows.net/storage/mccfsource?sv=2022-02-11%st=2022-03-11")) - .withNodeCount(5)) + .withProperties(new ManagedCcfProperties() + .withMemberIdentityCertificates(Arrays.asList(new MemberIdentityCertificate().withCertificate( + "-----BEGIN CERTIFICATE-----MIIBsjCCATigAwIBAgIUZWIbyG79TniQLd2UxJuU74tqrKcwCgYIKoZIzj0EAwMwEDEOMAwGA1UEAwwFdXNlcjAwHhcNMjEwMzE2MTgwNjExWhcNMjIwMzE2MTgwNjExWjAQMQ4wDAYDVQQDDAV1c2VyMDB2MBAGByqGSM49AgEGBSuBBAAiA2IABBiWSo/j8EFit7aUMm5lF+lUmCu+IgfnpFD+7QMgLKtxRJ3aGSqgS/GpqcYVGddnODtSarNE/HyGKUFUolLPQ5ybHcouUk0kyfA7XMeSoUA4lBz63Wha8wmXo+NdBRo39qNTMFEwHQYDVR0OBBYEFPtuhrwgGjDFHeUUT4nGsXaZn69KMB8GA1UdIwQYMBaAFPtuhrwgGjDFHeUUT4nGsXaZn69KMA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwMDaAAwZQIxAOnozm2CyqRwSSQLls5r+mUHRGRyXHXwYtM4Dcst/VEZdmS9fqvHRCHbjUlO/+HNfgIwMWZ4FmsjD3wnPxONOm9YdVn/PRD7SsPRPbOjwBiE4EBGaHDsLjYAGDSGi7NJnSkA-----END CERTIFICATE-----") + .withEncryptionkey("fakeTokenPlaceholder") + .withTags(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"additionalProps1\":\"additional properties\"}", Object.class, + SerializerEncoding.JSON)))) + .withDeploymentType(new DeploymentType().withLanguageRuntime(LanguageRuntime.CPP) + .withAppSourceUri( + "https://myaccount.blob.core.windows.net/storage/mccfsource?sv=2022-02-11%st=2022-03-11")) + .withNodeCount(5)) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -318,18 +383,20 @@ public final class ManagedCcfCreateSamples { ### ManagedCcf_Delete ```java -/** Samples for ManagedCcf Delete. */ +/** + * Samples for ManagedCcf Delete. + */ public final class ManagedCcfDeleteSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ManagedCCF_Delete.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_Delete.json */ /** * Sample code: ConfidentialLedgerDelete. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ - public static void confidentialLedgerDelete( - com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + public static void + confidentialLedgerDelete(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { manager.managedCcfs().delete("DummyResourceGroupName", "DummyMccfAppName", com.azure.core.util.Context.NONE); } } @@ -338,21 +405,22 @@ public final class ManagedCcfDeleteSamples { ### ManagedCcf_GetByResourceGroup ```java -/** Samples for ManagedCcf GetByResourceGroup. */ +/** + * Samples for ManagedCcf GetByResourceGroup. + */ public final class ManagedCcfGetByResourceGroupSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ManagedCCF_Get.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_Get.json */ /** * Sample code: ManagedCCFGet. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ public static void managedCCFGet(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { - manager - .managedCcfs() - .getByResourceGroupWithResponse( - "DummyResourceGroupName", "DummyMccfAppName", com.azure.core.util.Context.NONE); + manager.managedCcfs() + .getByResourceGroupWithResponse("DummyResourceGroupName", "DummyMccfAppName", + com.azure.core.util.Context.NONE); } } ``` @@ -360,18 +428,20 @@ public final class ManagedCcfGetByResourceGroupSamples { ### ManagedCcf_List ```java -/** Samples for ManagedCcf List. */ +/** + * Samples for ManagedCcf List. + */ public final class ManagedCcfListSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ManagedCCF_ListBySub.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_ListBySub.json */ /** * Sample code: ManagedCCFListBySub. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ - public static void managedCCFListBySub( - com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + public static void + managedCCFListBySub(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { manager.managedCcfs().list(null, com.azure.core.util.Context.NONE); } } @@ -380,14 +450,16 @@ public final class ManagedCcfListSamples { ### ManagedCcf_ListByResourceGroup ```java -/** Samples for ManagedCcf ListByResourceGroup. */ +/** + * Samples for ManagedCcf ListByResourceGroup. + */ public final class ManagedCcfListByResourceGroupSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ManagedCCF_List.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_List.json */ /** * Sample code: ManagedCCFList. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ public static void managedCCFList(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { @@ -396,46 +468,73 @@ public final class ManagedCcfListByResourceGroupSamples { } ``` +### ManagedCcf_Restore + +```java +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfRestore; + +/** + * Samples for ManagedCcf Restore. + */ +public final class ManagedCcfRestoreSamples { + /* + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_Restore.json + */ + /** + * Sample code: ManagedCCFRestore. + * + * @param manager Entry point to ConfidentialLedgerManager. + */ + public static void + managedCCFRestore(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + manager.managedCcfs() + .restore("DummyResourceGroupName", "DummyMccfAppName", + new ManagedCcfRestore().withFileShareName("DummyFileShareName") + .withRestoreRegion("EastUS") + .withUri("DummySASUri"), + com.azure.core.util.Context.NONE); + } +} +``` + ### ManagedCcf_Update ```java -import com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfInner; import com.azure.resourcemanager.confidentialledger.models.DeploymentType; import com.azure.resourcemanager.confidentialledger.models.LanguageRuntime; +import com.azure.resourcemanager.confidentialledger.models.ManagedCcf; import com.azure.resourcemanager.confidentialledger.models.ManagedCcfProperties; import java.util.HashMap; import java.util.Map; -/** Samples for ManagedCcf Update. */ +/** + * Samples for ManagedCcf Update. + */ public final class ManagedCcfUpdateSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ManagedCCF_Update.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_Update.json */ /** * Sample code: ManagedCCFUpdate. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ - public static void managedCCFUpdate( - com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { - manager - .managedCcfs() - .update( - "DummyResourceGroupName", - "DummyMccfAppName", - new ManagedCcfInner() - .withLocation("EastUS") - .withTags(mapOf("additionalProps1", "additional properties")) - .withProperties( - new ManagedCcfProperties() - .withDeploymentType( - new DeploymentType() - .withLanguageRuntime(LanguageRuntime.CPP) - .withAppSourceUri( - "https://myaccount.blob.core.windows.net/storage/mccfsource?sv=2022-02-11%st=2022-03-11"))), - com.azure.core.util.Context.NONE); + public static void + managedCCFUpdate(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + ManagedCcf resource = manager.managedCcfs() + .getByResourceGroupWithResponse("DummyResourceGroupName", "DummyMccfAppName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("additionalProps1", "additional properties")) + .withProperties(new ManagedCcfProperties() + .withDeploymentType(new DeploymentType().withLanguageRuntime(LanguageRuntime.CPP) + .withAppSourceUri( + "https://myaccount.blob.core.windows.net/storage/mccfsource?sv=2022-02-11%st=2022-03-11"))) + .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -452,14 +551,16 @@ public final class ManagedCcfUpdateSamples { ### Operations_List ```java -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/Operations_Get.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/Operations_Get.json */ /** * Sample code: OperationsGet. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ public static void operationsGet(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { @@ -473,25 +574,23 @@ public final class OperationsListSamples { ```java import com.azure.resourcemanager.confidentialledger.models.CheckNameAvailabilityRequest; -/** Samples for ResourceProvider CheckNameAvailability. */ +/** + * Samples for ResourceProvider CheckNameAvailability. + */ public final class ResourceProviderCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/CheckNameAvailability.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/CheckNameAvailability.json */ /** * Sample code: CheckNameAvailability. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ - public static void checkNameAvailability( - com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { - manager - .resourceProviders() - .checkNameAvailabilityWithResponse( - new CheckNameAvailabilityRequest() - .withName("sample-name") - .withType("Microsoft.ConfidentialLedger/ledgers"), - com.azure.core.util.Context.NONE); + public static void + checkNameAvailability(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + manager.resourceProviders() + .checkNameAvailabilityWithResponse(new CheckNameAvailabilityRequest().withName("sample-name") + .withType("Microsoft.ConfidentialLedger/ledgers"), com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/pom.xml b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/pom.xml index bfc372350bb6..edf6a90fa9f9 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/pom.xml +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for ConfidentialLedger Management - This package contains Microsoft Azure SDK for ConfidentialLedger Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft Azure Confidential Compute Ledger Control Plane REST API version 2020-12-01-preview. Package tag package-preview-2023-01. + This package contains Microsoft Azure SDK for ConfidentialLedger Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft Azure Confidential Compute Ledger Control Plane REST API version 2020-12-01-preview. Package tag package-preview-2023-06. https://github.com/Azure/azure-sdk-for-java @@ -45,9 +45,7 @@ UTF-8 0 0 - - --add-opens com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED - + true @@ -84,14 +82,18 @@ 5.9.3 test + + org.slf4j + slf4j-simple + 1.7.36 + test + org.mockito mockito-core 4.11.0 test - - net.bytebuddy byte-buddy @@ -104,12 +106,6 @@ 1.14.12 test - - org.slf4j - slf4j-simple - 1.7.36 - test - com.azure.resourcemanager azure-resourcemanager-resources diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/ConfidentialLedgerManager.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/ConfidentialLedgerManager.java index 70b4fa912e44..f72b276b58b1 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/ConfidentialLedgerManager.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/ConfidentialLedgerManager.java @@ -11,8 +11,8 @@ import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; @@ -41,8 +41,8 @@ import java.util.stream.Collectors; /** - * Entry point to ConfidentialLedgerManager. Microsoft Azure Confidential Compute Ledger Control Plane REST API version - * 2020-12-01-preview. + * Entry point to ConfidentialLedgerManager. + * Microsoft Azure Confidential Compute Ledger Control Plane REST API version 2020-12-01-preview. */ public final class ConfidentialLedgerManager { private Operations operations; @@ -58,18 +58,16 @@ public final class ConfidentialLedgerManager { private ConfidentialLedgerManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = - new ConfidentialLedgerManagementClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); + this.clientObject = new ConfidentialLedgerManagementClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); } /** * Creates an instance of ConfidentialLedger service API entry point. - * + * * @param credential the credential to use. * @param profile the Azure profile for client. * @return the ConfidentialLedger service API instance. @@ -82,7 +80,7 @@ public static ConfidentialLedgerManager authenticate(TokenCredential credential, /** * Creates an instance of ConfidentialLedger service API entry point. - * + * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. * @return the ConfidentialLedger service API instance. @@ -95,14 +93,16 @@ public static ConfidentialLedgerManager authenticate(HttpPipeline httpPipeline, /** * Gets a Configurable instance that can be used to create ConfidentialLedgerManager with optional configuration. - * + * * @return the Configurable instance allowing configurations. */ public static Configurable configure() { return new ConfidentialLedgerManager.Configurable(); } - /** The Configurable allowing configurations to be set. */ + /** + * The Configurable allowing configurations to be set. + */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); @@ -174,8 +174,8 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { /** * Sets the retry options for the HTTP pipeline retry policy. - * - *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. * * @param retryOptions the retry options for the HTTP pipeline retry policy. * @return the configurable object itself. @@ -192,8 +192,8 @@ public Configurable withRetryOptions(RetryOptions retryOptions) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = - Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { throw LOGGER .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); @@ -213,15 +213,13 @@ public ConfidentialLedgerManager authenticate(TokenCredential credential, AzureP Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder - .append("azsdk-java") + userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.confidentialledger") .append("/") - .append("1.0.0-beta.3"); + .append("1.0.0-beta.4"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder - .append(" (") + userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) .append("; ") .append(Configuration.getGlobalConfiguration().get("os.name")) @@ -246,38 +244,28 @@ public ConfidentialLedgerManager authenticate(TokenCredential credential, AzureP policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); + 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())); + 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(); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); return new ConfidentialLedgerManager(httpPipeline, profile, defaultPollInterval); } } /** * Gets the resource collection API of Operations. - * + * * @return Resource collection API of Operations. */ public Operations operations() { @@ -289,7 +277,7 @@ public Operations operations() { /** * Gets the resource collection API of ResourceProviders. - * + * * @return Resource collection API of ResourceProviders. */ public ResourceProviders resourceProviders() { @@ -301,7 +289,7 @@ public ResourceProviders resourceProviders() { /** * Gets the resource collection API of Ledgers. It manages ConfidentialLedger. - * + * * @return Resource collection API of Ledgers. */ public Ledgers ledgers() { @@ -313,7 +301,7 @@ public Ledgers ledgers() { /** * Gets the resource collection API of ManagedCcfs. It manages ManagedCcf. - * + * * @return Resource collection API of ManagedCcfs. */ public ManagedCcfs managedCcfs() { @@ -324,8 +312,10 @@ public ManagedCcfs managedCcfs() { } /** - * @return Wrapped service client ConfidentialLedgerManagementClient providing direct access to the underlying - * auto-generated API implementation, based on Azure REST API. + * Gets wrapped service client ConfidentialLedgerManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + * + * @return Wrapped service client ConfidentialLedgerManagementClient. */ public ConfidentialLedgerManagementClient serviceClient() { return this.clientObject; diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/ConfidentialLedgerManagementClient.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/ConfidentialLedgerManagementClient.java index 4ee01b730705..4bfa02bd49e2 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/ConfidentialLedgerManagementClient.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/ConfidentialLedgerManagementClient.java @@ -7,67 +7,69 @@ import com.azure.core.http.HttpPipeline; import java.time.Duration; -/** The interface for ConfidentialLedgerManagementClient class. */ +/** + * The interface for ConfidentialLedgerManagementClient class. + */ public interface ConfidentialLedgerManagementClient { /** * Gets The ID of the target subscription. - * + * * @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 OperationsClient object to access its operations. - * + * * @return the OperationsClient object. */ OperationsClient getOperations(); /** * Gets the ResourceProvidersClient object to access its operations. - * + * * @return the ResourceProvidersClient object. */ ResourceProvidersClient getResourceProviders(); /** * Gets the LedgersClient object to access its operations. - * + * * @return the LedgersClient object. */ LedgersClient getLedgers(); /** * Gets the ManagedCcfsClient object to access its operations. - * + * * @return the ManagedCcfsClient object. */ ManagedCcfsClient getManagedCcfs(); diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/LedgersClient.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/LedgersClient.java index f2dffb960d73..a1900481b154 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/LedgersClient.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/LedgersClient.java @@ -11,15 +11,21 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerBackupResponseInner; import com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerInner; +import com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerRestoreResponseInner; +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerBackup; +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerRestore; -/** An instance of this class provides access to all the operations defined in LedgersClient. */ +/** + * An instance of this class provides access to all the operations defined in LedgersClient. + */ public interface LedgersClient { /** * Retrieves information about a Confidential Ledger resource. - * - *

Retrieves the properties of a Confidential Ledger. - * + * + * Retrieves the properties of a Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param context The context to associate with this operation. @@ -29,14 +35,14 @@ public interface LedgersClient { * @return confidential Ledger along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String ledgerName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String ledgerName, + Context context); /** * Retrieves information about a Confidential Ledger resource. - * - *

Retrieves the properties of a Confidential Ledger. - * + * + * Retrieves the properties of a Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -49,9 +55,9 @@ Response getByResourceGroupWithResponse( /** * Deletes a Confidential Ledger resource. - * - *

Deletes an existing Confidential Ledger. - * + * + * Deletes an existing Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -64,9 +70,9 @@ Response getByResourceGroupWithResponse( /** * Deletes a Confidential Ledger resource. - * - *

Deletes an existing Confidential Ledger. - * + * + * Deletes an existing Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param context The context to associate with this operation. @@ -80,9 +86,9 @@ Response getByResourceGroupWithResponse( /** * Deletes a Confidential Ledger resource. - * - *

Deletes an existing Confidential Ledger. - * + * + * Deletes an existing Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -94,9 +100,9 @@ Response getByResourceGroupWithResponse( /** * Deletes a Confidential Ledger resource. - * - *

Deletes an existing Confidential Ledger. - * + * + * Deletes an existing Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param context The context to associate with this operation. @@ -109,9 +115,9 @@ Response getByResourceGroupWithResponse( /** * Creates a Confidential Ledger. - * - *

Creates a Confidential Ledger with the specified ledger parameters. - * + * + * Creates a Confidential Ledger with the specified ledger parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger Create Request Body. @@ -121,14 +127,14 @@ Response getByResourceGroupWithResponse( * @return the {@link SyncPoller} for polling of confidential Ledger. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ConfidentialLedgerInner> beginCreate( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger); + SyncPoller, ConfidentialLedgerInner> beginCreate(String resourceGroupName, + String ledgerName, ConfidentialLedgerInner confidentialLedger); /** * Creates a Confidential Ledger. - * - *

Creates a Confidential Ledger with the specified ledger parameters. - * + * + * Creates a Confidential Ledger with the specified ledger parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger Create Request Body. @@ -139,14 +145,14 @@ SyncPoller, ConfidentialLedgerInner> beginCr * @return the {@link SyncPoller} for polling of confidential Ledger. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ConfidentialLedgerInner> beginCreate( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger, Context context); + SyncPoller, ConfidentialLedgerInner> beginCreate(String resourceGroupName, + String ledgerName, ConfidentialLedgerInner confidentialLedger, Context context); /** * Creates a Confidential Ledger. - * - *

Creates a Confidential Ledger with the specified ledger parameters. - * + * + * Creates a Confidential Ledger with the specified ledger parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger Create Request Body. @@ -156,14 +162,14 @@ SyncPoller, ConfidentialLedgerInner> beginCr * @return confidential Ledger. */ @ServiceMethod(returns = ReturnType.SINGLE) - ConfidentialLedgerInner create( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger); + ConfidentialLedgerInner create(String resourceGroupName, String ledgerName, + ConfidentialLedgerInner confidentialLedger); /** * Creates a Confidential Ledger. - * - *

Creates a Confidential Ledger with the specified ledger parameters. - * + * + * Creates a Confidential Ledger with the specified ledger parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger Create Request Body. @@ -174,14 +180,14 @@ ConfidentialLedgerInner create( * @return confidential Ledger. */ @ServiceMethod(returns = ReturnType.SINGLE) - ConfidentialLedgerInner create( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger, Context context); + ConfidentialLedgerInner create(String resourceGroupName, String ledgerName, + ConfidentialLedgerInner confidentialLedger, Context context); /** * Update Confidential Ledger properties - * - *

Updates properties of Confidential Ledger. - * + * + * Updates properties of Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger request body for Updating Ledger. @@ -191,14 +197,14 @@ ConfidentialLedgerInner create( * @return the {@link SyncPoller} for polling of confidential Ledger. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ConfidentialLedgerInner> beginUpdate( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger); + SyncPoller, ConfidentialLedgerInner> beginUpdate(String resourceGroupName, + String ledgerName, ConfidentialLedgerInner confidentialLedger); /** * Update Confidential Ledger properties - * - *

Updates properties of Confidential Ledger. - * + * + * Updates properties of Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger request body for Updating Ledger. @@ -209,14 +215,14 @@ SyncPoller, ConfidentialLedgerInner> beginUp * @return the {@link SyncPoller} for polling of confidential Ledger. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ConfidentialLedgerInner> beginUpdate( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger, Context context); + SyncPoller, ConfidentialLedgerInner> beginUpdate(String resourceGroupName, + String ledgerName, ConfidentialLedgerInner confidentialLedger, Context context); /** * Update Confidential Ledger properties - * - *

Updates properties of Confidential Ledger. - * + * + * Updates properties of Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger request body for Updating Ledger. @@ -226,14 +232,14 @@ SyncPoller, ConfidentialLedgerInner> beginUp * @return confidential Ledger. */ @ServiceMethod(returns = ReturnType.SINGLE) - ConfidentialLedgerInner update( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger); + ConfidentialLedgerInner update(String resourceGroupName, String ledgerName, + ConfidentialLedgerInner confidentialLedger); /** * Update Confidential Ledger properties - * - *

Updates properties of Confidential Ledger. - * + * + * Updates properties of Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger request body for Updating Ledger. @@ -244,29 +250,29 @@ ConfidentialLedgerInner update( * @return confidential Ledger. */ @ServiceMethod(returns = ReturnType.SINGLE) - ConfidentialLedgerInner update( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger, Context context); + ConfidentialLedgerInner update(String resourceGroupName, String ledgerName, + ConfidentialLedgerInner confidentialLedger, Context context); /** * Retrieves information about all Confidential Ledger resources under the given subscription and resource group - * - *

Retrieves the properties of all Confidential Ledgers. - * + * + * Retrieves the properties of all Confidential Ledgers. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 object that includes an array of Confidential Ledgers and a possible link for next set as paginated - * response with {@link PagedIterable}. + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); /** * Retrieves information about all Confidential Ledger resources under the given subscription and resource group - * - *

Retrieves the properties of all Confidential Ledgers. - * + * + * Retrieves the properties of all Confidential Ledgers. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @param context The context to associate with this operation. @@ -274,38 +280,182 @@ ConfidentialLedgerInner update( * @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 object that includes an array of Confidential Ledgers and a possible link for next set as paginated - * response with {@link PagedIterable}. + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup( - String resourceGroupName, String filter, Context context); + PagedIterable listByResourceGroup(String resourceGroupName, String filter, + Context context); /** * Retrieves information about all Confidential Ledger resources under the given subscription - * - *

Retrieves the properties of all Confidential Ledgers. - * + * + * Retrieves the properties of all Confidential Ledgers. + * * @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 object that includes an array of Confidential Ledgers and a possible link for next set as paginated - * response with {@link PagedIterable}. + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** * Retrieves information about all Confidential Ledger resources under the given subscription - * - *

Retrieves the properties of all Confidential Ledgers. - * + * + * Retrieves the properties of all Confidential Ledgers. + * * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Confidential Ledgers and a possible link for next set as paginated - * response with {@link PagedIterable}. + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String filter, Context context); + + /** + * Performs the backup operation on a Confidential Ledger Resource. + * + * Backs up a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Backup Request Body. + * @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 SyncPoller} for polling of object representing the backup response of a Confidential Ledger + * Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfidentialLedgerBackupResponseInner> + beginBackup(String resourceGroupName, String ledgerName, ConfidentialLedgerBackup confidentialLedger); + + /** + * Performs the backup operation on a Confidential Ledger Resource. + * + * Backs up a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Backup Request Body. + * @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 SyncPoller} for polling of object representing the backup response of a Confidential Ledger + * Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfidentialLedgerBackupResponseInner> beginBackup( + String resourceGroupName, String ledgerName, ConfidentialLedgerBackup confidentialLedger, Context context); + + /** + * Performs the backup operation on a Confidential Ledger Resource. + * + * Backs up a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Backup Request Body. + * @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 object representing the backup response of a Confidential Ledger Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfidentialLedgerBackupResponseInner backup(String resourceGroupName, String ledgerName, + ConfidentialLedgerBackup confidentialLedger); + + /** + * Performs the backup operation on a Confidential Ledger Resource. + * + * Backs up a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Backup Request Body. + * @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 object representing the backup response of a Confidential Ledger Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfidentialLedgerBackupResponseInner backup(String resourceGroupName, String ledgerName, + ConfidentialLedgerBackup confidentialLedger, Context context); + + /** + * Performs the restore operation to spin up a newly restored Confidential Ledger Resource. + * + * Restores a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Restore Request Body. + * @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 SyncPoller} for polling of object representing the restore response of a Confidential Ledger + * Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfidentialLedgerRestoreResponseInner> + beginRestore(String resourceGroupName, String ledgerName, ConfidentialLedgerRestore confidentialLedger); + + /** + * Performs the restore operation to spin up a newly restored Confidential Ledger Resource. + * + * Restores a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Restore Request Body. + * @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 SyncPoller} for polling of object representing the restore response of a Confidential Ledger + * Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfidentialLedgerRestoreResponseInner> beginRestore( + String resourceGroupName, String ledgerName, ConfidentialLedgerRestore confidentialLedger, Context context); + + /** + * Performs the restore operation to spin up a newly restored Confidential Ledger Resource. + * + * Restores a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Restore Request Body. + * @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 object representing the restore response of a Confidential Ledger Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfidentialLedgerRestoreResponseInner restore(String resourceGroupName, String ledgerName, + ConfidentialLedgerRestore confidentialLedger); + + /** + * Performs the restore operation to spin up a newly restored Confidential Ledger Resource. + * + * Restores a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Restore Request Body. + * @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 object representing the restore response of a Confidential Ledger Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfidentialLedgerRestoreResponseInner restore(String resourceGroupName, String ledgerName, + ConfidentialLedgerRestore confidentialLedger, Context context); } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/ManagedCcfsClient.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/ManagedCcfsClient.java index 6178943aba66..0a65f53a7008 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/ManagedCcfsClient.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/ManagedCcfsClient.java @@ -11,15 +11,21 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfBackupResponseInner; import com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfInner; +import com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfRestoreResponseInner; +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfBackup; +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfRestore; -/** An instance of this class provides access to all the operations defined in ManagedCcfsClient. */ +/** + * An instance of this class provides access to all the operations defined in ManagedCcfsClient. + */ public interface ManagedCcfsClient { /** * Retrieves information about a Managed CCF resource. - * - *

Retrieves the properties of a Managed CCF app. - * + * + * Retrieves the properties of a Managed CCF app. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param context The context to associate with this operation. @@ -33,9 +39,9 @@ public interface ManagedCcfsClient { /** * Retrieves information about a Managed CCF resource. - * - *

Retrieves the properties of a Managed CCF app. - * + * + * Retrieves the properties of a Managed CCF app. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -48,9 +54,9 @@ public interface ManagedCcfsClient { /** * Deletes a Managed CCF resource. - * - *

Deletes an existing Managed CCF. - * + * + * Deletes an existing Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -63,9 +69,9 @@ public interface ManagedCcfsClient { /** * Deletes a Managed CCF resource. - * - *

Deletes an existing Managed CCF. - * + * + * Deletes an existing Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param context The context to associate with this operation. @@ -79,9 +85,9 @@ public interface ManagedCcfsClient { /** * Deletes a Managed CCF resource. - * - *

Deletes an existing Managed CCF. - * + * + * Deletes an existing Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -93,9 +99,9 @@ public interface ManagedCcfsClient { /** * Deletes a Managed CCF resource. - * - *

Deletes an existing Managed CCF. - * + * + * Deletes an existing Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param context The context to associate with this operation. @@ -108,9 +114,9 @@ public interface ManagedCcfsClient { /** * Creates a Managed CCF. - * - *

Creates a Managed CCF with the specified Managed CCF parameters. - * + * + * Creates a Managed CCF with the specified Managed CCF parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. @@ -120,14 +126,14 @@ public interface ManagedCcfsClient { * @return the {@link SyncPoller} for polling of managed CCF. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ManagedCcfInner> beginCreate( - String resourceGroupName, String appName, ManagedCcfInner managedCcf); + SyncPoller, ManagedCcfInner> beginCreate(String resourceGroupName, String appName, + ManagedCcfInner managedCcf); /** * Creates a Managed CCF. - * - *

Creates a Managed CCF with the specified Managed CCF parameters. - * + * + * Creates a Managed CCF with the specified Managed CCF parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. @@ -138,14 +144,14 @@ SyncPoller, ManagedCcfInner> beginCreate( * @return the {@link SyncPoller} for polling of managed CCF. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ManagedCcfInner> beginCreate( - String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context); + SyncPoller, ManagedCcfInner> beginCreate(String resourceGroupName, String appName, + ManagedCcfInner managedCcf, Context context); /** * Creates a Managed CCF. - * - *

Creates a Managed CCF with the specified Managed CCF parameters. - * + * + * Creates a Managed CCF with the specified Managed CCF parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. @@ -159,9 +165,9 @@ SyncPoller, ManagedCcfInner> beginCreate( /** * Creates a Managed CCF. - * - *

Creates a Managed CCF with the specified Managed CCF parameters. - * + * + * Creates a Managed CCF with the specified Managed CCF parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. @@ -176,26 +182,26 @@ SyncPoller, ManagedCcfInner> beginCreate( /** * Update Managed CCF properties - * - *

Updates properties of Managed CCF. - * + * + * Updates properties of Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. * @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 SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of managed CCF. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginUpdate( - String resourceGroupName, String appName, ManagedCcfInner managedCcf); + SyncPoller, ManagedCcfInner> beginUpdate(String resourceGroupName, String appName, + ManagedCcfInner managedCcf); /** * Update Managed CCF properties - * - *

Updates properties of Managed CCF. - * + * + * Updates properties of Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. @@ -203,32 +209,33 @@ SyncPoller, Void> beginUpdate( * @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 SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of managed CCF. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginUpdate( - String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context); + SyncPoller, ManagedCcfInner> beginUpdate(String resourceGroupName, String appName, + ManagedCcfInner managedCcf, Context context); /** * Update Managed CCF properties - * - *

Updates properties of Managed CCF. - * + * + * Updates properties of Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. * @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 managed CCF. */ @ServiceMethod(returns = ReturnType.SINGLE) - void update(String resourceGroupName, String appName, ManagedCcfInner managedCcf); + ManagedCcfInner update(String resourceGroupName, String appName, ManagedCcfInner managedCcf); /** * Update Managed CCF properties - * - *

Updates properties of Managed CCF. - * + * + * Updates properties of Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. @@ -236,30 +243,31 @@ SyncPoller, Void> beginUpdate( * @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 managed CCF. */ @ServiceMethod(returns = ReturnType.SINGLE) - void update(String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context); + ManagedCcfInner update(String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context); /** * Retrieves information about all Managed CCF resources under the given subscription and resource group - * - *

Retrieves the properties of all Managed CCF apps. - * + * + * Retrieves the properties of all Managed CCF apps. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); /** * Retrieves information about all Managed CCF resources under the given subscription and resource group - * - *

Retrieves the properties of all Managed CCF apps. - * + * + * Retrieves the properties of all Managed CCF apps. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @param context The context to associate with this operation. @@ -267,37 +275,175 @@ SyncPoller, Void> beginUpdate( * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, String filter, Context context); /** * Retrieves information about all Managed CCF resources under the given subscription - * - *

Retrieves the properties of all Managed CCF. - * + * + * Retrieves the properties of all Managed CCF. + * * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** * Retrieves information about all Managed CCF resources under the given subscription - * - *

Retrieves the properties of all Managed CCF. - * + * + * Retrieves the properties of all Managed CCF. + * * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String filter, Context context); + + /** + * Performs the backup operation on a Managed CCF Resource. + * + * Backs up a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Backup Request Body. + * @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 SyncPoller} for polling of object representing the backup response of a Managed CCF Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedCcfBackupResponseInner> + beginBackup(String resourceGroupName, String appName, ManagedCcfBackup managedCcf); + + /** + * Performs the backup operation on a Managed CCF Resource. + * + * Backs up a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Backup Request Body. + * @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 SyncPoller} for polling of object representing the backup response of a Managed CCF Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedCcfBackupResponseInner> + beginBackup(String resourceGroupName, String appName, ManagedCcfBackup managedCcf, Context context); + + /** + * Performs the backup operation on a Managed CCF Resource. + * + * Backs up a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Backup Request Body. + * @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 object representing the backup response of a Managed CCF Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedCcfBackupResponseInner backup(String resourceGroupName, String appName, ManagedCcfBackup managedCcf); + + /** + * Performs the backup operation on a Managed CCF Resource. + * + * Backs up a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Backup Request Body. + * @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 object representing the backup response of a Managed CCF Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedCcfBackupResponseInner backup(String resourceGroupName, String appName, ManagedCcfBackup managedCcf, + Context context); + + /** + * Performs the restore operation to spin up a newly restored Managed CCF Resource. + * + * Restores a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Restore Request Body. + * @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 SyncPoller} for polling of object representing the restore response of a Managed CCF Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedCcfRestoreResponseInner> + beginRestore(String resourceGroupName, String appName, ManagedCcfRestore managedCcf); + + /** + * Performs the restore operation to spin up a newly restored Managed CCF Resource. + * + * Restores a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Restore Request Body. + * @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 SyncPoller} for polling of object representing the restore response of a Managed CCF Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedCcfRestoreResponseInner> + beginRestore(String resourceGroupName, String appName, ManagedCcfRestore managedCcf, Context context); + + /** + * Performs the restore operation to spin up a newly restored Managed CCF Resource. + * + * Restores a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Restore Request Body. + * @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 object representing the restore response of a Managed CCF Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedCcfRestoreResponseInner restore(String resourceGroupName, String appName, ManagedCcfRestore managedCcf); + + /** + * Performs the restore operation to spin up a newly restored Managed CCF Resource. + * + * Restores a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Restore Request Body. + * @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 object representing the restore response of a Managed CCF Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedCcfRestoreResponseInner restore(String resourceGroupName, String appName, ManagedCcfRestore managedCcf, + Context context); } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/OperationsClient.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/OperationsClient.java index 9a5f43772a0f..535ff9a2ca5c 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/OperationsClient.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/OperationsClient.java @@ -10,32 +10,34 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.confidentialledger.fluent.models.ResourceProviderOperationDefinitionInner; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public interface OperationsClient { /** * Retrieves a list of available API operations under this Resource Provider. - * - *

Retrieves a list of available API operations. - * + * + * Retrieves a list of available API operations. + * * @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 list containing this Resource Provider's available operations as paginated response with {@link - * PagedIterable}. + * @return list containing this Resource Provider's available operations as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** * Retrieves a list of available API operations under this Resource Provider. - * - *

Retrieves a list of available API operations. - * + * + * Retrieves a list of available API operations. + * * @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 list containing this Resource Provider's available operations as paginated response with {@link - * PagedIterable}. + * @return list containing this Resource Provider's available operations as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/ResourceProvidersClient.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/ResourceProvidersClient.java index 7691096ec576..b0146514b10d 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/ResourceProvidersClient.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/ResourceProvidersClient.java @@ -11,11 +11,13 @@ import com.azure.resourcemanager.confidentialledger.fluent.models.CheckNameAvailabilityResponseInner; import com.azure.resourcemanager.confidentialledger.models.CheckNameAvailabilityRequest; -/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +/** + * An instance of this class provides access to all the operations defined in ResourceProvidersClient. + */ public interface ResourceProvidersClient { /** * To check whether a resource name is available. - * + * * @param nameAvailabilityRequest Name availability request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,12 +26,12 @@ public interface ResourceProvidersClient { * @return the check availability result along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityWithResponse( - CheckNameAvailabilityRequest nameAvailabilityRequest, Context context); + Response + checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest nameAvailabilityRequest, Context context); /** * To check whether a resource name is available. - * + * * @param nameAvailabilityRequest Name availability request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/CheckNameAvailabilityResponseInner.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/CheckNameAvailabilityResponseInner.java index 21193c1a986b..9d7511fbb2c9 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/CheckNameAvailabilityResponseInner.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/CheckNameAvailabilityResponseInner.java @@ -8,7 +8,9 @@ import com.azure.resourcemanager.confidentialledger.models.CheckNameAvailabilityReason; import com.fasterxml.jackson.annotation.JsonProperty; -/** The check availability result. */ +/** + * The check availability result. + */ @Fluent public final class CheckNameAvailabilityResponseInner { /* @@ -29,13 +31,15 @@ public final class CheckNameAvailabilityResponseInner { @JsonProperty(value = "message") private String message; - /** Creates an instance of CheckNameAvailabilityResponseInner class. */ + /** + * Creates an instance of CheckNameAvailabilityResponseInner class. + */ public CheckNameAvailabilityResponseInner() { } /** * Get the nameAvailable property: Indicates if the resource name is available. - * + * * @return the nameAvailable value. */ public Boolean nameAvailable() { @@ -44,7 +48,7 @@ public Boolean nameAvailable() { /** * Set the nameAvailable property: Indicates if the resource name is available. - * + * * @param nameAvailable the nameAvailable value to set. * @return the CheckNameAvailabilityResponseInner object itself. */ @@ -55,7 +59,7 @@ public CheckNameAvailabilityResponseInner withNameAvailable(Boolean nameAvailabl /** * Get the reason property: The reason why the given name is not available. - * + * * @return the reason value. */ public CheckNameAvailabilityReason reason() { @@ -64,7 +68,7 @@ public CheckNameAvailabilityReason reason() { /** * Set the reason property: The reason why the given name is not available. - * + * * @param reason the reason value to set. * @return the CheckNameAvailabilityResponseInner object itself. */ @@ -75,7 +79,7 @@ public CheckNameAvailabilityResponseInner withReason(CheckNameAvailabilityReason /** * Get the message property: Detailed reason why the given name is available. - * + * * @return the message value. */ public String message() { @@ -84,7 +88,7 @@ public String message() { /** * Set the message property: Detailed reason why the given name is available. - * + * * @param message the message value to set. * @return the CheckNameAvailabilityResponseInner object itself. */ @@ -95,7 +99,7 @@ public CheckNameAvailabilityResponseInner withMessage(String message) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ConfidentialLedgerBackupResponseInner.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ConfidentialLedgerBackupResponseInner.java new file mode 100644 index 000000000000..4ed190770f31 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ConfidentialLedgerBackupResponseInner.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.confidentialledger.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Object representing the backup response of a Confidential Ledger Resource. + */ +@Immutable +public final class ConfidentialLedgerBackupResponseInner { + /* + * Response body stating if the ledger is being backed up. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Creates an instance of ConfidentialLedgerBackupResponseInner class. + */ + public ConfidentialLedgerBackupResponseInner() { + } + + /** + * Get the message property: Response body stating if the ledger is being backed up. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ConfidentialLedgerInner.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ConfidentialLedgerInner.java index d1c66d96502d..5dbed69efdfc 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ConfidentialLedgerInner.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ConfidentialLedgerInner.java @@ -11,12 +11,14 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** Confidential Ledger. Contains the properties of Confidential Ledger Resource. */ +/** + * Confidential Ledger. Contains the properties of Confidential Ledger Resource. + */ @Fluent public final class ConfidentialLedgerInner extends Resource { /* * LedgerProperties - * + * * Properties of Confidential Ledger Resource. */ @JsonProperty(value = "properties") @@ -28,15 +30,17 @@ public final class ConfidentialLedgerInner extends Resource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of ConfidentialLedgerInner class. */ + /** + * Creates an instance of ConfidentialLedgerInner class. + */ public ConfidentialLedgerInner() { } /** * Get the properties property: LedgerProperties - * - *

Properties of Confidential Ledger Resource. - * + * + * Properties of Confidential Ledger Resource. + * * @return the properties value. */ public LedgerProperties properties() { @@ -45,9 +49,9 @@ public LedgerProperties properties() { /** * Set the properties property: LedgerProperties - * - *

Properties of Confidential Ledger Resource. - * + * + * Properties of Confidential Ledger Resource. + * * @param properties the properties value to set. * @return the ConfidentialLedgerInner object itself. */ @@ -58,21 +62,25 @@ public ConfidentialLedgerInner withProperties(LedgerProperties properties) { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ConfidentialLedgerInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ConfidentialLedgerInner withTags(Map tags) { super.withTags(tags); @@ -81,7 +89,7 @@ public ConfidentialLedgerInner withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ConfidentialLedgerRestoreResponseInner.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ConfidentialLedgerRestoreResponseInner.java new file mode 100644 index 000000000000..5ed92f9f2dd0 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ConfidentialLedgerRestoreResponseInner.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.confidentialledger.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Object representing the restore response of a Confidential Ledger Resource. + */ +@Immutable +public final class ConfidentialLedgerRestoreResponseInner { + /* + * Response body stating if the ledger is being restored. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Creates an instance of ConfidentialLedgerRestoreResponseInner class. + */ + public ConfidentialLedgerRestoreResponseInner() { + } + + /** + * Get the message property: Response body stating if the ledger is being restored. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ManagedCcfBackupResponseInner.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ManagedCcfBackupResponseInner.java new file mode 100644 index 000000000000..9900b3036c2a --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ManagedCcfBackupResponseInner.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.confidentialledger.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Object representing the backup response of a Managed CCF Resource. + */ +@Immutable +public final class ManagedCcfBackupResponseInner { + /* + * Response body stating if the managed CCF resource is being backed up. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Creates an instance of ManagedCcfBackupResponseInner class. + */ + public ManagedCcfBackupResponseInner() { + } + + /** + * Get the message property: Response body stating if the managed CCF resource is being backed up. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ManagedCcfInner.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ManagedCcfInner.java index 1d4ee44e8949..f545534ed1f2 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ManagedCcfInner.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ManagedCcfInner.java @@ -11,12 +11,14 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** Managed CCF. Contains the properties of Managed CCF Resource. */ +/** + * Managed CCF. Contains the properties of Managed CCF Resource. + */ @Fluent public final class ManagedCcfInner extends Resource { /* * ManagedCCFProperties - * + * * Properties of Managed CCF Resource. */ @JsonProperty(value = "properties") @@ -28,15 +30,17 @@ public final class ManagedCcfInner extends Resource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of ManagedCcfInner class. */ + /** + * Creates an instance of ManagedCcfInner class. + */ public ManagedCcfInner() { } /** * Get the properties property: ManagedCCFProperties - * - *

Properties of Managed CCF Resource. - * + * + * Properties of Managed CCF Resource. + * * @return the properties value. */ public ManagedCcfProperties properties() { @@ -45,9 +49,9 @@ public ManagedCcfProperties properties() { /** * Set the properties property: ManagedCCFProperties - * - *

Properties of Managed CCF Resource. - * + * + * Properties of Managed CCF Resource. + * * @param properties the properties value to set. * @return the ManagedCcfInner object itself. */ @@ -58,21 +62,25 @@ public ManagedCcfInner withProperties(ManagedCcfProperties properties) { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ManagedCcfInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ManagedCcfInner withTags(Map tags) { super.withTags(tags); @@ -81,7 +89,7 @@ public ManagedCcfInner withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ManagedCcfRestoreResponseInner.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ManagedCcfRestoreResponseInner.java new file mode 100644 index 000000000000..da17f25c069b --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ManagedCcfRestoreResponseInner.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.confidentialledger.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Object representing the restore response of a Managed CCF Resource. + */ +@Immutable +public final class ManagedCcfRestoreResponseInner { + /* + * Response body stating if the managed CCF resource is being restored. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Creates an instance of ManagedCcfRestoreResponseInner class. + */ + public ManagedCcfRestoreResponseInner() { + } + + /** + * Get the message property: Response body stating if the managed CCF resource is being restored. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ResourceProviderOperationDefinitionInner.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ResourceProviderOperationDefinitionInner.java index 56a037e59fda..d63c354e546d 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ResourceProviderOperationDefinitionInner.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/ResourceProviderOperationDefinitionInner.java @@ -8,7 +8,9 @@ import com.azure.resourcemanager.confidentialledger.models.ResourceProviderOperationDisplay; import com.fasterxml.jackson.annotation.JsonProperty; -/** Describes the Resource Provider Operation. */ +/** + * Describes the Resource Provider Operation. + */ @Fluent public final class ResourceProviderOperationDefinitionInner { /* @@ -29,13 +31,15 @@ public final class ResourceProviderOperationDefinitionInner { @JsonProperty(value = "display") private ResourceProviderOperationDisplay display; - /** Creates an instance of ResourceProviderOperationDefinitionInner class. */ + /** + * Creates an instance of ResourceProviderOperationDefinitionInner class. + */ public ResourceProviderOperationDefinitionInner() { } /** * Get the name property: Resource provider operation name. - * + * * @return the name value. */ public String name() { @@ -44,7 +48,7 @@ public String name() { /** * Set the name property: Resource provider operation name. - * + * * @param name the name value to set. * @return the ResourceProviderOperationDefinitionInner object itself. */ @@ -55,7 +59,7 @@ public ResourceProviderOperationDefinitionInner withName(String name) { /** * Get the isDataAction property: Indicates whether the operation is data action or not. - * + * * @return the isDataAction value. */ public Boolean isDataAction() { @@ -64,7 +68,7 @@ public Boolean isDataAction() { /** * Set the isDataAction property: Indicates whether the operation is data action or not. - * + * * @param isDataAction the isDataAction value to set. * @return the ResourceProviderOperationDefinitionInner object itself. */ @@ -75,7 +79,7 @@ public ResourceProviderOperationDefinitionInner withIsDataAction(Boolean isDataA /** * Get the display property: Details about the operations. - * + * * @return the display value. */ public ResourceProviderOperationDisplay display() { @@ -84,7 +88,7 @@ public ResourceProviderOperationDisplay display() { /** * Set the display property: Details about the operations. - * + * * @param display the display value to set. * @return the ResourceProviderOperationDefinitionInner object itself. */ @@ -95,7 +99,7 @@ public ResourceProviderOperationDefinitionInner withDisplay(ResourceProviderOper /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/package-info.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/package-info.java index b3b77ca549da..96883961c342 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/package-info.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/models/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the inner data models for ConfidentialLedgerManagementClient. Microsoft Azure Confidential Compute - * Ledger Control Plane REST API version 2020-12-01-preview. + * Package containing the inner data models for ConfidentialLedgerManagementClient. + * Microsoft Azure Confidential Compute Ledger Control Plane REST API version 2020-12-01-preview. */ package com.azure.resourcemanager.confidentialledger.fluent.models; diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/package-info.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/package-info.java index d5062e2caf4e..190001716db3 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/package-info.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/fluent/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the service clients for ConfidentialLedgerManagementClient. Microsoft Azure Confidential Compute - * Ledger Control Plane REST API version 2020-12-01-preview. + * Package containing the service clients for ConfidentialLedgerManagementClient. + * Microsoft Azure Confidential Compute Ledger Control Plane REST API version 2020-12-01-preview. */ package com.azure.resourcemanager.confidentialledger.fluent; diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/CheckNameAvailabilityResponseImpl.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/CheckNameAvailabilityResponseImpl.java index 0b0bff6b7cfc..664c459cf239 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/CheckNameAvailabilityResponseImpl.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/CheckNameAvailabilityResponseImpl.java @@ -13,8 +13,7 @@ public final class CheckNameAvailabilityResponseImpl implements CheckNameAvailab private final com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager; - CheckNameAvailabilityResponseImpl( - CheckNameAvailabilityResponseInner innerObject, + CheckNameAvailabilityResponseImpl(CheckNameAvailabilityResponseInner innerObject, com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ConfidentialLedgerBackupResponseImpl.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ConfidentialLedgerBackupResponseImpl.java new file mode 100644 index 000000000000..747cced4c87b --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ConfidentialLedgerBackupResponseImpl.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.confidentialledger.implementation; + +import com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerBackupResponseInner; +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerBackupResponse; + +public final class ConfidentialLedgerBackupResponseImpl implements ConfidentialLedgerBackupResponse { + private ConfidentialLedgerBackupResponseInner innerObject; + + private final com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager; + + ConfidentialLedgerBackupResponseImpl(ConfidentialLedgerBackupResponseInner innerObject, + com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String message() { + return this.innerModel().message(); + } + + public ConfidentialLedgerBackupResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ConfidentialLedgerImpl.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ConfidentialLedgerImpl.java index 619543f9bb33..969486f13479 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ConfidentialLedgerImpl.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ConfidentialLedgerImpl.java @@ -9,6 +9,10 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerInner; import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedger; +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerBackup; +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerBackupResponse; +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerRestore; +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerRestoreResponse; import com.azure.resourcemanager.confidentialledger.models.LedgerProperties; import java.util.Collections; import java.util.Map; @@ -82,25 +86,21 @@ public ConfidentialLedgerImpl withExistingResourceGroup(String resourceGroupName } public ConfidentialLedger create() { - this.innerObject = - serviceManager - .serviceClient() - .getLedgers() - .create(resourceGroupName, ledgerName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getLedgers() + .create(resourceGroupName, ledgerName, this.innerModel(), Context.NONE); return this; } public ConfidentialLedger create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getLedgers() - .create(resourceGroupName, ledgerName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getLedgers() + .create(resourceGroupName, ledgerName, this.innerModel(), context); return this; } - ConfidentialLedgerImpl( - String name, com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager) { + ConfidentialLedgerImpl(String name, + com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager) { this.innerObject = new ConfidentialLedgerInner(); this.serviceManager = serviceManager; this.ledgerName = name; @@ -111,52 +111,59 @@ public ConfidentialLedgerImpl update() { } public ConfidentialLedger apply() { - this.innerObject = - serviceManager - .serviceClient() - .getLedgers() - .update(resourceGroupName, ledgerName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getLedgers() + .update(resourceGroupName, ledgerName, this.innerModel(), Context.NONE); return this; } public ConfidentialLedger apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getLedgers() - .update(resourceGroupName, ledgerName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getLedgers() + .update(resourceGroupName, ledgerName, this.innerModel(), context); return this; } - ConfidentialLedgerImpl( - ConfidentialLedgerInner innerObject, + ConfidentialLedgerImpl(ConfidentialLedgerInner innerObject, com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.ledgerName = Utils.getValueFromIdByName(innerObject.id(), "ledgers"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.ledgerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ledgers"); } public ConfidentialLedger refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getLedgers() - .getByResourceGroupWithResponse(resourceGroupName, ledgerName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getLedgers() + .getByResourceGroupWithResponse(resourceGroupName, ledgerName, Context.NONE) + .getValue(); return this; } public ConfidentialLedger refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getLedgers() - .getByResourceGroupWithResponse(resourceGroupName, ledgerName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getLedgers() + .getByResourceGroupWithResponse(resourceGroupName, ledgerName, context) + .getValue(); return this; } + public ConfidentialLedgerBackupResponse backup(ConfidentialLedgerBackup confidentialLedger) { + return serviceManager.ledgers().backup(resourceGroupName, ledgerName, confidentialLedger); + } + + public ConfidentialLedgerBackupResponse backup(ConfidentialLedgerBackup confidentialLedger, Context context) { + return serviceManager.ledgers().backup(resourceGroupName, ledgerName, confidentialLedger, context); + } + + public ConfidentialLedgerRestoreResponse restore(ConfidentialLedgerRestore confidentialLedger) { + return serviceManager.ledgers().restore(resourceGroupName, ledgerName, confidentialLedger); + } + + public ConfidentialLedgerRestoreResponse restore(ConfidentialLedgerRestore confidentialLedger, Context context) { + return serviceManager.ledgers().restore(resourceGroupName, ledgerName, confidentialLedger, context); + } + public ConfidentialLedgerImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ConfidentialLedgerManagementClientBuilder.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ConfidentialLedgerManagementClientBuilder.java index e4bab539b1cc..3890ed977512 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ConfidentialLedgerManagementClientBuilder.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ConfidentialLedgerManagementClientBuilder.java @@ -14,8 +14,10 @@ import com.azure.core.util.serializer.SerializerAdapter; import java.time.Duration; -/** A builder for creating a new instance of the ConfidentialLedgerManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = {ConfidentialLedgerManagementClientImpl.class}) +/** + * A builder for creating a new instance of the ConfidentialLedgerManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { ConfidentialLedgerManagementClientImpl.class }) public final class ConfidentialLedgerManagementClientBuilder { /* * The ID of the target subscription. @@ -24,7 +26,7 @@ public final class ConfidentialLedgerManagementClientBuilder { /** * Sets The ID of the target subscription. - * + * * @param subscriptionId the subscriptionId value. * @return the ConfidentialLedgerManagementClientBuilder. */ @@ -40,7 +42,7 @@ public ConfidentialLedgerManagementClientBuilder subscriptionId(String subscript /** * Sets server parameter. - * + * * @param endpoint the endpoint value. * @return the ConfidentialLedgerManagementClientBuilder. */ @@ -56,7 +58,7 @@ public ConfidentialLedgerManagementClientBuilder endpoint(String endpoint) { /** * Sets The environment to connect to. - * + * * @param environment the environment value. * @return the ConfidentialLedgerManagementClientBuilder. */ @@ -72,7 +74,7 @@ public ConfidentialLedgerManagementClientBuilder environment(AzureEnvironment en /** * Sets The HTTP pipeline to send requests through. - * + * * @param pipeline the pipeline value. * @return the ConfidentialLedgerManagementClientBuilder. */ @@ -88,7 +90,7 @@ public ConfidentialLedgerManagementClientBuilder pipeline(HttpPipeline pipeline) /** * Sets The default poll interval for long-running operation. - * + * * @param defaultPollInterval the defaultPollInterval value. * @return the ConfidentialLedgerManagementClientBuilder. */ @@ -104,7 +106,7 @@ public ConfidentialLedgerManagementClientBuilder defaultPollInterval(Duration de /** * Sets The serializer to serialize an object into a string. - * + * * @param serializerAdapter the serializerAdapter value. * @return the ConfidentialLedgerManagementClientBuilder. */ @@ -115,30 +117,22 @@ public ConfidentialLedgerManagementClientBuilder serializerAdapter(SerializerAda /** * Builds an instance of ConfidentialLedgerManagementClientImpl with the provided parameters. - * + * * @return an instance of ConfidentialLedgerManagementClientImpl. */ public ConfidentialLedgerManagementClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; - HttpPipeline localPipeline = - (pipeline != null) - ? pipeline - : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - Duration localDefaultPollInterval = - (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); - SerializerAdapter localSerializerAdapter = - (serializerAdapter != null) - ? serializerAdapter - : SerializerFactory.createDefaultManagementSerializerAdapter(); - ConfidentialLedgerManagementClientImpl client = - new ConfidentialLedgerManagementClientImpl( - localPipeline, - localSerializerAdapter, - localDefaultPollInterval, - localEnvironment, - subscriptionId, - localEndpoint); + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + ConfidentialLedgerManagementClientImpl client = new ConfidentialLedgerManagementClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); return client; } } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ConfidentialLedgerManagementClientImpl.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ConfidentialLedgerManagementClientImpl.java index 5eb3772aad7d..4338031c5a76 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ConfidentialLedgerManagementClientImpl.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ConfidentialLedgerManagementClientImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.confidentialledger.implementation; import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpResponse; @@ -12,8 +13,8 @@ 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.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; @@ -36,123 +37,145 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** Initializes a new instance of the ConfidentialLedgerManagementClientImpl type. */ +/** + * Initializes a new instance of the ConfidentialLedgerManagementClientImpl type. + */ @ServiceClient(builder = ConfidentialLedgerManagementClientBuilder.class) public final class ConfidentialLedgerManagementClientImpl implements ConfidentialLedgerManagementClient { - /** The ID of the target subscription. */ + /** + * The ID of the target subscription. + */ private final String subscriptionId; /** * Gets The ID of the target subscription. - * + * * @return the subscriptionId value. */ public String getSubscriptionId() { return this.subscriptionId; } - /** server parameter. */ + /** + * server parameter. + */ private final String endpoint; /** * Gets server parameter. - * + * * @return the endpoint value. */ public String getEndpoint() { return this.endpoint; } - /** Api Version. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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 OperationsClient object to access its operations. */ + /** + * 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 ResourceProvidersClient object to access its operations. */ + /** + * The ResourceProvidersClient object to access its operations. + */ private final ResourceProvidersClient resourceProviders; /** * Gets the ResourceProvidersClient object to access its operations. - * + * * @return the ResourceProvidersClient object. */ public ResourceProvidersClient getResourceProviders() { return this.resourceProviders; } - /** The LedgersClient object to access its operations. */ + /** + * The LedgersClient object to access its operations. + */ private final LedgersClient ledgers; /** * Gets the LedgersClient object to access its operations. - * + * * @return the LedgersClient object. */ public LedgersClient getLedgers() { return this.ledgers; } - /** The ManagedCcfsClient object to access its operations. */ + /** + * The ManagedCcfsClient object to access its operations. + */ private final ManagedCcfsClient managedCcfs; /** * Gets the ManagedCcfsClient object to access its operations. - * + * * @return the ManagedCcfsClient object. */ public ManagedCcfsClient getManagedCcfs() { @@ -161,7 +184,7 @@ public ManagedCcfsClient getManagedCcfs() { /** * Initializes an instance of ConfidentialLedgerManagementClient 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. @@ -169,19 +192,14 @@ public ManagedCcfsClient getManagedCcfs() { * @param subscriptionId The ID of the target subscription. * @param endpoint server parameter. */ - ConfidentialLedgerManagementClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { + ConfidentialLedgerManagementClientImpl(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 = "2023-01-26-preview"; + this.apiVersion = "2023-06-28-preview"; this.operations = new OperationsClientImpl(this); this.resourceProviders = new ResourceProvidersClientImpl(this); this.ledgers = new LedgersClientImpl(this); @@ -190,7 +208,7 @@ public ManagedCcfsClient getManagedCcfs() { /** * Gets default client context. - * + * * @return the default client context. */ public Context getContext() { @@ -199,7 +217,7 @@ public Context getContext() { /** * Merges default client context with provided context. - * + * * @param context the context to be merged with default client context. * @return the merged context. */ @@ -209,7 +227,7 @@ public Context mergeContext(Context context) { /** * Gets long running operation result. - * + * * @param activationResponse the response of activation operation. * @param httpPipeline the http pipeline. * @param pollResultType type of poll result. @@ -219,26 +237,15 @@ public Context mergeContext(Context context) { * @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); + 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. @@ -251,19 +258,16 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, HttpResponse errorResponse = null; PollResult.Error lroError = response.getValue().getError(); if (lroError != null) { - errorResponse = - new HttpResponseImpl( - lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + 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); + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); if (managementError.getCode() == null || managementError.getMessage() == null) { managementError = null; } @@ -304,7 +308,7 @@ public int getStatusCode() { } public String getHeaderValue(String s) { - return httpHeaders.getValue(s); + return httpHeaders.getValue(HttpHeaderName.fromString(s)); } public HttpHeaders getHeaders() { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ConfidentialLedgerRestoreResponseImpl.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ConfidentialLedgerRestoreResponseImpl.java new file mode 100644 index 000000000000..f6f6989d8f35 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ConfidentialLedgerRestoreResponseImpl.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.confidentialledger.implementation; + +import com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerRestoreResponseInner; +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerRestoreResponse; + +public final class ConfidentialLedgerRestoreResponseImpl implements ConfidentialLedgerRestoreResponse { + private ConfidentialLedgerRestoreResponseInner innerObject; + + private final com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager; + + ConfidentialLedgerRestoreResponseImpl(ConfidentialLedgerRestoreResponseInner innerObject, + com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String message() { + return this.innerModel().message(); + } + + public ConfidentialLedgerRestoreResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/LedgersClientImpl.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/LedgersClientImpl.java index 43287abd0713..601c6faa6185 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/LedgersClientImpl.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/LedgersClientImpl.java @@ -14,6 +14,7 @@ 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; @@ -33,23 +34,33 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.confidentialledger.fluent.LedgersClient; +import com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerBackupResponseInner; import com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerInner; +import com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerRestoreResponseInner; +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerBackup; import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerList; +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerRestore; 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 LedgersClient. */ +/** + * An instance of this class provides access to all the operations defined in LedgersClient. + */ public final class LedgersClientImpl implements LedgersClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final LedgersService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ConfidentialLedgerManagementClientImpl client; /** * Initializes an instance of LedgersClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ LedgersClientImpl(ConfidentialLedgerManagementClientImpl client) { @@ -64,116 +75,103 @@ public final class LedgersClientImpl implements LedgersClient { @Host("{$host}") @ServiceInterface(name = "ConfidentialLedgerMa") public interface LedgersService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/ledgers/{ledgerName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/ledgers/{ledgerName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ledgerName") String ledgerName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/ledgers/{ledgerName}") - @ExpectedResponses({200, 202, 204}) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ledgerName") String ledgerName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/ledgers/{ledgerName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ledgerName") String ledgerName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/ledgers/{ledgerName}") - @ExpectedResponses({200, 201}) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ledgerName") String ledgerName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/ledgers/{ledgerName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ledgerName") String ledgerName, + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ledgerName") String ledgerName, @BodyParam("application/json") ConfidentialLedgerInner confidentialLedger, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/ledgers/{ledgerName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/ledgers/{ledgerName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ledgerName") String ledgerName, + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ledgerName") String ledgerName, @BodyParam("application/json") ConfidentialLedgerInner confidentialLedger, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/ledgers") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/ledgers") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ConfidentialLedger/ledgers/") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/ledgers/{ledgerName}/backup") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> backup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ledgerName") String ledgerName, + @BodyParam("application/json") ConfidentialLedgerBackup confidentialLedger, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/ledgers/{ledgerName}/restore") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) + Mono>> restore(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ledgerName") String ledgerName, + @BodyParam("application/json") ConfidentialLedgerRestore confidentialLedger, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Retrieves information about a Confidential Ledger resource. - * - *

Retrieves the properties of a Confidential Ledger. - * + * + * Retrieves the properties of a Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -182,19 +180,15 @@ Mono> listBySubscriptionNext( * @return confidential Ledger along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String ledgerName) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String ledgerName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -205,25 +199,16 @@ private Mono> getByResourceGroupWithResponseAs } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - ledgerName, - accept, - context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, ledgerName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Retrieves information about a Confidential Ledger resource. - * - *

Retrieves the properties of a Confidential Ledger. - * + * + * Retrieves the properties of a Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param context The context to associate with this operation. @@ -233,19 +218,15 @@ private Mono> getByResourceGroupWithResponseAs * @return confidential Ledger along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String ledgerName, Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String ledgerName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -256,22 +237,15 @@ private Mono> getByResourceGroupWithResponseAs } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - ledgerName, - accept, - context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, ledgerName, accept, context); } /** * Retrieves information about a Confidential Ledger resource. - * - *

Retrieves the properties of a Confidential Ledger. - * + * + * Retrieves the properties of a Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -287,9 +261,9 @@ private Mono getByResourceGroupAsync(String resourceGro /** * Retrieves information about a Confidential Ledger resource. - * - *

Retrieves the properties of a Confidential Ledger. - * + * + * Retrieves the properties of a Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param context The context to associate with this operation. @@ -299,16 +273,16 @@ private Mono getByResourceGroupAsync(String resourceGro * @return confidential Ledger along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String ledgerName, Context context) { + public Response getByResourceGroupWithResponse(String resourceGroupName, String ledgerName, + Context context) { return getByResourceGroupWithResponseAsync(resourceGroupName, ledgerName, context).block(); } /** * Retrieves information about a Confidential Ledger resource. - * - *

Retrieves the properties of a Confidential Ledger. - * + * + * Retrieves the properties of a Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -323,9 +297,9 @@ public ConfidentialLedgerInner getByResourceGroup(String resourceGroupName, Stri /** * Deletes a Confidential Ledger resource. - * - *

Deletes an existing Confidential Ledger. - * + * + * Deletes an existing Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -336,16 +310,12 @@ public ConfidentialLedgerInner getByResourceGroup(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String ledgerName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -356,25 +326,16 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - ledgerName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, ledgerName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes a Confidential Ledger resource. - * - *

Deletes an existing Confidential Ledger. - * + * + * Deletes an existing Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param context The context to associate with this operation. @@ -384,19 +345,15 @@ private Mono>> deleteWithResponseAsync(String resource * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String ledgerName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String ledgerName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -407,22 +364,15 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - ledgerName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, ledgerName, accept, context); } /** * Deletes a Confidential Ledger resource. - * - *

Deletes an existing Confidential Ledger. - * + * + * Deletes an existing Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -433,17 +383,15 @@ private Mono>> deleteWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String ledgerName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, ledgerName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Deletes a Confidential Ledger resource. - * - *

Deletes an existing Confidential Ledger. - * + * + * Deletes an existing Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param context The context to associate with this operation. @@ -453,20 +401,19 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String ledgerName, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String ledgerName, + Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, ledgerName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Deletes a Confidential Ledger resource. - * - *

Deletes an existing Confidential Ledger. - * + * + * Deletes an existing Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -481,9 +428,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Deletes a Confidential Ledger resource. - * - *

Deletes an existing Confidential Ledger. - * + * + * Deletes an existing Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param context The context to associate with this operation. @@ -493,16 +440,16 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String ledgerName, Context context) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String ledgerName, + Context context) { return this.beginDeleteAsync(resourceGroupName, ledgerName, context).getSyncPoller(); } /** * Deletes a Confidential Ledger resource. - * - *

Deletes an existing Confidential Ledger. - * + * + * Deletes an existing Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -517,9 +464,9 @@ private Mono deleteAsync(String resourceGroupName, String ledgerName) { /** * Deletes a Confidential Ledger resource. - * - *

Deletes an existing Confidential Ledger. - * + * + * Deletes an existing Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param context The context to associate with this operation. @@ -530,16 +477,15 @@ private Mono deleteAsync(String resourceGroupName, String ledgerName) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String ledgerName, Context context) { - return beginDeleteAsync(resourceGroupName, ledgerName, context) - .last() + return beginDeleteAsync(resourceGroupName, ledgerName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes a Confidential Ledger resource. - * - *

Deletes an existing Confidential Ledger. - * + * + * Deletes an existing Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -553,9 +499,9 @@ public void delete(String resourceGroupName, String ledgerName) { /** * Deletes a Confidential Ledger resource. - * - *

Deletes an existing Confidential Ledger. - * + * + * Deletes an existing Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param context The context to associate with this operation. @@ -570,9 +516,9 @@ public void delete(String resourceGroupName, String ledgerName, Context context) /** * Creates a Confidential Ledger. - * - *

Creates a Confidential Ledger with the specified ledger parameters. - * + * + * Creates a Confidential Ledger with the specified ledger parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger Create Request Body. @@ -582,19 +528,15 @@ public void delete(String resourceGroupName, String ledgerName, Context context) * @return confidential Ledger along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger) { + private Mono>> createWithResponseAsync(String resourceGroupName, String ledgerName, + ConfidentialLedgerInner confidentialLedger) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -611,26 +553,16 @@ private Mono>> createWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - ledgerName, - confidentialLedger, - accept, - context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, ledgerName, confidentialLedger, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates a Confidential Ledger. - * - *

Creates a Confidential Ledger with the specified ledger parameters. - * + * + * Creates a Confidential Ledger with the specified ledger parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger Create Request Body. @@ -641,19 +573,15 @@ private Mono>> createWithResponseAsync( * @return confidential Ledger along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger, Context context) { + private Mono>> createWithResponseAsync(String resourceGroupName, String ledgerName, + ConfidentialLedgerInner confidentialLedger, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -670,23 +598,15 @@ private Mono>> createWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - ledgerName, - confidentialLedger, - accept, - context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, ledgerName, confidentialLedger, accept, context); } /** * Creates a Confidential Ledger. - * - *

Creates a Confidential Ledger with the specified ledger parameters. - * + * + * Creates a Confidential Ledger with the specified ledger parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger Create Request Body. @@ -696,25 +616,20 @@ private Mono>> createWithResponseAsync( * @return the {@link PollerFlux} for polling of confidential Ledger. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ConfidentialLedgerInner> beginCreateAsync( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger) { - Mono>> mono = - createWithResponseAsync(resourceGroupName, ledgerName, confidentialLedger); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ConfidentialLedgerInner.class, - ConfidentialLedgerInner.class, - this.client.getContext()); + private PollerFlux, ConfidentialLedgerInner> + beginCreateAsync(String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, ledgerName, confidentialLedger); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ConfidentialLedgerInner.class, ConfidentialLedgerInner.class, + this.client.getContext()); } /** * Creates a Confidential Ledger. - * - *

Creates a Confidential Ledger with the specified ledger parameters. - * + * + * Creates a Confidential Ledger with the specified ledger parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger Create Request Body. @@ -728,23 +643,17 @@ private PollerFlux, ConfidentialLedgerInner> private PollerFlux, ConfidentialLedgerInner> beginCreateAsync( String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createWithResponseAsync(resourceGroupName, ledgerName, confidentialLedger, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ConfidentialLedgerInner.class, - ConfidentialLedgerInner.class, - context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, ledgerName, confidentialLedger, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ConfidentialLedgerInner.class, ConfidentialLedgerInner.class, context); } /** * Creates a Confidential Ledger. - * - *

Creates a Confidential Ledger with the specified ledger parameters. - * + * + * Creates a Confidential Ledger with the specified ledger parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger Create Request Body. @@ -754,16 +663,16 @@ private PollerFlux, ConfidentialLedgerInner> * @return the {@link SyncPoller} for polling of confidential Ledger. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ConfidentialLedgerInner> beginCreate( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger) { + public SyncPoller, ConfidentialLedgerInner> + beginCreate(String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger) { return this.beginCreateAsync(resourceGroupName, ledgerName, confidentialLedger).getSyncPoller(); } /** * Creates a Confidential Ledger. - * - *

Creates a Confidential Ledger with the specified ledger parameters. - * + * + * Creates a Confidential Ledger with the specified ledger parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger Create Request Body. @@ -781,9 +690,9 @@ public SyncPoller, ConfidentialLedgerInner> /** * Creates a Confidential Ledger. - * - *

Creates a Confidential Ledger with the specified ledger parameters. - * + * + * Creates a Confidential Ledger with the specified ledger parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger Create Request Body. @@ -793,18 +702,17 @@ public SyncPoller, ConfidentialLedgerInner> * @return confidential Ledger on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger) { - return beginCreateAsync(resourceGroupName, ledgerName, confidentialLedger) - .last() + private Mono createAsync(String resourceGroupName, String ledgerName, + ConfidentialLedgerInner confidentialLedger) { + return beginCreateAsync(resourceGroupName, ledgerName, confidentialLedger).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates a Confidential Ledger. - * - *

Creates a Confidential Ledger with the specified ledger parameters. - * + * + * Creates a Confidential Ledger with the specified ledger parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger Create Request Body. @@ -815,18 +723,17 @@ private Mono createAsync( * @return confidential Ledger on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger, Context context) { - return beginCreateAsync(resourceGroupName, ledgerName, confidentialLedger, context) - .last() + private Mono createAsync(String resourceGroupName, String ledgerName, + ConfidentialLedgerInner confidentialLedger, Context context) { + return beginCreateAsync(resourceGroupName, ledgerName, confidentialLedger, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates a Confidential Ledger. - * - *

Creates a Confidential Ledger with the specified ledger parameters. - * + * + * Creates a Confidential Ledger with the specified ledger parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger Create Request Body. @@ -836,16 +743,16 @@ private Mono createAsync( * @return confidential Ledger. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ConfidentialLedgerInner create( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger) { + public ConfidentialLedgerInner create(String resourceGroupName, String ledgerName, + ConfidentialLedgerInner confidentialLedger) { return createAsync(resourceGroupName, ledgerName, confidentialLedger).block(); } /** * Creates a Confidential Ledger. - * - *

Creates a Confidential Ledger with the specified ledger parameters. - * + * + * Creates a Confidential Ledger with the specified ledger parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger Create Request Body. @@ -856,16 +763,16 @@ public ConfidentialLedgerInner create( * @return confidential Ledger. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ConfidentialLedgerInner create( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger, Context context) { + public ConfidentialLedgerInner create(String resourceGroupName, String ledgerName, + ConfidentialLedgerInner confidentialLedger, Context context) { return createAsync(resourceGroupName, ledgerName, confidentialLedger, context).block(); } /** * Update Confidential Ledger properties - * - *

Updates properties of Confidential Ledger. - * + * + * Updates properties of Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger request body for Updating Ledger. @@ -875,19 +782,15 @@ public ConfidentialLedgerInner create( * @return confidential Ledger along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String ledgerName, + ConfidentialLedgerInner confidentialLedger) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -904,26 +807,16 @@ private Mono>> updateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - ledgerName, - confidentialLedger, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, ledgerName, confidentialLedger, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update Confidential Ledger properties - * - *

Updates properties of Confidential Ledger. - * + * + * Updates properties of Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger request body for Updating Ledger. @@ -934,19 +827,15 @@ private Mono>> updateWithResponseAsync( * @return confidential Ledger along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger, Context context) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String ledgerName, + ConfidentialLedgerInner confidentialLedger, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -963,23 +852,15 @@ private Mono>> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - ledgerName, - confidentialLedger, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, ledgerName, confidentialLedger, accept, context); } /** * Update Confidential Ledger properties - * - *

Updates properties of Confidential Ledger. - * + * + * Updates properties of Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger request body for Updating Ledger. @@ -989,25 +870,20 @@ private Mono>> updateWithResponseAsync( * @return the {@link PollerFlux} for polling of confidential Ledger. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ConfidentialLedgerInner> beginUpdateAsync( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, ledgerName, confidentialLedger); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ConfidentialLedgerInner.class, - ConfidentialLedgerInner.class, - this.client.getContext()); + private PollerFlux, ConfidentialLedgerInner> + beginUpdateAsync(String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, ledgerName, confidentialLedger); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ConfidentialLedgerInner.class, ConfidentialLedgerInner.class, + this.client.getContext()); } /** * Update Confidential Ledger properties - * - *

Updates properties of Confidential Ledger. - * + * + * Updates properties of Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger request body for Updating Ledger. @@ -1021,23 +897,17 @@ private PollerFlux, ConfidentialLedgerInner> private PollerFlux, ConfidentialLedgerInner> beginUpdateAsync( String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, ledgerName, confidentialLedger, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ConfidentialLedgerInner.class, - ConfidentialLedgerInner.class, - context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, ledgerName, confidentialLedger, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ConfidentialLedgerInner.class, ConfidentialLedgerInner.class, context); } /** * Update Confidential Ledger properties - * - *

Updates properties of Confidential Ledger. - * + * + * Updates properties of Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger request body for Updating Ledger. @@ -1047,16 +917,16 @@ private PollerFlux, ConfidentialLedgerInner> * @return the {@link SyncPoller} for polling of confidential Ledger. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ConfidentialLedgerInner> beginUpdate( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger) { + public SyncPoller, ConfidentialLedgerInner> + beginUpdate(String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger) { return this.beginUpdateAsync(resourceGroupName, ledgerName, confidentialLedger).getSyncPoller(); } /** * Update Confidential Ledger properties - * - *

Updates properties of Confidential Ledger. - * + * + * Updates properties of Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger request body for Updating Ledger. @@ -1074,9 +944,9 @@ public SyncPoller, ConfidentialLedgerInner> /** * Update Confidential Ledger properties - * - *

Updates properties of Confidential Ledger. - * + * + * Updates properties of Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger request body for Updating Ledger. @@ -1086,18 +956,17 @@ public SyncPoller, ConfidentialLedgerInner> * @return confidential Ledger on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger) { - return beginUpdateAsync(resourceGroupName, ledgerName, confidentialLedger) - .last() + private Mono updateAsync(String resourceGroupName, String ledgerName, + ConfidentialLedgerInner confidentialLedger) { + return beginUpdateAsync(resourceGroupName, ledgerName, confidentialLedger).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Update Confidential Ledger properties - * - *

Updates properties of Confidential Ledger. - * + * + * Updates properties of Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger request body for Updating Ledger. @@ -1108,18 +977,17 @@ private Mono updateAsync( * @return confidential Ledger on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger, Context context) { - return beginUpdateAsync(resourceGroupName, ledgerName, confidentialLedger, context) - .last() + private Mono updateAsync(String resourceGroupName, String ledgerName, + ConfidentialLedgerInner confidentialLedger, Context context) { + return beginUpdateAsync(resourceGroupName, ledgerName, confidentialLedger, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Update Confidential Ledger properties - * - *

Updates properties of Confidential Ledger. - * + * + * Updates properties of Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger request body for Updating Ledger. @@ -1129,16 +997,16 @@ private Mono updateAsync( * @return confidential Ledger. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ConfidentialLedgerInner update( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger) { + public ConfidentialLedgerInner update(String resourceGroupName, String ledgerName, + ConfidentialLedgerInner confidentialLedger) { return updateAsync(resourceGroupName, ledgerName, confidentialLedger).block(); } /** * Update Confidential Ledger properties - * - *

Updates properties of Confidential Ledger. - * + * + * Updates properties of Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param confidentialLedger Confidential Ledger request body for Updating Ledger. @@ -1149,38 +1017,34 @@ public ConfidentialLedgerInner update( * @return confidential Ledger. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ConfidentialLedgerInner update( - String resourceGroupName, String ledgerName, ConfidentialLedgerInner confidentialLedger, Context context) { + public ConfidentialLedgerInner update(String resourceGroupName, String ledgerName, + ConfidentialLedgerInner confidentialLedger, Context context) { return updateAsync(resourceGroupName, ledgerName, confidentialLedger, context).block(); } /** * Retrieves information about all Confidential Ledger resources under the given subscription and resource group - * - *

Retrieves the properties of all Confidential Ledgers. - * + * + * Retrieves the properties of all Confidential Ledgers. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Confidential Ledgers and a possible link for next set along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return object that includes an array of Confidential Ledgers and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String filter) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String filter) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1188,57 +1052,37 @@ private Mono> listByResourceGroupSinglePa } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, 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())); } /** * Retrieves information about all Confidential Ledger resources under the given subscription and resource group - * - *

Retrieves the properties of all Confidential Ledgers. - * + * + * Retrieves the properties of all Confidential Ledgers. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Confidential Ledgers and a possible link for next set along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return object that includes an array of Confidential Ledgers and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String filter, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String filter, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1247,70 +1091,55 @@ private Mono> listByResourceGroupSinglePa final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - filter, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Retrieves information about all Confidential Ledger resources under the given subscription and resource group - * - *

Retrieves the properties of all Confidential Ledgers. - * + * + * Retrieves the properties of all Confidential Ledgers. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Confidential Ledgers and a possible link for next set as paginated - * response with {@link PagedFlux}. + * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** * Retrieves information about all Confidential Ledger resources under the given subscription and resource group - * - *

Retrieves the properties of all Confidential Ledgers. - * + * + * Retrieves the properties of all Confidential Ledgers. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 object that includes an array of Confidential Ledgers and a possible link for next set as paginated - * response with {@link PagedFlux}. + * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { final String filter = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** * Retrieves information about all Confidential Ledger resources under the given subscription and resource group - * - *

Retrieves the properties of all Confidential Ledgers. - * + * + * Retrieves the properties of all Confidential Ledgers. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @param context The context to associate with this operation. @@ -1318,27 +1147,26 @@ private PagedFlux listByResourceGroupAsync(String resou * @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 object that includes an array of Confidential Ledgers and a possible link for next set as paginated - * response with {@link PagedFlux}. + * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, String filter, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, context), + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** * Retrieves information about all Confidential Ledger resources under the given subscription and resource group - * - *

Retrieves the properties of all Confidential Ledgers. - * + * + * Retrieves the properties of all Confidential Ledgers. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 object that includes an array of Confidential Ledgers and a possible link for next set as paginated - * response with {@link PagedIterable}. + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -1348,9 +1176,9 @@ public PagedIterable listByResourceGroup(String resourc /** * Retrieves information about all Confidential Ledger resources under the given subscription and resource group - * - *

Retrieves the properties of all Confidential Ledgers. - * + * + * Retrieves the properties of all Confidential Ledgers. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @param context The context to associate with this operation. @@ -1358,176 +1186,140 @@ public PagedIterable listByResourceGroup(String resourc * @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 object that includes an array of Confidential Ledgers and a possible link for next set as paginated - * response with {@link PagedIterable}. + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, String filter, Context context) { + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, + Context context) { return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, context)); } /** * Retrieves information about all Confidential Ledger resources under the given subscription - * - *

Retrieves the properties of all Confidential Ledgers. - * + * + * Retrieves the properties of all Confidential Ledgers. + * * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Confidential Ledgers and a possible link for next set along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return object that includes an array of Confidential Ledgers and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String filter) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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(), - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, 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())); } /** * Retrieves information about all Confidential Ledger resources under the given subscription - * - *

Retrieves the properties of all Confidential Ledgers. - * + * + * Retrieves the properties of all Confidential Ledgers. + * * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Confidential Ledgers and a possible link for next set along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return object that includes an array of Confidential Ledgers and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String filter, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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(), - filter, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), filter, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Retrieves information about all Confidential Ledger resources under the given subscription - * - *

Retrieves the properties of all Confidential Ledgers. - * + * + * Retrieves the properties of all Confidential Ledgers. + * * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Confidential Ledgers and a possible link for next set as paginated - * response with {@link PagedFlux}. + * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(filter), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * Retrieves information about all Confidential Ledger resources under the given subscription - * - *

Retrieves the properties of all Confidential Ledgers. - * + * + * Retrieves the properties of all Confidential Ledgers. + * * @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 object that includes an array of Confidential Ledgers and a possible link for next set as paginated - * response with {@link PagedFlux}. + * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { final String filter = null; - return new PagedFlux<>( - () -> listSinglePageAsync(filter), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(filter), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * Retrieves information about all Confidential Ledger resources under the given subscription - * - *

Retrieves the properties of all Confidential Ledgers. - * + * + * Retrieves the properties of all Confidential Ledgers. + * * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Confidential Ledgers and a possible link for next set as paginated - * response with {@link PagedFlux}. + * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, context), + return new PagedFlux<>(() -> listSinglePageAsync(filter, context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** * Retrieves information about all Confidential Ledger resources under the given subscription - * - *

Retrieves the properties of all Confidential Ledgers. - * + * + * Retrieves the properties of all Confidential Ledgers. + * * @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 object that includes an array of Confidential Ledgers and a possible link for next set as paginated - * response with {@link PagedIterable}. + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -1537,32 +1329,563 @@ public PagedIterable list() { /** * Retrieves information about all Confidential Ledger resources under the given subscription - * - *

Retrieves the properties of all Confidential Ledgers. - * + * + * Retrieves the properties of all Confidential Ledgers. + * * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Confidential Ledgers and a possible link for next set as paginated - * response with {@link PagedIterable}. + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String filter, Context context) { return new PagedIterable<>(listAsync(filter, context)); } + /** + * Performs the backup operation on a Confidential Ledger Resource. + * + * Backs up a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Backup Request Body. + * @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 object representing the backup response of a Confidential Ledger Resource along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> backupWithResponseAsync(String resourceGroupName, String ledgerName, + ConfidentialLedgerBackup confidentialLedger) { + 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.")); + } + if (ledgerName == null) { + return Mono.error(new IllegalArgumentException("Parameter ledgerName is required and cannot be null.")); + } + if (confidentialLedger == null) { + return Mono + .error(new IllegalArgumentException("Parameter confidentialLedger is required and cannot be null.")); + } else { + confidentialLedger.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.backup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, ledgerName, confidentialLedger, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Performs the backup operation on a Confidential Ledger Resource. + * + * Backs up a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Backup Request Body. + * @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 object representing the backup response of a Confidential Ledger Resource along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> backupWithResponseAsync(String resourceGroupName, String ledgerName, + ConfidentialLedgerBackup confidentialLedger, 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.")); + } + if (ledgerName == null) { + return Mono.error(new IllegalArgumentException("Parameter ledgerName is required and cannot be null.")); + } + if (confidentialLedger == null) { + return Mono + .error(new IllegalArgumentException("Parameter confidentialLedger is required and cannot be null.")); + } else { + confidentialLedger.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.backup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, ledgerName, confidentialLedger, accept, context); + } + + /** + * Performs the backup operation on a Confidential Ledger Resource. + * + * Backs up a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Backup Request Body. + * @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 PollerFlux} for polling of object representing the backup response of a Confidential Ledger + * Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfidentialLedgerBackupResponseInner> + beginBackupAsync(String resourceGroupName, String ledgerName, ConfidentialLedgerBackup confidentialLedger) { + Mono>> mono + = backupWithResponseAsync(resourceGroupName, ledgerName, confidentialLedger); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), ConfidentialLedgerBackupResponseInner.class, + ConfidentialLedgerBackupResponseInner.class, this.client.getContext()); + } + + /** + * Performs the backup operation on a Confidential Ledger Resource. + * + * Backs up a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Backup Request Body. + * @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 PollerFlux} for polling of object representing the backup response of a Confidential Ledger + * Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfidentialLedgerBackupResponseInner> + beginBackupAsync(String resourceGroupName, String ledgerName, ConfidentialLedgerBackup confidentialLedger, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = backupWithResponseAsync(resourceGroupName, ledgerName, confidentialLedger, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), ConfidentialLedgerBackupResponseInner.class, + ConfidentialLedgerBackupResponseInner.class, context); + } + + /** + * Performs the backup operation on a Confidential Ledger Resource. + * + * Backs up a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Backup Request Body. + * @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 SyncPoller} for polling of object representing the backup response of a Confidential Ledger + * Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfidentialLedgerBackupResponseInner> + beginBackup(String resourceGroupName, String ledgerName, ConfidentialLedgerBackup confidentialLedger) { + return this.beginBackupAsync(resourceGroupName, ledgerName, confidentialLedger).getSyncPoller(); + } + + /** + * Performs the backup operation on a Confidential Ledger Resource. + * + * Backs up a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Backup Request Body. + * @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 SyncPoller} for polling of object representing the backup response of a Confidential Ledger + * Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfidentialLedgerBackupResponseInner> + beginBackup(String resourceGroupName, String ledgerName, ConfidentialLedgerBackup confidentialLedger, + Context context) { + return this.beginBackupAsync(resourceGroupName, ledgerName, confidentialLedger, context).getSyncPoller(); + } + + /** + * Performs the backup operation on a Confidential Ledger Resource. + * + * Backs up a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Backup Request Body. + * @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 object representing the backup response of a Confidential Ledger Resource on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono backupAsync(String resourceGroupName, String ledgerName, + ConfidentialLedgerBackup confidentialLedger) { + return beginBackupAsync(resourceGroupName, ledgerName, confidentialLedger).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Performs the backup operation on a Confidential Ledger Resource. + * + * Backs up a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Backup Request Body. + * @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 object representing the backup response of a Confidential Ledger Resource on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono backupAsync(String resourceGroupName, String ledgerName, + ConfidentialLedgerBackup confidentialLedger, Context context) { + return beginBackupAsync(resourceGroupName, ledgerName, confidentialLedger, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Performs the backup operation on a Confidential Ledger Resource. + * + * Backs up a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Backup Request Body. + * @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 object representing the backup response of a Confidential Ledger Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfidentialLedgerBackupResponseInner backup(String resourceGroupName, String ledgerName, + ConfidentialLedgerBackup confidentialLedger) { + return backupAsync(resourceGroupName, ledgerName, confidentialLedger).block(); + } + + /** + * Performs the backup operation on a Confidential Ledger Resource. + * + * Backs up a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Backup Request Body. + * @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 object representing the backup response of a Confidential Ledger Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfidentialLedgerBackupResponseInner backup(String resourceGroupName, String ledgerName, + ConfidentialLedgerBackup confidentialLedger, Context context) { + return backupAsync(resourceGroupName, ledgerName, confidentialLedger, context).block(); + } + + /** + * Performs the restore operation to spin up a newly restored Confidential Ledger Resource. + * + * Restores a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Restore Request Body. + * @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 object representing the restore response of a Confidential Ledger Resource along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restoreWithResponseAsync(String resourceGroupName, String ledgerName, + ConfidentialLedgerRestore confidentialLedger) { + 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.")); + } + if (ledgerName == null) { + return Mono.error(new IllegalArgumentException("Parameter ledgerName is required and cannot be null.")); + } + if (confidentialLedger == null) { + return Mono + .error(new IllegalArgumentException("Parameter confidentialLedger is required and cannot be null.")); + } else { + confidentialLedger.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.restore(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, ledgerName, confidentialLedger, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Performs the restore operation to spin up a newly restored Confidential Ledger Resource. + * + * Restores a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Restore Request Body. + * @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 object representing the restore response of a Confidential Ledger Resource along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restoreWithResponseAsync(String resourceGroupName, String ledgerName, + ConfidentialLedgerRestore confidentialLedger, 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.")); + } + if (ledgerName == null) { + return Mono.error(new IllegalArgumentException("Parameter ledgerName is required and cannot be null.")); + } + if (confidentialLedger == null) { + return Mono + .error(new IllegalArgumentException("Parameter confidentialLedger is required and cannot be null.")); + } else { + confidentialLedger.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.restore(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, ledgerName, confidentialLedger, accept, context); + } + + /** + * Performs the restore operation to spin up a newly restored Confidential Ledger Resource. + * + * Restores a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Restore Request Body. + * @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 PollerFlux} for polling of object representing the restore response of a Confidential Ledger + * Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfidentialLedgerRestoreResponseInner> + beginRestoreAsync(String resourceGroupName, String ledgerName, ConfidentialLedgerRestore confidentialLedger) { + Mono>> mono + = restoreWithResponseAsync(resourceGroupName, ledgerName, confidentialLedger); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), ConfidentialLedgerRestoreResponseInner.class, + ConfidentialLedgerRestoreResponseInner.class, this.client.getContext()); + } + + /** + * Performs the restore operation to spin up a newly restored Confidential Ledger Resource. + * + * Restores a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Restore Request Body. + * @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 PollerFlux} for polling of object representing the restore response of a Confidential Ledger + * Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfidentialLedgerRestoreResponseInner> + beginRestoreAsync(String resourceGroupName, String ledgerName, ConfidentialLedgerRestore confidentialLedger, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = restoreWithResponseAsync(resourceGroupName, ledgerName, confidentialLedger, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), ConfidentialLedgerRestoreResponseInner.class, + ConfidentialLedgerRestoreResponseInner.class, context); + } + + /** + * Performs the restore operation to spin up a newly restored Confidential Ledger Resource. + * + * Restores a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Restore Request Body. + * @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 SyncPoller} for polling of object representing the restore response of a Confidential Ledger + * Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfidentialLedgerRestoreResponseInner> + beginRestore(String resourceGroupName, String ledgerName, ConfidentialLedgerRestore confidentialLedger) { + return this.beginRestoreAsync(resourceGroupName, ledgerName, confidentialLedger).getSyncPoller(); + } + + /** + * Performs the restore operation to spin up a newly restored Confidential Ledger Resource. + * + * Restores a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Restore Request Body. + * @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 SyncPoller} for polling of object representing the restore response of a Confidential Ledger + * Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfidentialLedgerRestoreResponseInner> + beginRestore(String resourceGroupName, String ledgerName, ConfidentialLedgerRestore confidentialLedger, + Context context) { + return this.beginRestoreAsync(resourceGroupName, ledgerName, confidentialLedger, context).getSyncPoller(); + } + + /** + * Performs the restore operation to spin up a newly restored Confidential Ledger Resource. + * + * Restores a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Restore Request Body. + * @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 object representing the restore response of a Confidential Ledger Resource on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restoreAsync(String resourceGroupName, String ledgerName, + ConfidentialLedgerRestore confidentialLedger) { + return beginRestoreAsync(resourceGroupName, ledgerName, confidentialLedger).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Performs the restore operation to spin up a newly restored Confidential Ledger Resource. + * + * Restores a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Restore Request Body. + * @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 object representing the restore response of a Confidential Ledger Resource on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restoreAsync(String resourceGroupName, String ledgerName, + ConfidentialLedgerRestore confidentialLedger, Context context) { + return beginRestoreAsync(resourceGroupName, ledgerName, confidentialLedger, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Performs the restore operation to spin up a newly restored Confidential Ledger Resource. + * + * Restores a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Restore Request Body. + * @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 object representing the restore response of a Confidential Ledger Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfidentialLedgerRestoreResponseInner restore(String resourceGroupName, String ledgerName, + ConfidentialLedgerRestore confidentialLedger) { + return restoreAsync(resourceGroupName, ledgerName, confidentialLedger).block(); + } + + /** + * Performs the restore operation to spin up a newly restored Confidential Ledger Resource. + * + * Restores a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Restore Request Body. + * @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 object representing the restore response of a Confidential Ledger Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfidentialLedgerRestoreResponseInner restore(String resourceGroupName, String ledgerName, + ConfidentialLedgerRestore confidentialLedger, Context context) { + return restoreAsync(resourceGroupName, ledgerName, confidentialLedger, context).block(); + } + /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 object that includes an array of Confidential Ledgers and a possible link for next set along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return object that includes an array of Confidential Ledgers and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1570,76 +1893,59 @@ private Mono> listByResourceGroupNextSing 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.")); + 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.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>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 URL to get the next list of items - *

The nextLink parameter. + * + * 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 object that includes an array of Confidential Ledgers and a possible link for next set along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return object that includes an array of Confidential Ledgers and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync(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.")); + 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 - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceGroupNext(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 URL to get the next list of items - *

The nextLink parameter. + * + * 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 object that includes an array of Confidential Ledgers and a possible link for next set along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return object that includes an array of Confidential Ledgers and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -1647,63 +1953,45 @@ private Mono> listBySubscriptionNextSingl 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.")); + 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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>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 URL to get the next list of items - *

The nextLink parameter. + * + * 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 object that includes an array of Confidential Ledgers and a possible link for next set along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return object that includes an array of Confidential Ledgers and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listBySubscriptionNextSinglePageAsync(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.")); + 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 - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listBySubscriptionNext(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/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/LedgersImpl.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/LedgersImpl.java index 4ffb92e1c52f..1ccd164b8026 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/LedgersImpl.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/LedgersImpl.java @@ -10,8 +10,14 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.confidentialledger.fluent.LedgersClient; +import com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerBackupResponseInner; import com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerInner; +import com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerRestoreResponseInner; import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedger; +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerBackup; +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerBackupResponse; +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerRestore; +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerRestoreResponse; import com.azure.resourcemanager.confidentialledger.models.Ledgers; public final class LedgersImpl implements Ledgers { @@ -21,22 +27,18 @@ public final class LedgersImpl implements Ledgers { private final com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager; - public LedgersImpl( - LedgersClient innerClient, + public LedgersImpl(LedgersClient innerClient, com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getByResourceGroupWithResponse( - String resourceGroupName, String ledgerName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, ledgerName, context); + public Response getByResourceGroupWithResponse(String resourceGroupName, String ledgerName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, ledgerName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ConfidentialLedgerImpl(inner.getValue(), this.manager())); } else { return null; @@ -62,98 +64,122 @@ public void delete(String resourceGroupName, String ledgerName, Context context) public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new ConfidentialLedgerImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfidentialLedgerImpl(inner1, this.manager())); } - public PagedIterable listByResourceGroup( - String resourceGroupName, String filter, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, filter, context); - return Utils.mapPage(inner, inner1 -> new ConfidentialLedgerImpl(inner1, this.manager())); + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfidentialLedgerImpl(inner1, this.manager())); } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ConfidentialLedgerImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfidentialLedgerImpl(inner1, this.manager())); } public PagedIterable list(String filter, Context context) { PagedIterable inner = this.serviceClient().list(filter, context); - return Utils.mapPage(inner, inner1 -> new ConfidentialLedgerImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfidentialLedgerImpl(inner1, this.manager())); + } + + public ConfidentialLedgerBackupResponse backup(String resourceGroupName, String ledgerName, + ConfidentialLedgerBackup confidentialLedger) { + ConfidentialLedgerBackupResponseInner inner + = this.serviceClient().backup(resourceGroupName, ledgerName, confidentialLedger); + if (inner != null) { + return new ConfidentialLedgerBackupResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConfidentialLedgerBackupResponse backup(String resourceGroupName, String ledgerName, + ConfidentialLedgerBackup confidentialLedger, Context context) { + ConfidentialLedgerBackupResponseInner inner + = this.serviceClient().backup(resourceGroupName, ledgerName, confidentialLedger, context); + if (inner != null) { + return new ConfidentialLedgerBackupResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConfidentialLedgerRestoreResponse restore(String resourceGroupName, String ledgerName, + ConfidentialLedgerRestore confidentialLedger) { + ConfidentialLedgerRestoreResponseInner inner + = this.serviceClient().restore(resourceGroupName, ledgerName, confidentialLedger); + if (inner != null) { + return new ConfidentialLedgerRestoreResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConfidentialLedgerRestoreResponse restore(String resourceGroupName, String ledgerName, + ConfidentialLedgerRestore confidentialLedger, Context context) { + ConfidentialLedgerRestoreResponseInner inner + = this.serviceClient().restore(resourceGroupName, ledgerName, confidentialLedger, context); + if (inner != null) { + return new ConfidentialLedgerRestoreResponseImpl(inner, this.manager()); + } else { + return null; + } } public ConfidentialLedger getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String ledgerName = Utils.getValueFromIdByName(id, "ledgers"); + String ledgerName = ResourceManagerUtils.getValueFromIdByName(id, "ledgers"); if (ledgerName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'ledgers'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ledgers'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, ledgerName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String ledgerName = Utils.getValueFromIdByName(id, "ledgers"); + String ledgerName = ResourceManagerUtils.getValueFromIdByName(id, "ledgers"); if (ledgerName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'ledgers'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ledgers'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, ledgerName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String ledgerName = Utils.getValueFromIdByName(id, "ledgers"); + String ledgerName = ResourceManagerUtils.getValueFromIdByName(id, "ledgers"); if (ledgerName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'ledgers'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ledgers'.", id))); } this.delete(resourceGroupName, ledgerName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String ledgerName = Utils.getValueFromIdByName(id, "ledgers"); + String ledgerName = ResourceManagerUtils.getValueFromIdByName(id, "ledgers"); if (ledgerName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'ledgers'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ledgers'.", id))); } this.delete(resourceGroupName, ledgerName, context); } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ManagedCcfBackupResponseImpl.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ManagedCcfBackupResponseImpl.java new file mode 100644 index 000000000000..813496a8e0a3 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ManagedCcfBackupResponseImpl.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.confidentialledger.implementation; + +import com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfBackupResponseInner; +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfBackupResponse; + +public final class ManagedCcfBackupResponseImpl implements ManagedCcfBackupResponse { + private ManagedCcfBackupResponseInner innerObject; + + private final com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager; + + ManagedCcfBackupResponseImpl(ManagedCcfBackupResponseInner innerObject, + com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String message() { + return this.innerModel().message(); + } + + public ManagedCcfBackupResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ManagedCcfImpl.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ManagedCcfImpl.java index 987741587a8e..59312c523ab6 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ManagedCcfImpl.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ManagedCcfImpl.java @@ -9,22 +9,19 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfInner; import com.azure.resourcemanager.confidentialledger.models.ManagedCcf; +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfBackup; +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfBackupResponse; import com.azure.resourcemanager.confidentialledger.models.ManagedCcfProperties; +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfRestore; +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfRestoreResponse; import java.util.Collections; import java.util.Map; -public final class ManagedCcfImpl implements ManagedCcf, ManagedCcf.Definition { +public final class ManagedCcfImpl implements ManagedCcf, ManagedCcf.Definition, ManagedCcf.Update { private ManagedCcfInner innerObject; private final com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager; - ManagedCcfImpl( - ManagedCcfInner innerObject, - com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - public String id() { return this.innerModel().id(); } @@ -66,6 +63,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public ManagedCcfInner innerModel() { return this.innerObject; } @@ -84,20 +85,16 @@ public ManagedCcfImpl withExistingResourceGroup(String resourceGroupName) { } public ManagedCcf create() { - this.innerObject = - serviceManager - .serviceClient() - .getManagedCcfs() - .create(resourceGroupName, appName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getManagedCcfs() + .create(resourceGroupName, appName, this.innerModel(), Context.NONE); return this; } public ManagedCcf create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getManagedCcfs() - .create(resourceGroupName, appName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getManagedCcfs() + .create(resourceGroupName, appName, this.innerModel(), context); return this; } @@ -107,26 +104,64 @@ public ManagedCcf create(Context context) { this.appName = name; } + public ManagedCcfImpl update() { + return this; + } + + public ManagedCcf apply() { + this.innerObject = serviceManager.serviceClient() + .getManagedCcfs() + .update(resourceGroupName, appName, this.innerModel(), Context.NONE); + return this; + } + + public ManagedCcf apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManagedCcfs() + .update(resourceGroupName, appName, this.innerModel(), context); + return this; + } + + ManagedCcfImpl(ManagedCcfInner innerObject, + com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.appName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "managedCCFs"); + } + public ManagedCcf refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getManagedCcfs() - .getByResourceGroupWithResponse(resourceGroupName, appName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getManagedCcfs() + .getByResourceGroupWithResponse(resourceGroupName, appName, Context.NONE) + .getValue(); return this; } public ManagedCcf refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getManagedCcfs() - .getByResourceGroupWithResponse(resourceGroupName, appName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getManagedCcfs() + .getByResourceGroupWithResponse(resourceGroupName, appName, context) + .getValue(); return this; } + public ManagedCcfBackupResponse backup(ManagedCcfBackup managedCcf) { + return serviceManager.managedCcfs().backup(resourceGroupName, appName, managedCcf); + } + + public ManagedCcfBackupResponse backup(ManagedCcfBackup managedCcf, Context context) { + return serviceManager.managedCcfs().backup(resourceGroupName, appName, managedCcf, context); + } + + public ManagedCcfRestoreResponse restore(ManagedCcfRestore managedCcf) { + return serviceManager.managedCcfs().restore(resourceGroupName, appName, managedCcf); + } + + public ManagedCcfRestoreResponse restore(ManagedCcfRestore managedCcf, Context context) { + return serviceManager.managedCcfs().restore(resourceGroupName, appName, managedCcf, context); + } + public ManagedCcfImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ManagedCcfRestoreResponseImpl.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ManagedCcfRestoreResponseImpl.java new file mode 100644 index 000000000000..8414175f7591 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ManagedCcfRestoreResponseImpl.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.confidentialledger.implementation; + +import com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfRestoreResponseInner; +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfRestoreResponse; + +public final class ManagedCcfRestoreResponseImpl implements ManagedCcfRestoreResponse { + private ManagedCcfRestoreResponseInner innerObject; + + private final com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager; + + ManagedCcfRestoreResponseImpl(ManagedCcfRestoreResponseInner innerObject, + com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String message() { + return this.innerModel().message(); + } + + public ManagedCcfRestoreResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ManagedCcfsClientImpl.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ManagedCcfsClientImpl.java index be87a185b2db..b31e6301b63c 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ManagedCcfsClientImpl.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ManagedCcfsClientImpl.java @@ -14,6 +14,7 @@ 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; @@ -33,28 +34,38 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.confidentialledger.fluent.ManagedCcfsClient; +import com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfBackupResponseInner; import com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfInner; +import com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfRestoreResponseInner; +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfBackup; import com.azure.resourcemanager.confidentialledger.models.ManagedCcfList; +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfRestore; 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 ManagedCcfsClient. */ +/** + * An instance of this class provides access to all the operations defined in ManagedCcfsClient. + */ public final class ManagedCcfsClientImpl implements ManagedCcfsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ManagedCcfsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ConfidentialLedgerManagementClientImpl client; /** * Initializes an instance of ManagedCcfsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ManagedCcfsClientImpl(ConfidentialLedgerManagementClientImpl client) { - this.service = - RestProxy.create(ManagedCcfsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(ManagedCcfsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -65,116 +76,103 @@ public final class ManagedCcfsClientImpl implements ManagedCcfsClient { @Host("{$host}") @ServiceInterface(name = "ConfidentialLedgerMa") public interface ManagedCcfsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs/{appName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs/{appName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("appName") String appName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs/{appName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("appName") String appName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs/{appName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("appName") String appName, - @HeaderParam("Accept") String accept, + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("appName") String appName, + @BodyParam("application/json") ManagedCcfInner managedCcf, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs/{appName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs/{appName}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("appName") String appName, - @HeaderParam("Accept") String accept, + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("appName") String appName, + @BodyParam("application/json") ManagedCcfInner managedCcf, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs/{appName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("appName") String appName, - @BodyParam("application/json") ManagedCcfInner managedCcf, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs/{appName}") - @ExpectedResponses({200, 202}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ConfidentialLedger/managedCCFs/") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("appName") String appName, - @BodyParam("application/json") ManagedCcfInner managedCcf, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs/{appName}/backup") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, + Mono>> backup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("appName") String appName, + @BodyParam("application/json") ManagedCcfBackup managedCcf, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ConfidentialLedger/managedCCFs/") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs/{appName}/restore") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, + Mono>> restore(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("appName") String appName, + @BodyParam("application/json") ManagedCcfRestore managedCcf, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Retrieves information about a Managed CCF resource. - * - *

Retrieves the properties of a Managed CCF app. - * + * + * Retrieves the properties of a Managed CCF app. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -183,19 +181,15 @@ Mono> listBySubscriptionNext( * @return managed CCF along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String appName) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String appName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -206,25 +200,16 @@ private Mono> getByResourceGroupWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - appName, - accept, - context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Retrieves information about a Managed CCF resource. - * - *

Retrieves the properties of a Managed CCF app. - * + * + * Retrieves the properties of a Managed CCF app. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param context The context to associate with this operation. @@ -234,19 +219,15 @@ private Mono> getByResourceGroupWithResponseAsync( * @return managed CCF along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String appName, Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String appName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -257,22 +238,15 @@ private Mono> getByResourceGroupWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - appName, - accept, - context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appName, accept, context); } /** * Retrieves information about a Managed CCF resource. - * - *

Retrieves the properties of a Managed CCF app. - * + * + * Retrieves the properties of a Managed CCF app. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -288,9 +262,9 @@ private Mono getByResourceGroupAsync(String resourceGroupName, /** * Retrieves information about a Managed CCF resource. - * - *

Retrieves the properties of a Managed CCF app. - * + * + * Retrieves the properties of a Managed CCF app. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param context The context to associate with this operation. @@ -300,16 +274,16 @@ private Mono getByResourceGroupAsync(String resourceGroupName, * @return managed CCF along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String appName, Context context) { + public Response getByResourceGroupWithResponse(String resourceGroupName, String appName, + Context context) { return getByResourceGroupWithResponseAsync(resourceGroupName, appName, context).block(); } /** * Retrieves information about a Managed CCF resource. - * - *

Retrieves the properties of a Managed CCF app. - * + * + * Retrieves the properties of a Managed CCF app. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -324,9 +298,9 @@ public ManagedCcfInner getByResourceGroup(String resourceGroupName, String appNa /** * Deletes a Managed CCF resource. - * - *

Deletes an existing Managed CCF. - * + * + * Deletes an existing Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -337,16 +311,12 @@ public ManagedCcfInner getByResourceGroup(String resourceGroupName, String appNa @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String appName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -357,25 +327,16 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - appName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes a Managed CCF resource. - * - *

Deletes an existing Managed CCF. - * + * + * Deletes an existing Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param context The context to associate with this operation. @@ -385,19 +346,15 @@ private Mono>> deleteWithResponseAsync(String resource * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String appName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String appName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -408,22 +365,15 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - appName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, appName, accept, context); } /** * Deletes a Managed CCF resource. - * - *

Deletes an existing Managed CCF. - * + * + * Deletes an existing Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -434,17 +384,15 @@ private Mono>> deleteWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String appName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, appName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Deletes a Managed CCF resource. - * - *

Deletes an existing Managed CCF. - * + * + * Deletes an existing Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param context The context to associate with this operation. @@ -454,20 +402,19 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String appName, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String appName, + Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, appName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Deletes a Managed CCF resource. - * - *

Deletes an existing Managed CCF. - * + * + * Deletes an existing Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -482,9 +429,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Deletes a Managed CCF resource. - * - *

Deletes an existing Managed CCF. - * + * + * Deletes an existing Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param context The context to associate with this operation. @@ -500,9 +447,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Deletes a Managed CCF resource. - * - *

Deletes an existing Managed CCF. - * + * + * Deletes an existing Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -517,9 +464,9 @@ private Mono deleteAsync(String resourceGroupName, String appName) { /** * Deletes a Managed CCF resource. - * - *

Deletes an existing Managed CCF. - * + * + * Deletes an existing Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param context The context to associate with this operation. @@ -530,16 +477,15 @@ private Mono deleteAsync(String resourceGroupName, String appName) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String appName, Context context) { - return beginDeleteAsync(resourceGroupName, appName, context) - .last() + return beginDeleteAsync(resourceGroupName, appName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes a Managed CCF resource. - * - *

Deletes an existing Managed CCF. - * + * + * Deletes an existing Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -553,9 +499,9 @@ public void delete(String resourceGroupName, String appName) { /** * Deletes a Managed CCF resource. - * - *

Deletes an existing Managed CCF. - * + * + * Deletes an existing Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param context The context to associate with this operation. @@ -570,9 +516,9 @@ public void delete(String resourceGroupName, String appName, Context context) { /** * Creates a Managed CCF. - * - *

Creates a Managed CCF with the specified Managed CCF parameters. - * + * + * Creates a Managed CCF with the specified Managed CCF parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. @@ -582,19 +528,15 @@ public void delete(String resourceGroupName, String appName, Context context) { * @return managed CCF along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, String appName, ManagedCcfInner managedCcf) { + private Mono>> createWithResponseAsync(String resourceGroupName, String appName, + ManagedCcfInner managedCcf) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -610,26 +552,16 @@ private Mono>> createWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - appName, - managedCcf, - accept, - context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appName, managedCcf, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates a Managed CCF. - * - *

Creates a Managed CCF with the specified Managed CCF parameters. - * + * + * Creates a Managed CCF with the specified Managed CCF parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. @@ -640,19 +572,15 @@ private Mono>> createWithResponseAsync( * @return managed CCF along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context) { + private Mono>> createWithResponseAsync(String resourceGroupName, String appName, + ManagedCcfInner managedCcf, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -668,23 +596,15 @@ private Mono>> createWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - appName, - managedCcf, - accept, - context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, appName, managedCcf, accept, context); } /** * Creates a Managed CCF. - * - *

Creates a Managed CCF with the specified Managed CCF parameters. - * + * + * Creates a Managed CCF with the specified Managed CCF parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. @@ -694,24 +614,18 @@ private Mono>> createWithResponseAsync( * @return the {@link PollerFlux} for polling of managed CCF. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ManagedCcfInner> beginCreateAsync( - String resourceGroupName, String appName, ManagedCcfInner managedCcf) { + private PollerFlux, ManagedCcfInner> beginCreateAsync(String resourceGroupName, + String appName, ManagedCcfInner managedCcf) { Mono>> mono = createWithResponseAsync(resourceGroupName, appName, managedCcf); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ManagedCcfInner.class, - ManagedCcfInner.class, - this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ManagedCcfInner.class, ManagedCcfInner.class, this.client.getContext()); } /** * Creates a Managed CCF. - * - *

Creates a Managed CCF with the specified Managed CCF parameters. - * + * + * Creates a Managed CCF with the specified Managed CCF parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. @@ -722,22 +636,20 @@ private PollerFlux, ManagedCcfInner> beginCreateAsyn * @return the {@link PollerFlux} for polling of managed CCF. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ManagedCcfInner> beginCreateAsync( - String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context) { + private PollerFlux, ManagedCcfInner> beginCreateAsync(String resourceGroupName, + String appName, ManagedCcfInner managedCcf, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createWithResponseAsync(resourceGroupName, appName, managedCcf, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ManagedCcfInner.class, ManagedCcfInner.class, context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, appName, managedCcf, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ManagedCcfInner.class, ManagedCcfInner.class, context); } /** * Creates a Managed CCF. - * - *

Creates a Managed CCF with the specified Managed CCF parameters. - * + * + * Creates a Managed CCF with the specified Managed CCF parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. @@ -747,16 +659,16 @@ private PollerFlux, ManagedCcfInner> beginCreateAsyn * @return the {@link SyncPoller} for polling of managed CCF. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ManagedCcfInner> beginCreate( - String resourceGroupName, String appName, ManagedCcfInner managedCcf) { + public SyncPoller, ManagedCcfInner> beginCreate(String resourceGroupName, + String appName, ManagedCcfInner managedCcf) { return this.beginCreateAsync(resourceGroupName, appName, managedCcf).getSyncPoller(); } /** * Creates a Managed CCF. - * - *

Creates a Managed CCF with the specified Managed CCF parameters. - * + * + * Creates a Managed CCF with the specified Managed CCF parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. @@ -767,16 +679,16 @@ public SyncPoller, ManagedCcfInner> beginCreate( * @return the {@link SyncPoller} for polling of managed CCF. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ManagedCcfInner> beginCreate( - String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context) { + public SyncPoller, ManagedCcfInner> beginCreate(String resourceGroupName, + String appName, ManagedCcfInner managedCcf, Context context) { return this.beginCreateAsync(resourceGroupName, appName, managedCcf, context).getSyncPoller(); } /** * Creates a Managed CCF. - * - *

Creates a Managed CCF with the specified Managed CCF parameters. - * + * + * Creates a Managed CCF with the specified Managed CCF parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. @@ -787,16 +699,15 @@ public SyncPoller, ManagedCcfInner> beginCreate( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync(String resourceGroupName, String appName, ManagedCcfInner managedCcf) { - return beginCreateAsync(resourceGroupName, appName, managedCcf) - .last() + return beginCreateAsync(resourceGroupName, appName, managedCcf).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates a Managed CCF. - * - *

Creates a Managed CCF with the specified Managed CCF parameters. - * + * + * Creates a Managed CCF with the specified Managed CCF parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. @@ -807,18 +718,17 @@ private Mono createAsync(String resourceGroupName, String appNa * @return managed CCF on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context) { - return beginCreateAsync(resourceGroupName, appName, managedCcf, context) - .last() + private Mono createAsync(String resourceGroupName, String appName, ManagedCcfInner managedCcf, + Context context) { + return beginCreateAsync(resourceGroupName, appName, managedCcf, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates a Managed CCF. - * - *

Creates a Managed CCF with the specified Managed CCF parameters. - * + * + * Creates a Managed CCF with the specified Managed CCF parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. @@ -834,9 +744,9 @@ public ManagedCcfInner create(String resourceGroupName, String appName, ManagedC /** * Creates a Managed CCF. - * - *

Creates a Managed CCF with the specified Managed CCF parameters. - * + * + * Creates a Managed CCF with the specified Managed CCF parameters. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. @@ -847,38 +757,34 @@ public ManagedCcfInner create(String resourceGroupName, String appName, ManagedC * @return managed CCF. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedCcfInner create( - String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context) { + public ManagedCcfInner create(String resourceGroupName, String appName, ManagedCcfInner managedCcf, + Context context) { return createAsync(resourceGroupName, appName, managedCcf, context).block(); } /** * Update Managed CCF properties - * - *

Updates properties of Managed CCF. - * + * + * Updates properties of Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. * @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}. + * @return managed CCF along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String appName, ManagedCcfInner managedCcf) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String appName, + ManagedCcfInner managedCcf) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -894,26 +800,16 @@ private Mono>> updateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - appName, - managedCcf, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appName, managedCcf, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update Managed CCF properties - * - *

Updates properties of Managed CCF. - * + * + * Updates properties of Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. @@ -921,22 +817,18 @@ private Mono>> updateWithResponseAsync( * @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}. + * @return managed CCF along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String appName, + ManagedCcfInner managedCcf, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -952,46 +844,36 @@ private Mono>> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - appName, - managedCcf, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, appName, managedCcf, accept, context); } /** * Update Managed CCF properties - * - *

Updates properties of Managed CCF. - * + * + * Updates properties of Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. * @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 PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of managed CCF. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginUpdateAsync( - String resourceGroupName, String appName, ManagedCcfInner managedCcf) { + private PollerFlux, ManagedCcfInner> beginUpdateAsync(String resourceGroupName, + String appName, ManagedCcfInner managedCcf) { Mono>> mono = updateWithResponseAsync(resourceGroupName, appName, managedCcf); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ManagedCcfInner.class, ManagedCcfInner.class, this.client.getContext()); } /** * Update Managed CCF properties - * - *

Updates properties of Managed CCF. - * + * + * Updates properties of Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. @@ -999,43 +881,42 @@ private PollerFlux, Void> beginUpdateAsync( * @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 PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of managed CCF. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginUpdateAsync( - String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context) { + private PollerFlux, ManagedCcfInner> beginUpdateAsync(String resourceGroupName, + String appName, ManagedCcfInner managedCcf, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, appName, managedCcf, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, appName, managedCcf, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ManagedCcfInner.class, ManagedCcfInner.class, context); } /** * Update Managed CCF properties - * - *

Updates properties of Managed CCF. - * + * + * Updates properties of Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. * @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 SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of managed CCF. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginUpdate( - String resourceGroupName, String appName, ManagedCcfInner managedCcf) { + public SyncPoller, ManagedCcfInner> beginUpdate(String resourceGroupName, + String appName, ManagedCcfInner managedCcf) { return this.beginUpdateAsync(resourceGroupName, appName, managedCcf).getSyncPoller(); } /** * Update Managed CCF properties - * - *

Updates properties of Managed CCF. - * + * + * Updates properties of Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. @@ -1043,39 +924,38 @@ public SyncPoller, Void> beginUpdate( * @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 SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of managed CCF. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginUpdate( - String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context) { + public SyncPoller, ManagedCcfInner> beginUpdate(String resourceGroupName, + String appName, ManagedCcfInner managedCcf, Context context) { return this.beginUpdateAsync(resourceGroupName, appName, managedCcf, context).getSyncPoller(); } /** * Update Managed CCF properties - * - *

Updates properties of Managed CCF. - * + * + * Updates properties of Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. * @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. + * @return managed CCF on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String appName, ManagedCcfInner managedCcf) { - return beginUpdateAsync(resourceGroupName, appName, managedCcf) - .last() + private Mono updateAsync(String resourceGroupName, String appName, ManagedCcfInner managedCcf) { + return beginUpdateAsync(resourceGroupName, appName, managedCcf).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Update Managed CCF properties - * - *

Updates properties of Managed CCF. - * + * + * Updates properties of Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. @@ -1083,38 +963,38 @@ private Mono updateAsync(String resourceGroupName, String appName, Managed * @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. + * @return managed CCF on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context) { - return beginUpdateAsync(resourceGroupName, appName, managedCcf, context) - .last() + private Mono updateAsync(String resourceGroupName, String appName, ManagedCcfInner managedCcf, + Context context) { + return beginUpdateAsync(resourceGroupName, appName, managedCcf, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Update Managed CCF properties - * - *

Updates properties of Managed CCF. - * + * + * Updates properties of Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. * @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 managed CCF. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void update(String resourceGroupName, String appName, ManagedCcfInner managedCcf) { - updateAsync(resourceGroupName, appName, managedCcf).block(); + public ManagedCcfInner update(String resourceGroupName, String appName, ManagedCcfInner managedCcf) { + return updateAsync(resourceGroupName, appName, managedCcf).block(); } /** * Update Managed CCF properties - * - *

Updates properties of Managed CCF. - * + * + * Updates properties of Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. @@ -1122,39 +1002,37 @@ public void update(String resourceGroupName, String appName, ManagedCcfInner man * @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 managed CCF. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void update(String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context) { - updateAsync(resourceGroupName, appName, managedCcf, context).block(); + public ManagedCcfInner update(String resourceGroupName, String appName, ManagedCcfInner managedCcf, + Context context) { + return updateAsync(resourceGroupName, appName, managedCcf, context).block(); } /** * Retrieves information about all Managed CCF resources under the given subscription and resource group - * - *

Retrieves the properties of all Managed CCF apps. - * + * + * Retrieves the properties of all Managed CCF apps. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Managed CCF and a possible link for next set along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return object that includes an array of Managed CCF and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String filter) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String filter) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1162,57 +1040,37 @@ private Mono> listByResourceGroupSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, 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())); } /** * Retrieves information about all Managed CCF resources under the given subscription and resource group - * - *

Retrieves the properties of all Managed CCF apps. - * + * + * Retrieves the properties of all Managed CCF apps. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Managed CCF and a possible link for next set along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return object that includes an array of Managed CCF and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String filter, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String filter, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1221,70 +1079,55 @@ private Mono> listByResourceGroupSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - filter, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Retrieves information about all Managed CCF resources under the given subscription and resource group - * - *

Retrieves the properties of all Managed CCF apps. - * + * + * Retrieves the properties of all Managed CCF apps. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with - * {@link PagedFlux}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** * Retrieves information about all Managed CCF resources under the given subscription and resource group - * - *

Retrieves the properties of all Managed CCF apps. - * + * + * Retrieves the properties of all Managed CCF apps. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with - * {@link PagedFlux}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { final String filter = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** * Retrieves information about all Managed CCF resources under the given subscription and resource group - * - *

Retrieves the properties of all Managed CCF apps. - * + * + * Retrieves the properties of all Managed CCF apps. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @param context The context to associate with this operation. @@ -1292,27 +1135,26 @@ private PagedFlux listByResourceGroupAsync(String resourceGroup * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with - * {@link PagedFlux}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, String filter, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, context), + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** * Retrieves information about all Managed CCF resources under the given subscription and resource group - * - *

Retrieves the properties of all Managed CCF apps. - * + * + * Retrieves the properties of all Managed CCF apps. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -1322,9 +1164,9 @@ public PagedIterable listByResourceGroup(String resourceGroupNa /** * Retrieves information about all Managed CCF resources under the given subscription and resource group - * - *

Retrieves the properties of all Managed CCF apps. - * + * + * Retrieves the properties of all Managed CCF apps. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @param context The context to associate with this operation. @@ -1332,176 +1174,140 @@ public PagedIterable listByResourceGroup(String resourceGroupNa * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, String filter, Context context) { + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, + Context context) { return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, context)); } /** * Retrieves information about all Managed CCF resources under the given subscription - * - *

Retrieves the properties of all Managed CCF. - * + * + * Retrieves the properties of all Managed CCF. + * * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Managed CCF and a possible link for next set along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return object that includes an array of Managed CCF and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String filter) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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(), - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, 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())); } /** * Retrieves information about all Managed CCF resources under the given subscription - * - *

Retrieves the properties of all Managed CCF. - * + * + * Retrieves the properties of all Managed CCF. + * * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Managed CCF and a possible link for next set along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return object that includes an array of Managed CCF and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String filter, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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(), - filter, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), filter, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Retrieves information about all Managed CCF resources under the given subscription - * - *

Retrieves the properties of all Managed CCF. - * + * + * Retrieves the properties of all Managed CCF. + * * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with - * {@link PagedFlux}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(filter), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * Retrieves information about all Managed CCF resources under the given subscription - * - *

Retrieves the properties of all Managed CCF. - * + * + * Retrieves the properties of all Managed CCF. + * * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with - * {@link PagedFlux}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { final String filter = null; - return new PagedFlux<>( - () -> listSinglePageAsync(filter), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(filter), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * Retrieves information about all Managed CCF resources under the given subscription - * - *

Retrieves the properties of all Managed CCF. - * + * + * Retrieves the properties of all Managed CCF. + * * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with - * {@link PagedFlux}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, context), + return new PagedFlux<>(() -> listSinglePageAsync(filter, context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** * Retrieves information about all Managed CCF resources under the given subscription - * - *

Retrieves the properties of all Managed CCF. - * + * + * Retrieves the properties of all Managed CCF. + * * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -1511,32 +1317,544 @@ public PagedIterable list() { /** * Retrieves information about all Managed CCF resources under the given subscription - * - *

Retrieves the properties of all Managed CCF. - * + * + * Retrieves the properties of all Managed CCF. + * * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String filter, Context context) { return new PagedIterable<>(listAsync(filter, context)); } + /** + * Performs the backup operation on a Managed CCF Resource. + * + * Backs up a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Backup Request Body. + * @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 object representing the backup response of a Managed CCF Resource along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> backupWithResponseAsync(String resourceGroupName, String appName, + ManagedCcfBackup managedCcf) { + 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.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (managedCcf == null) { + return Mono.error(new IllegalArgumentException("Parameter managedCcf is required and cannot be null.")); + } else { + managedCcf.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.backup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appName, managedCcf, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Performs the backup operation on a Managed CCF Resource. + * + * Backs up a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Backup Request Body. + * @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 object representing the backup response of a Managed CCF Resource along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> backupWithResponseAsync(String resourceGroupName, String appName, + ManagedCcfBackup managedCcf, 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.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (managedCcf == null) { + return Mono.error(new IllegalArgumentException("Parameter managedCcf is required and cannot be null.")); + } else { + managedCcf.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.backup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, appName, managedCcf, accept, context); + } + + /** + * Performs the backup operation on a Managed CCF Resource. + * + * Backs up a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Backup Request Body. + * @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 PollerFlux} for polling of object representing the backup response of a Managed CCF Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedCcfBackupResponseInner> + beginBackupAsync(String resourceGroupName, String appName, ManagedCcfBackup managedCcf) { + Mono>> mono = backupWithResponseAsync(resourceGroupName, appName, managedCcf); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ManagedCcfBackupResponseInner.class, ManagedCcfBackupResponseInner.class, + this.client.getContext()); + } + + /** + * Performs the backup operation on a Managed CCF Resource. + * + * Backs up a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Backup Request Body. + * @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 PollerFlux} for polling of object representing the backup response of a Managed CCF Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedCcfBackupResponseInner> + beginBackupAsync(String resourceGroupName, String appName, ManagedCcfBackup managedCcf, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = backupWithResponseAsync(resourceGroupName, appName, managedCcf, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ManagedCcfBackupResponseInner.class, ManagedCcfBackupResponseInner.class, + context); + } + + /** + * Performs the backup operation on a Managed CCF Resource. + * + * Backs up a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Backup Request Body. + * @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 SyncPoller} for polling of object representing the backup response of a Managed CCF Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedCcfBackupResponseInner> + beginBackup(String resourceGroupName, String appName, ManagedCcfBackup managedCcf) { + return this.beginBackupAsync(resourceGroupName, appName, managedCcf).getSyncPoller(); + } + + /** + * Performs the backup operation on a Managed CCF Resource. + * + * Backs up a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Backup Request Body. + * @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 SyncPoller} for polling of object representing the backup response of a Managed CCF Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedCcfBackupResponseInner> + beginBackup(String resourceGroupName, String appName, ManagedCcfBackup managedCcf, Context context) { + return this.beginBackupAsync(resourceGroupName, appName, managedCcf, context).getSyncPoller(); + } + + /** + * Performs the backup operation on a Managed CCF Resource. + * + * Backs up a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Backup Request Body. + * @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 object representing the backup response of a Managed CCF Resource on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono backupAsync(String resourceGroupName, String appName, + ManagedCcfBackup managedCcf) { + return beginBackupAsync(resourceGroupName, appName, managedCcf).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Performs the backup operation on a Managed CCF Resource. + * + * Backs up a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Backup Request Body. + * @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 object representing the backup response of a Managed CCF Resource on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono backupAsync(String resourceGroupName, String appName, + ManagedCcfBackup managedCcf, Context context) { + return beginBackupAsync(resourceGroupName, appName, managedCcf, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Performs the backup operation on a Managed CCF Resource. + * + * Backs up a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Backup Request Body. + * @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 object representing the backup response of a Managed CCF Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedCcfBackupResponseInner backup(String resourceGroupName, String appName, ManagedCcfBackup managedCcf) { + return backupAsync(resourceGroupName, appName, managedCcf).block(); + } + + /** + * Performs the backup operation on a Managed CCF Resource. + * + * Backs up a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Backup Request Body. + * @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 object representing the backup response of a Managed CCF Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedCcfBackupResponseInner backup(String resourceGroupName, String appName, ManagedCcfBackup managedCcf, + Context context) { + return backupAsync(resourceGroupName, appName, managedCcf, context).block(); + } + + /** + * Performs the restore operation to spin up a newly restored Managed CCF Resource. + * + * Restores a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Restore Request Body. + * @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 object representing the restore response of a Managed CCF Resource along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restoreWithResponseAsync(String resourceGroupName, String appName, + ManagedCcfRestore managedCcf) { + 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.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (managedCcf == null) { + return Mono.error(new IllegalArgumentException("Parameter managedCcf is required and cannot be null.")); + } else { + managedCcf.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.restore(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appName, managedCcf, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Performs the restore operation to spin up a newly restored Managed CCF Resource. + * + * Restores a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Restore Request Body. + * @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 object representing the restore response of a Managed CCF Resource along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restoreWithResponseAsync(String resourceGroupName, String appName, + ManagedCcfRestore managedCcf, 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.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (managedCcf == null) { + return Mono.error(new IllegalArgumentException("Parameter managedCcf is required and cannot be null.")); + } else { + managedCcf.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.restore(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, appName, managedCcf, accept, context); + } + + /** + * Performs the restore operation to spin up a newly restored Managed CCF Resource. + * + * Restores a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Restore Request Body. + * @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 PollerFlux} for polling of object representing the restore response of a Managed CCF Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedCcfRestoreResponseInner> + beginRestoreAsync(String resourceGroupName, String appName, ManagedCcfRestore managedCcf) { + Mono>> mono = restoreWithResponseAsync(resourceGroupName, appName, managedCcf); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ManagedCcfRestoreResponseInner.class, ManagedCcfRestoreResponseInner.class, + this.client.getContext()); + } + + /** + * Performs the restore operation to spin up a newly restored Managed CCF Resource. + * + * Restores a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Restore Request Body. + * @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 PollerFlux} for polling of object representing the restore response of a Managed CCF Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedCcfRestoreResponseInner> + beginRestoreAsync(String resourceGroupName, String appName, ManagedCcfRestore managedCcf, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = restoreWithResponseAsync(resourceGroupName, appName, managedCcf, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ManagedCcfRestoreResponseInner.class, ManagedCcfRestoreResponseInner.class, + context); + } + + /** + * Performs the restore operation to spin up a newly restored Managed CCF Resource. + * + * Restores a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Restore Request Body. + * @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 SyncPoller} for polling of object representing the restore response of a Managed CCF Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedCcfRestoreResponseInner> + beginRestore(String resourceGroupName, String appName, ManagedCcfRestore managedCcf) { + return this.beginRestoreAsync(resourceGroupName, appName, managedCcf).getSyncPoller(); + } + + /** + * Performs the restore operation to spin up a newly restored Managed CCF Resource. + * + * Restores a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Restore Request Body. + * @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 SyncPoller} for polling of object representing the restore response of a Managed CCF Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedCcfRestoreResponseInner> + beginRestore(String resourceGroupName, String appName, ManagedCcfRestore managedCcf, Context context) { + return this.beginRestoreAsync(resourceGroupName, appName, managedCcf, context).getSyncPoller(); + } + + /** + * Performs the restore operation to spin up a newly restored Managed CCF Resource. + * + * Restores a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Restore Request Body. + * @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 object representing the restore response of a Managed CCF Resource on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restoreAsync(String resourceGroupName, String appName, + ManagedCcfRestore managedCcf) { + return beginRestoreAsync(resourceGroupName, appName, managedCcf).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Performs the restore operation to spin up a newly restored Managed CCF Resource. + * + * Restores a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Restore Request Body. + * @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 object representing the restore response of a Managed CCF Resource on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restoreAsync(String resourceGroupName, String appName, + ManagedCcfRestore managedCcf, Context context) { + return beginRestoreAsync(resourceGroupName, appName, managedCcf, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Performs the restore operation to spin up a newly restored Managed CCF Resource. + * + * Restores a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Restore Request Body. + * @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 object representing the restore response of a Managed CCF Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedCcfRestoreResponseInner restore(String resourceGroupName, String appName, + ManagedCcfRestore managedCcf) { + return restoreAsync(resourceGroupName, appName, managedCcf).block(); + } + + /** + * Performs the restore operation to spin up a newly restored Managed CCF Resource. + * + * Restores a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Restore Request Body. + * @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 object representing the restore response of a Managed CCF Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedCcfRestoreResponseInner restore(String resourceGroupName, String appName, + ManagedCcfRestore managedCcf, Context context) { + return restoreAsync(resourceGroupName, appName, managedCcf, context).block(); + } + /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 object that includes an array of Managed CCF and a possible link for next set along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return object that includes an array of Managed CCF and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1544,76 +1862,59 @@ private Mono> listByResourceGroupNextSinglePageAs 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.")); + 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.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>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 URL to get the next list of items - *

The nextLink parameter. + * + * 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 object that includes an array of Managed CCF and a possible link for next set along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return object that includes an array of Managed CCF and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync(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.")); + 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 - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceGroupNext(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 URL to get the next list of items - *

The nextLink parameter. + * + * 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 object that includes an array of Managed CCF and a possible link for next set along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return object that includes an array of Managed CCF and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -1621,63 +1922,45 @@ private Mono> listBySubscriptionNextSinglePageAsy 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.")); + 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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>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 URL to get the next list of items - *

The nextLink parameter. + * + * 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 object that includes an array of Managed CCF and a possible link for next set along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return object that includes an array of Managed CCF and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listBySubscriptionNextSinglePageAsync(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.")); + 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 - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listBySubscriptionNext(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/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ManagedCcfsImpl.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ManagedCcfsImpl.java index 4bff24297114..9e3a07e28ac4 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ManagedCcfsImpl.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ManagedCcfsImpl.java @@ -10,8 +10,14 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.confidentialledger.fluent.ManagedCcfsClient; +import com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfBackupResponseInner; import com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfInner; +import com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfRestoreResponseInner; import com.azure.resourcemanager.confidentialledger.models.ManagedCcf; +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfBackup; +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfBackupResponse; +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfRestore; +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfRestoreResponse; import com.azure.resourcemanager.confidentialledger.models.ManagedCcfs; public final class ManagedCcfsImpl implements ManagedCcfs { @@ -21,22 +27,18 @@ public final class ManagedCcfsImpl implements ManagedCcfs { private final com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager; - public ManagedCcfsImpl( - ManagedCcfsClient innerClient, + public ManagedCcfsImpl(ManagedCcfsClient innerClient, com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getByResourceGroupWithResponse( - String resourceGroupName, String appName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, appName, context); + public Response getByResourceGroupWithResponse(String resourceGroupName, String appName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, appName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ManagedCcfImpl(inner.getValue(), this.manager())); } else { return null; @@ -60,107 +62,119 @@ public void delete(String resourceGroupName, String appName, Context context) { this.serviceClient().delete(resourceGroupName, appName, context); } - public void update(String resourceGroupName, String appName, ManagedCcfInner managedCcf) { - this.serviceClient().update(resourceGroupName, appName, managedCcf); - } - - public void update(String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context) { - this.serviceClient().update(resourceGroupName, appName, managedCcf, context); - } - public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new ManagedCcfImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedCcfImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, String filter, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, filter, context); - return Utils.mapPage(inner, inner1 -> new ManagedCcfImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedCcfImpl(inner1, this.manager())); } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ManagedCcfImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedCcfImpl(inner1, this.manager())); } public PagedIterable list(String filter, Context context) { PagedIterable inner = this.serviceClient().list(filter, context); - return Utils.mapPage(inner, inner1 -> new ManagedCcfImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedCcfImpl(inner1, this.manager())); + } + + public ManagedCcfBackupResponse backup(String resourceGroupName, String appName, ManagedCcfBackup managedCcf) { + ManagedCcfBackupResponseInner inner = this.serviceClient().backup(resourceGroupName, appName, managedCcf); + if (inner != null) { + return new ManagedCcfBackupResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ManagedCcfBackupResponse backup(String resourceGroupName, String appName, ManagedCcfBackup managedCcf, + Context context) { + ManagedCcfBackupResponseInner inner + = this.serviceClient().backup(resourceGroupName, appName, managedCcf, context); + if (inner != null) { + return new ManagedCcfBackupResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ManagedCcfRestoreResponse restore(String resourceGroupName, String appName, ManagedCcfRestore managedCcf) { + ManagedCcfRestoreResponseInner inner = this.serviceClient().restore(resourceGroupName, appName, managedCcf); + if (inner != null) { + return new ManagedCcfRestoreResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ManagedCcfRestoreResponse restore(String resourceGroupName, String appName, ManagedCcfRestore managedCcf, + Context context) { + ManagedCcfRestoreResponseInner inner + = this.serviceClient().restore(resourceGroupName, appName, managedCcf, context); + if (inner != null) { + return new ManagedCcfRestoreResponseImpl(inner, this.manager()); + } else { + return null; + } } public ManagedCcf getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String appName = Utils.getValueFromIdByName(id, "managedCCFs"); + String appName = ResourceManagerUtils.getValueFromIdByName(id, "managedCCFs"); if (appName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'managedCCFs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedCCFs'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, appName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String appName = Utils.getValueFromIdByName(id, "managedCCFs"); + String appName = ResourceManagerUtils.getValueFromIdByName(id, "managedCCFs"); if (appName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'managedCCFs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedCCFs'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, appName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String appName = Utils.getValueFromIdByName(id, "managedCCFs"); + String appName = ResourceManagerUtils.getValueFromIdByName(id, "managedCCFs"); if (appName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'managedCCFs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedCCFs'.", id))); } this.delete(resourceGroupName, appName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String appName = Utils.getValueFromIdByName(id, "managedCCFs"); + String appName = ResourceManagerUtils.getValueFromIdByName(id, "managedCCFs"); if (appName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'managedCCFs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedCCFs'.", id))); } this.delete(resourceGroupName, appName, context); } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/OperationsClientImpl.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/OperationsClientImpl.java index a66ebcee9b44..772a02386b4f 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/OperationsClientImpl.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/OperationsClientImpl.java @@ -30,22 +30,28 @@ import com.azure.resourcemanager.confidentialledger.models.ResourceProviderOperationList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public final class OperationsClientImpl implements OperationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final OperationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ConfidentialLedgerManagementClientImpl client; /** * Initializes an instance of OperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ OperationsClientImpl(ConfidentialLedgerManagementClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -56,105 +62,82 @@ public final class OperationsClientImpl implements OperationsClient { @Host("{$host}") @ServiceInterface(name = "ConfidentialLedgerMa") public interface OperationsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.ConfidentialLedger/operations") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Retrieves a list of available API operations under this Resource Provider. - * - *

Retrieves a list of available API operations. - * + * + * Retrieves a list of available API operations. + * * @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 list containing this Resource Provider's available operations along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * 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.")); + 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)) + 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())); } /** * Retrieves a list of available API operations under this Resource Provider. - * - *

Retrieves a list of available API operations. - * + * + * Retrieves a list of available API operations. + * * @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 list containing this Resource Provider's available operations along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * 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.")); + 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)); + 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)); } /** * Retrieves a list of available API operations under this Resource Provider. - * - *

Retrieves a list of available API operations. - * + * + * Retrieves a list of available API operations. + * * @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 list containing this Resource Provider's available operations as paginated response with {@link - * PagedFlux}. + * @return list containing this Resource Provider's available operations as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -163,31 +146,31 @@ private PagedFlux listAsync() { /** * Retrieves a list of available API operations under this Resource Provider. - * - *

Retrieves a list of available API operations. - * + * + * Retrieves a list of available API operations. + * * @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 list containing this Resource Provider's available operations as paginated response with {@link - * PagedFlux}. + * @return list containing this Resource Provider's available operations as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Retrieves a list of available API operations under this Resource Provider. - * - *

Retrieves a list of available API operations. - * + * + * Retrieves a list of available API operations. + * * @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 list containing this Resource Provider's available operations as paginated response with {@link - * PagedIterable}. + * @return list containing this Resource Provider's available operations as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -196,15 +179,15 @@ public PagedIterable list() { /** * Retrieves a list of available API operations under this Resource Provider. - * - *

Retrieves a list of available API operations. - * + * + * Retrieves a list of available API operations. + * * @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 list containing this Resource Provider's available operations as paginated response with {@link - * PagedIterable}. + * @return list containing this Resource Provider's available operations as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -213,14 +196,15 @@ public PagedIterable list(Context cont /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 list containing this Resource Provider's available operations along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -228,62 +212,44 @@ private Mono> listNextSi 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.")); + 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)) + 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)) + 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 URL to get the next list of items - *

The nextLink parameter. + * + * 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 list containing this Resource Provider's available operations along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + 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/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/OperationsImpl.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/OperationsImpl.java index b4682a35e6bc..8f598ee24588 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/OperationsImpl.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/OperationsImpl.java @@ -19,8 +19,7 @@ public final class OperationsImpl implements Operations { private final com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager; - public OperationsImpl( - OperationsClient innerClient, + public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -28,12 +27,14 @@ public OperationsImpl( public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ResourceProviderOperationDefinitionImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ResourceProviderOperationDefinitionImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new ResourceProviderOperationDefinitionImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ResourceProviderOperationDefinitionImpl(inner1, this.manager())); } private OperationsClient serviceClient() { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/Utils.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ResourceManagerUtils.java similarity index 80% rename from sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/Utils.java rename to sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ResourceManagerUtils.java index 5785128f3ad3..7e4f41eb0bb1 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/Utils.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ResourceManagerUtils.java @@ -19,7 +19,10 @@ import java.util.stream.Stream; import reactor.core.publisher.Flux; -final class Utils { +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + static String getValueFromIdByName(String id, String name) { if (id == null) { return null; @@ -60,7 +63,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri segments.add(idSegment); idItrReverted.forEachRemaining(segments::add); Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { + if (!segments.isEmpty() && segments.get(0).isEmpty()) { segments.remove(0); } return String.join("/", segments); @@ -74,7 +77,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); + return new PagedIterableImpl<>(pageIterable, mapper); } private static final class PagedIterableImpl extends PagedIterable { @@ -84,26 +87,17 @@ private static final class PagedIterableImpl extends PagedIterable { private final Function, PagedResponse> pageMapper; private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super( - PagedFlux - .create( - () -> - (continuationToken, pageSize) -> - Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(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); + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); } @Override @@ -133,30 +127,27 @@ public Stream> streamByPage(String continuationToken, int prefe @Override public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); + return new IteratorImpl<>(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } @@ -198,7 +189,7 @@ private IterableImpl(Iterable iterable, Function mapper) { @Override public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); + return new IteratorImpl<>(iterable.iterator(), mapper); } } } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ResourceProviderOperationDefinitionImpl.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ResourceProviderOperationDefinitionImpl.java index d690d36e1e5d..b24badee7040 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ResourceProviderOperationDefinitionImpl.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ResourceProviderOperationDefinitionImpl.java @@ -13,8 +13,7 @@ public final class ResourceProviderOperationDefinitionImpl implements ResourcePr private final com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager; - ResourceProviderOperationDefinitionImpl( - ResourceProviderOperationDefinitionInner innerObject, + ResourceProviderOperationDefinitionImpl(ResourceProviderOperationDefinitionInner innerObject, com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ResourceProvidersClientImpl.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ResourceProvidersClientImpl.java index b44da565cc80..91825a287e4d 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ResourceProvidersClientImpl.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ResourceProvidersClientImpl.java @@ -27,22 +27,28 @@ import com.azure.resourcemanager.confidentialledger.models.CheckNameAvailabilityRequest; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +/** + * An instance of this class provides access to all the operations defined in ResourceProvidersClient. + */ public final class ResourceProvidersClientImpl implements ResourceProvidersClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ResourceProvidersService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ConfidentialLedgerManagementClientImpl client; /** * Initializes an instance of ResourceProvidersClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ResourceProvidersClientImpl(ConfidentialLedgerManagementClientImpl client) { - this.service = - RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -53,22 +59,19 @@ public final class ResourceProvidersClientImpl implements ResourceProvidersClien @Host("{$host}") @ServiceInterface(name = "ConfidentialLedgerMa") public interface ResourceProvidersService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ConfidentialLedger/checkNameAvailability") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkNameAvailability( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> checkNameAvailability(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") CheckNameAvailabilityRequest nameAvailabilityRequest, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); } /** * To check whether a resource name is available. - * + * * @param nameAvailabilityRequest Name availability request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -76,45 +79,32 @@ Mono> checkNameAvailability( * @return the check availability result along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync( - CheckNameAvailabilityRequest nameAvailabilityRequest) { + private Mono> + checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityRequest nameAvailabilityRequest) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (nameAvailabilityRequest == null) { - return Mono - .error( - new IllegalArgumentException("Parameter nameAvailabilityRequest is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter nameAvailabilityRequest is required and cannot be null.")); } else { nameAvailabilityRequest.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .checkNameAvailability( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - nameAvailabilityRequest, - accept, - context)) + .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), + 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 nameAvailabilityRequest Name availability request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -123,42 +113,31 @@ private Mono> checkNameAvailability * @return the check availability result along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync( - CheckNameAvailabilityRequest nameAvailabilityRequest, Context context) { + private Mono> + checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityRequest nameAvailabilityRequest, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (nameAvailabilityRequest == null) { - return Mono - .error( - new IllegalArgumentException("Parameter nameAvailabilityRequest is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter nameAvailabilityRequest is required and cannot be null.")); } else { nameAvailabilityRequest.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .checkNameAvailability( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - nameAvailabilityRequest, - accept, - context); + return service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), nameAvailabilityRequest, accept, context); } /** * To check whether a resource name is available. - * + * * @param nameAvailabilityRequest Name availability request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -166,15 +145,15 @@ private Mono> checkNameAvailability * @return the check availability result on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono checkNameAvailabilityAsync( - CheckNameAvailabilityRequest nameAvailabilityRequest) { + private Mono + checkNameAvailabilityAsync(CheckNameAvailabilityRequest nameAvailabilityRequest) { return checkNameAvailabilityWithResponseAsync(nameAvailabilityRequest) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * To check whether a resource name is available. - * + * * @param nameAvailabilityRequest Name availability request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -183,14 +162,14 @@ private Mono checkNameAvailabilityAsync( * @return the check availability result along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNameAvailabilityWithResponse( - CheckNameAvailabilityRequest nameAvailabilityRequest, Context context) { + public Response + checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest nameAvailabilityRequest, Context context) { return checkNameAvailabilityWithResponseAsync(nameAvailabilityRequest, context).block(); } /** * To check whether a resource name is available. - * + * * @param nameAvailabilityRequest Name availability request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -198,8 +177,8 @@ public Response checkNameAvailabilityWithRes * @return the check availability result. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CheckNameAvailabilityResponseInner checkNameAvailability( - CheckNameAvailabilityRequest nameAvailabilityRequest) { + public CheckNameAvailabilityResponseInner + checkNameAvailability(CheckNameAvailabilityRequest nameAvailabilityRequest) { return checkNameAvailabilityWithResponse(nameAvailabilityRequest, Context.NONE).getValue(); } } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ResourceProvidersImpl.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ResourceProvidersImpl.java index 941efe655610..047c22492ca4 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ResourceProvidersImpl.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/ResourceProvidersImpl.java @@ -21,22 +21,18 @@ public final class ResourceProvidersImpl implements ResourceProviders { private final com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager; - public ResourceProvidersImpl( - ResourceProvidersClient innerClient, + public ResourceProvidersImpl(ResourceProvidersClient innerClient, com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response checkNameAvailabilityWithResponse( - CheckNameAvailabilityRequest nameAvailabilityRequest, Context context) { - Response inner = - this.serviceClient().checkNameAvailabilityWithResponse(nameAvailabilityRequest, context); + public Response + checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest nameAvailabilityRequest, Context context) { + Response inner + = this.serviceClient().checkNameAvailabilityWithResponse(nameAvailabilityRequest, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new CheckNameAvailabilityResponseImpl(inner.getValue(), this.manager())); } else { return null; diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/package-info.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/package-info.java index c2b3113495f2..f6d000d1f767 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/package-info.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/implementation/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the implementations for ConfidentialLedgerManagementClient. Microsoft Azure Confidential Compute - * Ledger Control Plane REST API version 2020-12-01-preview. + * Package containing the implementations for ConfidentialLedgerManagementClient. + * Microsoft Azure Confidential Compute Ledger Control Plane REST API version 2020-12-01-preview. */ package com.azure.resourcemanager.confidentialledger.implementation; diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/AadBasedSecurityPrincipal.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/AadBasedSecurityPrincipal.java index 9bb3db260de8..47f6571f742d 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/AadBasedSecurityPrincipal.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/AadBasedSecurityPrincipal.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** AAD based security principal with associated Ledger RoleName. */ +/** + * AAD based security principal with associated Ledger RoleName. + */ @Fluent public final class AadBasedSecurityPrincipal { /* @@ -28,13 +30,15 @@ public final class AadBasedSecurityPrincipal { @JsonProperty(value = "ledgerRoleName") private LedgerRoleName ledgerRoleName; - /** Creates an instance of AadBasedSecurityPrincipal class. */ + /** + * Creates an instance of AadBasedSecurityPrincipal class. + */ public AadBasedSecurityPrincipal() { } /** * Get the principalId property: UUID/GUID based Principal Id of the Security Principal. - * + * * @return the principalId value. */ public String principalId() { @@ -43,7 +47,7 @@ public String principalId() { /** * Set the principalId property: UUID/GUID based Principal Id of the Security Principal. - * + * * @param principalId the principalId value to set. * @return the AadBasedSecurityPrincipal object itself. */ @@ -54,7 +58,7 @@ public AadBasedSecurityPrincipal withPrincipalId(String principalId) { /** * Get the tenantId property: UUID/GUID based Tenant Id of the Security Principal. - * + * * @return the tenantId value. */ public String tenantId() { @@ -63,7 +67,7 @@ public String tenantId() { /** * Set the tenantId property: UUID/GUID based Tenant Id of the Security Principal. - * + * * @param tenantId the tenantId value to set. * @return the AadBasedSecurityPrincipal object itself. */ @@ -74,7 +78,7 @@ public AadBasedSecurityPrincipal withTenantId(String tenantId) { /** * Get the ledgerRoleName property: LedgerRole associated with the Security Principal of Ledger. - * + * * @return the ledgerRoleName value. */ public LedgerRoleName ledgerRoleName() { @@ -83,7 +87,7 @@ public LedgerRoleName ledgerRoleName() { /** * Set the ledgerRoleName property: LedgerRole associated with the Security Principal of Ledger. - * + * * @param ledgerRoleName the ledgerRoleName value to set. * @return the AadBasedSecurityPrincipal object itself. */ @@ -94,7 +98,7 @@ public AadBasedSecurityPrincipal withLedgerRoleName(LedgerRoleName ledgerRoleNam /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/CertBasedSecurityPrincipal.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/CertBasedSecurityPrincipal.java index 2906babd296d..c62578032e0f 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/CertBasedSecurityPrincipal.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/CertBasedSecurityPrincipal.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Cert based security principal with Ledger RoleName. */ +/** + * Cert based security principal with Ledger RoleName. + */ @Fluent public final class CertBasedSecurityPrincipal { /* @@ -22,13 +24,15 @@ public final class CertBasedSecurityPrincipal { @JsonProperty(value = "ledgerRoleName") private LedgerRoleName ledgerRoleName; - /** Creates an instance of CertBasedSecurityPrincipal class. */ + /** + * Creates an instance of CertBasedSecurityPrincipal class. + */ public CertBasedSecurityPrincipal() { } /** * Get the cert property: Public key of the user cert (.pem or .cer). - * + * * @return the cert value. */ public String cert() { @@ -37,7 +41,7 @@ public String cert() { /** * Set the cert property: Public key of the user cert (.pem or .cer). - * + * * @param cert the cert value to set. * @return the CertBasedSecurityPrincipal object itself. */ @@ -48,7 +52,7 @@ public CertBasedSecurityPrincipal withCert(String cert) { /** * Get the ledgerRoleName property: LedgerRole associated with the Security Principal of Ledger. - * + * * @return the ledgerRoleName value. */ public LedgerRoleName ledgerRoleName() { @@ -57,7 +61,7 @@ public LedgerRoleName ledgerRoleName() { /** * Set the ledgerRoleName property: LedgerRole associated with the Security Principal of Ledger. - * + * * @param ledgerRoleName the ledgerRoleName value to set. * @return the CertBasedSecurityPrincipal object itself. */ @@ -68,7 +72,7 @@ public CertBasedSecurityPrincipal withLedgerRoleName(LedgerRoleName ledgerRoleNa /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/CheckNameAvailabilityReason.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/CheckNameAvailabilityReason.java index 9f4c3b8abba5..7001bbf02f91 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/CheckNameAvailabilityReason.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/CheckNameAvailabilityReason.java @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The reason why the given name is not available. */ +/** + * The reason why the given name is not available. + */ public final class CheckNameAvailabilityReason extends ExpandableStringEnum { - /** Static value Invalid for CheckNameAvailabilityReason. */ + /** + * Static value Invalid for CheckNameAvailabilityReason. + */ public static final CheckNameAvailabilityReason INVALID = fromString("Invalid"); - /** Static value AlreadyExists for CheckNameAvailabilityReason. */ + /** + * Static value AlreadyExists for CheckNameAvailabilityReason. + */ public static final CheckNameAvailabilityReason ALREADY_EXISTS = fromString("AlreadyExists"); /** * Creates a new instance of CheckNameAvailabilityReason value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public CheckNameAvailabilityReason() { /** * Creates or finds a CheckNameAvailabilityReason from its string representation. - * + * * @param name a name to look for. * @return the corresponding CheckNameAvailabilityReason. */ @@ -38,7 +44,7 @@ public static CheckNameAvailabilityReason fromString(String name) { /** * Gets known CheckNameAvailabilityReason values. - * + * * @return known CheckNameAvailabilityReason values. */ public static Collection values() { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/CheckNameAvailabilityRequest.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/CheckNameAvailabilityRequest.java index 7ec657e79e15..8450f8f8e827 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/CheckNameAvailabilityRequest.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/CheckNameAvailabilityRequest.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The check availability request body. */ +/** + * The check availability request body. + */ @Fluent public final class CheckNameAvailabilityRequest { /* @@ -22,13 +24,15 @@ public final class CheckNameAvailabilityRequest { @JsonProperty(value = "type") private String type; - /** Creates an instance of CheckNameAvailabilityRequest class. */ + /** + * Creates an instance of CheckNameAvailabilityRequest class. + */ public CheckNameAvailabilityRequest() { } /** * Get the name property: The name of the resource for which availability needs to be checked. - * + * * @return the name value. */ public String name() { @@ -37,7 +41,7 @@ public String name() { /** * Set the name property: The name of the resource for which availability needs to be checked. - * + * * @param name the name value to set. * @return the CheckNameAvailabilityRequest object itself. */ @@ -48,7 +52,7 @@ public CheckNameAvailabilityRequest withName(String name) { /** * Get the type property: The resource type. - * + * * @return the type value. */ public String type() { @@ -57,7 +61,7 @@ public String type() { /** * Set the type property: The resource type. - * + * * @param type the type value to set. * @return the CheckNameAvailabilityRequest object itself. */ @@ -68,7 +72,7 @@ public CheckNameAvailabilityRequest withType(String type) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/CheckNameAvailabilityResponse.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/CheckNameAvailabilityResponse.java index 651c1702faba..7e03eed1c1f7 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/CheckNameAvailabilityResponse.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/CheckNameAvailabilityResponse.java @@ -6,25 +6,27 @@ import com.azure.resourcemanager.confidentialledger.fluent.models.CheckNameAvailabilityResponseInner; -/** An immutable client-side representation of CheckNameAvailabilityResponse. */ +/** + * An immutable client-side representation of CheckNameAvailabilityResponse. + */ public interface CheckNameAvailabilityResponse { /** * Gets the nameAvailable property: Indicates if the resource name is available. - * + * * @return the nameAvailable value. */ Boolean nameAvailable(); /** * Gets the reason property: The reason why the given name is not available. - * + * * @return the reason value. */ CheckNameAvailabilityReason reason(); /** * Gets the message property: Detailed reason why the given name is available. - * + * * @return the message value. */ String message(); @@ -32,7 +34,7 @@ public interface CheckNameAvailabilityResponse { /** * Gets the inner com.azure.resourcemanager.confidentialledger.fluent.models.CheckNameAvailabilityResponseInner * object. - * + * * @return the inner object. */ CheckNameAvailabilityResponseInner innerModel(); diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ConfidentialLedger.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ConfidentialLedger.java index 15fda189fcb1..3929ef41a1de 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ConfidentialLedger.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ConfidentialLedger.java @@ -10,104 +10,113 @@ import com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerInner; import java.util.Map; -/** An immutable client-side representation of ConfidentialLedger. */ +/** + * An immutable client-side representation of ConfidentialLedger. + */ public interface ConfidentialLedger { /** * 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 properties property: LedgerProperties - * - *

Properties of Confidential Ledger Resource. - * + * + * Properties of Confidential Ledger Resource. + * * @return the properties value. */ LedgerProperties properties(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * 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 name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerInner object. - * + * * @return the inner object. */ ConfidentialLedgerInner innerModel(); - /** The entirety of the ConfidentialLedger definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithCreate { + /** + * The entirety of the ConfidentialLedger definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } - /** The ConfidentialLedger definition stages. */ + + /** + * The ConfidentialLedger definition stages. + */ interface DefinitionStages { - /** The first stage of the ConfidentialLedger definition. */ + /** + * The first stage of the ConfidentialLedger definition. + */ interface Blank extends WithLocation { } - /** The stage of the ConfidentialLedger definition allowing to specify location. */ + + /** + * The stage of the ConfidentialLedger 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. */ @@ -115,22 +124,26 @@ interface WithLocation { /** * 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 ConfidentialLedger definition allowing to specify parent resource. */ + + /** + * The stage of the ConfidentialLedger definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the ConfidentialLedger 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. @@ -138,105 +151,179 @@ interface WithResourceGroup { interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { /** * Executes the create request. - * + * * @return the created resource. */ ConfidentialLedger create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ ConfidentialLedger create(Context context); } - /** The stage of the ConfidentialLedger definition allowing to specify tags. */ + + /** + * The stage of the ConfidentialLedger 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 ConfidentialLedger definition allowing to specify properties. */ + + /** + * The stage of the ConfidentialLedger definition allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: LedgerProperties - * - *

Properties of Confidential Ledger Resource.. - * + * + * Properties of Confidential Ledger Resource.. + * * @param properties LedgerProperties - *

Properties of Confidential Ledger Resource. + * + * Properties of Confidential Ledger Resource. * @return the next definition stage. */ WithCreate withProperties(LedgerProperties properties); } } + /** * Begins update for the ConfidentialLedger resource. - * + * * @return the stage of resource update. */ ConfidentialLedger.Update update(); - /** The template for ConfidentialLedger update. */ + /** + * The template for ConfidentialLedger update. + */ interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { /** * Executes the update request. - * + * * @return the updated resource. */ ConfidentialLedger apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ ConfidentialLedger apply(Context context); } - /** The ConfidentialLedger update stages. */ + + /** + * The ConfidentialLedger update stages. + */ interface UpdateStages { - /** The stage of the ConfidentialLedger update allowing to specify tags. */ + /** + * The stage of the ConfidentialLedger update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the ConfidentialLedger update allowing to specify properties. */ + + /** + * The stage of the ConfidentialLedger update allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: LedgerProperties - * - *

Properties of Confidential Ledger Resource.. - * + * + * Properties of Confidential Ledger Resource.. + * * @param properties LedgerProperties - *

Properties of Confidential Ledger Resource. + * + * Properties of Confidential Ledger Resource. * @return the next definition stage. */ Update withProperties(LedgerProperties properties); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ ConfidentialLedger refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ ConfidentialLedger refresh(Context context); + + /** + * Performs the backup operation on a Confidential Ledger Resource. + * + * Backs up a Confidential Ledger Resource. + * + * @param confidentialLedger Confidential Ledger Backup Request Body. + * @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 object representing the backup response of a Confidential Ledger Resource. + */ + ConfidentialLedgerBackupResponse backup(ConfidentialLedgerBackup confidentialLedger); + + /** + * Performs the backup operation on a Confidential Ledger Resource. + * + * Backs up a Confidential Ledger Resource. + * + * @param confidentialLedger Confidential Ledger Backup Request Body. + * @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 object representing the backup response of a Confidential Ledger Resource. + */ + ConfidentialLedgerBackupResponse backup(ConfidentialLedgerBackup confidentialLedger, Context context); + + /** + * Performs the restore operation to spin up a newly restored Confidential Ledger Resource. + * + * Restores a Confidential Ledger Resource. + * + * @param confidentialLedger Confidential Ledger Restore Request Body. + * @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 object representing the restore response of a Confidential Ledger Resource. + */ + ConfidentialLedgerRestoreResponse restore(ConfidentialLedgerRestore confidentialLedger); + + /** + * Performs the restore operation to spin up a newly restored Confidential Ledger Resource. + * + * Restores a Confidential Ledger Resource. + * + * @param confidentialLedger Confidential Ledger Restore Request Body. + * @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 object representing the restore response of a Confidential Ledger Resource. + */ + ConfidentialLedgerRestoreResponse restore(ConfidentialLedgerRestore confidentialLedger, Context context); } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ConfidentialLedgerBackup.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ConfidentialLedgerBackup.java new file mode 100644 index 000000000000..2e88a44fd9b1 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ConfidentialLedgerBackup.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.confidentialledger.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Object representing Backup properties of a Confidential Ledger Resource. + */ +@Fluent +public final class ConfidentialLedgerBackup { + /* + * The region where the backup of the ledger will eventually be restored to. + */ + @JsonProperty(value = "restoreRegion") + private String restoreRegion; + + /* + * SAS URI used to access the backup Fileshare. + */ + @JsonProperty(value = "uri") + private String uri; + + /** + * Creates an instance of ConfidentialLedgerBackup class. + */ + public ConfidentialLedgerBackup() { + } + + /** + * Get the restoreRegion property: The region where the backup of the ledger will eventually be restored to. + * + * @return the restoreRegion value. + */ + public String restoreRegion() { + return this.restoreRegion; + } + + /** + * Set the restoreRegion property: The region where the backup of the ledger will eventually be restored to. + * + * @param restoreRegion the restoreRegion value to set. + * @return the ConfidentialLedgerBackup object itself. + */ + public ConfidentialLedgerBackup withRestoreRegion(String restoreRegion) { + this.restoreRegion = restoreRegion; + return this; + } + + /** + * Get the uri property: SAS URI used to access the backup Fileshare. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: SAS URI used to access the backup Fileshare. + * + * @param uri the uri value to set. + * @return the ConfidentialLedgerBackup object itself. + */ + public ConfidentialLedgerBackup withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (uri() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property uri in model ConfidentialLedgerBackup")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConfidentialLedgerBackup.class); +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ConfidentialLedgerBackupResponse.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ConfidentialLedgerBackupResponse.java new file mode 100644 index 000000000000..4c9bf9204f26 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ConfidentialLedgerBackupResponse.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.confidentialledger.models; + +import com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerBackupResponseInner; + +/** + * An immutable client-side representation of ConfidentialLedgerBackupResponse. + */ +public interface ConfidentialLedgerBackupResponse { + /** + * Gets the message property: Response body stating if the ledger is being backed up. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerBackupResponseInner + * object. + * + * @return the inner object. + */ + ConfidentialLedgerBackupResponseInner innerModel(); +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ConfidentialLedgerList.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ConfidentialLedgerList.java index d6341cd356d7..349a3e6e7676 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ConfidentialLedgerList.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ConfidentialLedgerList.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Object that includes an array of Confidential Ledgers and a possible link for next set. */ +/** + * Object that includes an array of Confidential Ledgers and a possible link for next set. + */ @Fluent public final class ConfidentialLedgerList { /* @@ -24,13 +26,15 @@ public final class ConfidentialLedgerList { @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of ConfidentialLedgerList class. */ + /** + * Creates an instance of ConfidentialLedgerList class. + */ public ConfidentialLedgerList() { } /** * Get the value property: List of Confidential Ledgers. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Set the value property: List of Confidential Ledgers. - * + * * @param value the value value to set. * @return the ConfidentialLedgerList object itself. */ @@ -50,7 +54,7 @@ public ConfidentialLedgerList withValue(List value) { /** * Get the nextLink property: The URL the client should use to fetch the next page (per server side paging). - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +63,7 @@ public String nextLink() { /** * Set the nextLink property: The URL the client should use to fetch the next page (per server side paging). - * + * * @param nextLink the nextLink value to set. * @return the ConfidentialLedgerList object itself. */ @@ -70,7 +74,7 @@ public ConfidentialLedgerList withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ConfidentialLedgerRestore.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ConfidentialLedgerRestore.java new file mode 100644 index 000000000000..d64c64f00196 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ConfidentialLedgerRestore.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.confidentialledger.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Object representing Restore properties of a Confidential Ledger Resource. + */ +@Fluent +public final class ConfidentialLedgerRestore { + /* + * Fileshare where the ledger backup is stored. + */ + @JsonProperty(value = "fileShareName", required = true) + private String fileShareName; + + /* + * The region the ledger is being restored to. + */ + @JsonProperty(value = "restoreRegion", required = true) + private String restoreRegion; + + /* + * SAS URI used to access the backup fileshare. + */ + @JsonProperty(value = "uri") + private String uri; + + /** + * Creates an instance of ConfidentialLedgerRestore class. + */ + public ConfidentialLedgerRestore() { + } + + /** + * Get the fileShareName property: Fileshare where the ledger backup is stored. + * + * @return the fileShareName value. + */ + public String fileShareName() { + return this.fileShareName; + } + + /** + * Set the fileShareName property: Fileshare where the ledger backup is stored. + * + * @param fileShareName the fileShareName value to set. + * @return the ConfidentialLedgerRestore object itself. + */ + public ConfidentialLedgerRestore withFileShareName(String fileShareName) { + this.fileShareName = fileShareName; + return this; + } + + /** + * Get the restoreRegion property: The region the ledger is being restored to. + * + * @return the restoreRegion value. + */ + public String restoreRegion() { + return this.restoreRegion; + } + + /** + * Set the restoreRegion property: The region the ledger is being restored to. + * + * @param restoreRegion the restoreRegion value to set. + * @return the ConfidentialLedgerRestore object itself. + */ + public ConfidentialLedgerRestore withRestoreRegion(String restoreRegion) { + this.restoreRegion = restoreRegion; + return this; + } + + /** + * Get the uri property: SAS URI used to access the backup fileshare. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: SAS URI used to access the backup fileshare. + * + * @param uri the uri value to set. + * @return the ConfidentialLedgerRestore object itself. + */ + public ConfidentialLedgerRestore withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (fileShareName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property fileShareName in model ConfidentialLedgerRestore")); + } + if (restoreRegion() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property restoreRegion in model ConfidentialLedgerRestore")); + } + if (uri() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property uri in model ConfidentialLedgerRestore")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConfidentialLedgerRestore.class); +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ConfidentialLedgerRestoreResponse.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ConfidentialLedgerRestoreResponse.java new file mode 100644 index 000000000000..73646e13fe9f --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ConfidentialLedgerRestoreResponse.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.confidentialledger.models; + +import com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerRestoreResponseInner; + +/** + * An immutable client-side representation of ConfidentialLedgerRestoreResponse. + */ +public interface ConfidentialLedgerRestoreResponse { + /** + * Gets the message property: Response body stating if the ledger is being restored. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerRestoreResponseInner + * object. + * + * @return the inner object. + */ + ConfidentialLedgerRestoreResponseInner innerModel(); +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/DeploymentType.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/DeploymentType.java index 62a1ad713edd..63dc5396b34b 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/DeploymentType.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/DeploymentType.java @@ -9,8 +9,8 @@ /** * DeploymentType - * - *

Object representing DeploymentType for Managed CCF. + * + * Object representing DeploymentType for Managed CCF. */ @Fluent public final class DeploymentType { @@ -26,13 +26,15 @@ public final class DeploymentType { @JsonProperty(value = "appSourceUri") private String appSourceUri; - /** Creates an instance of DeploymentType class. */ + /** + * Creates an instance of DeploymentType class. + */ public DeploymentType() { } /** * Get the languageRuntime property: Unique name for the Managed CCF. - * + * * @return the languageRuntime value. */ public LanguageRuntime languageRuntime() { @@ -41,7 +43,7 @@ public LanguageRuntime languageRuntime() { /** * Set the languageRuntime property: Unique name for the Managed CCF. - * + * * @param languageRuntime the languageRuntime value to set. * @return the DeploymentType object itself. */ @@ -52,7 +54,7 @@ public DeploymentType withLanguageRuntime(LanguageRuntime languageRuntime) { /** * Get the appSourceUri property: Source Uri containing ManagedCCF code. - * + * * @return the appSourceUri value. */ public String appSourceUri() { @@ -61,7 +63,7 @@ public String appSourceUri() { /** * Set the appSourceUri property: Source Uri containing ManagedCCF code. - * + * * @param appSourceUri the appSourceUri value to set. * @return the DeploymentType object itself. */ @@ -72,7 +74,7 @@ public DeploymentType withAppSourceUri(String appSourceUri) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/LanguageRuntime.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/LanguageRuntime.java index 1fd42cd03802..5b1e431fc6cb 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/LanguageRuntime.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/LanguageRuntime.java @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Object representing LanguageRuntime for Manged CCF. */ +/** + * Object representing LanguageRuntime for Manged CCF. + */ public final class LanguageRuntime extends ExpandableStringEnum { - /** Static value CPP for LanguageRuntime. */ + /** + * Static value CPP for LanguageRuntime. + */ public static final LanguageRuntime CPP = fromString("CPP"); - /** Static value JS for LanguageRuntime. */ + /** + * Static value JS for LanguageRuntime. + */ public static final LanguageRuntime JS = fromString("JS"); /** * Creates a new instance of LanguageRuntime value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public LanguageRuntime() { /** * Creates or finds a LanguageRuntime from its string representation. - * + * * @param name a name to look for. * @return the corresponding LanguageRuntime. */ @@ -38,7 +44,7 @@ public static LanguageRuntime fromString(String name) { /** * Gets known LanguageRuntime values. - * + * * @return known LanguageRuntime values. */ public static Collection values() { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/LedgerProperties.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/LedgerProperties.java index abad25404f69..202faa94595a 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/LedgerProperties.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/LedgerProperties.java @@ -10,8 +10,8 @@ /** * LedgerProperties - * - *

Additional Confidential Ledger properties. + * + * Additional Confidential Ledger properties. */ @Fluent public final class LedgerProperties { @@ -57,6 +57,12 @@ public final class LedgerProperties { @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; + /* + * SKU associated with the ledger + */ + @JsonProperty(value = "ledgerSku") + private LedgerSku ledgerSku; + /* * Array of all AAD based Security Principals. */ @@ -69,13 +75,15 @@ public final class LedgerProperties { @JsonProperty(value = "certBasedSecurityPrincipals") private List certBasedSecurityPrincipals; - /** Creates an instance of LedgerProperties class. */ + /** + * Creates an instance of LedgerProperties class. + */ public LedgerProperties() { } /** * Get the ledgerName property: Unique name for the Confidential Ledger. - * + * * @return the ledgerName value. */ public String ledgerName() { @@ -84,7 +92,7 @@ public String ledgerName() { /** * Get the ledgerUri property: Endpoint for calling Ledger Service. - * + * * @return the ledgerUri value. */ public String ledgerUri() { @@ -93,7 +101,7 @@ public String ledgerUri() { /** * Get the identityServiceUri property: Endpoint for accessing network identity. - * + * * @return the identityServiceUri value. */ public String identityServiceUri() { @@ -102,7 +110,7 @@ public String identityServiceUri() { /** * Get the ledgerInternalNamespace property: Internal namespace for the Ledger. - * + * * @return the ledgerInternalNamespace value. */ public String ledgerInternalNamespace() { @@ -111,7 +119,7 @@ public String ledgerInternalNamespace() { /** * Get the runningState property: Object representing RunningState for Ledger. - * + * * @return the runningState value. */ public RunningState runningState() { @@ -120,7 +128,7 @@ public RunningState runningState() { /** * Set the runningState property: Object representing RunningState for Ledger. - * + * * @param runningState the runningState value to set. * @return the LedgerProperties object itself. */ @@ -131,7 +139,7 @@ public LedgerProperties withRunningState(RunningState runningState) { /** * Get the ledgerType property: Type of Confidential Ledger. - * + * * @return the ledgerType value. */ public LedgerType ledgerType() { @@ -140,7 +148,7 @@ public LedgerType ledgerType() { /** * Set the ledgerType property: Type of Confidential Ledger. - * + * * @param ledgerType the ledgerType value to set. * @return the LedgerProperties object itself. */ @@ -151,16 +159,36 @@ public LedgerProperties withLedgerType(LedgerType ledgerType) { /** * Get the provisioningState property: Provisioning state of Ledger Resource. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { return this.provisioningState; } + /** + * Get the ledgerSku property: SKU associated with the ledger. + * + * @return the ledgerSku value. + */ + public LedgerSku ledgerSku() { + return this.ledgerSku; + } + + /** + * Set the ledgerSku property: SKU associated with the ledger. + * + * @param ledgerSku the ledgerSku value to set. + * @return the LedgerProperties object itself. + */ + public LedgerProperties withLedgerSku(LedgerSku ledgerSku) { + this.ledgerSku = ledgerSku; + return this; + } + /** * Get the aadBasedSecurityPrincipals property: Array of all AAD based Security Principals. - * + * * @return the aadBasedSecurityPrincipals value. */ public List aadBasedSecurityPrincipals() { @@ -169,7 +197,7 @@ public List aadBasedSecurityPrincipals() { /** * Set the aadBasedSecurityPrincipals property: Array of all AAD based Security Principals. - * + * * @param aadBasedSecurityPrincipals the aadBasedSecurityPrincipals value to set. * @return the LedgerProperties object itself. */ @@ -180,7 +208,7 @@ public LedgerProperties withAadBasedSecurityPrincipals(List certBasedSecurityPrincipals() { @@ -189,19 +217,19 @@ public List certBasedSecurityPrincipals() { /** * Set the certBasedSecurityPrincipals property: Array of all cert based Security Principals. - * + * * @param certBasedSecurityPrincipals the certBasedSecurityPrincipals value to set. * @return the LedgerProperties object itself. */ - public LedgerProperties withCertBasedSecurityPrincipals( - List certBasedSecurityPrincipals) { + public LedgerProperties + withCertBasedSecurityPrincipals(List certBasedSecurityPrincipals) { this.certBasedSecurityPrincipals = certBasedSecurityPrincipals; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/LedgerRoleName.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/LedgerRoleName.java index c4865ec901fd..060e404b105d 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/LedgerRoleName.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/LedgerRoleName.java @@ -8,20 +8,28 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** LedgerRole associated with the Security Principal of Ledger. */ +/** + * LedgerRole associated with the Security Principal of Ledger. + */ public final class LedgerRoleName extends ExpandableStringEnum { - /** Static value Reader for LedgerRoleName. */ + /** + * Static value Reader for LedgerRoleName. + */ public static final LedgerRoleName READER = fromString("Reader"); - /** Static value Contributor for LedgerRoleName. */ + /** + * Static value Contributor for LedgerRoleName. + */ public static final LedgerRoleName CONTRIBUTOR = fromString("Contributor"); - /** Static value Administrator for LedgerRoleName. */ + /** + * Static value Administrator for LedgerRoleName. + */ public static final LedgerRoleName ADMINISTRATOR = fromString("Administrator"); /** * Creates a new instance of LedgerRoleName value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,7 +38,7 @@ public LedgerRoleName() { /** * Creates or finds a LedgerRoleName from its string representation. - * + * * @param name a name to look for. * @return the corresponding LedgerRoleName. */ @@ -41,7 +49,7 @@ public static LedgerRoleName fromString(String name) { /** * Gets known LedgerRoleName values. - * + * * @return known LedgerRoleName values. */ public static Collection values() { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/LedgerSku.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/LedgerSku.java new file mode 100644 index 000000000000..80d0e199dc06 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/LedgerSku.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.confidentialledger.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * SKU associated with the ledger resource. + */ +public final class LedgerSku extends ExpandableStringEnum { + /** + * Static value Standard for LedgerSku. + */ + public static final LedgerSku STANDARD = fromString("Standard"); + + /** + * Static value Basic for LedgerSku. + */ + public static final LedgerSku BASIC = fromString("Basic"); + + /** + * Static value Unknown for LedgerSku. + */ + public static final LedgerSku UNKNOWN = fromString("Unknown"); + + /** + * Creates a new instance of LedgerSku value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LedgerSku() { + } + + /** + * Creates or finds a LedgerSku from its string representation. + * + * @param name a name to look for. + * @return the corresponding LedgerSku. + */ + @JsonCreator + public static LedgerSku fromString(String name) { + return fromString(name, LedgerSku.class); + } + + /** + * Gets known LedgerSku values. + * + * @return known LedgerSku values. + */ + public static Collection values() { + return values(LedgerSku.class); + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/LedgerType.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/LedgerType.java index f5dba446b790..2ab67199463f 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/LedgerType.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/LedgerType.java @@ -8,20 +8,28 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Type of the ledger. Private means transaction data is encrypted. */ +/** + * Type of the ledger. Private means transaction data is encrypted. + */ public final class LedgerType extends ExpandableStringEnum { - /** Static value Unknown for LedgerType. */ + /** + * Static value Unknown for LedgerType. + */ public static final LedgerType UNKNOWN = fromString("Unknown"); - /** Static value Public for LedgerType. */ + /** + * Static value Public for LedgerType. + */ public static final LedgerType PUBLIC = fromString("Public"); - /** Static value Private for LedgerType. */ + /** + * Static value Private for LedgerType. + */ public static final LedgerType PRIVATE = fromString("Private"); /** * Creates a new instance of LedgerType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,7 +38,7 @@ public LedgerType() { /** * Creates or finds a LedgerType from its string representation. - * + * * @param name a name to look for. * @return the corresponding LedgerType. */ @@ -41,7 +49,7 @@ public static LedgerType fromString(String name) { /** * Gets known LedgerType values. - * + * * @return known LedgerType values. */ public static Collection values() { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/Ledgers.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/Ledgers.java index bd6d27409543..051e722c7032 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/Ledgers.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/Ledgers.java @@ -8,13 +8,15 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Ledgers. */ +/** + * Resource collection API of Ledgers. + */ public interface Ledgers { /** * Retrieves information about a Confidential Ledger resource. - * - *

Retrieves the properties of a Confidential Ledger. - * + * + * Retrieves the properties of a Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param context The context to associate with this operation. @@ -23,14 +25,14 @@ public interface Ledgers { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return confidential Ledger along with {@link Response}. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String ledgerName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String ledgerName, + Context context); /** * Retrieves information about a Confidential Ledger resource. - * - *

Retrieves the properties of a Confidential Ledger. - * + * + * Retrieves the properties of a Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -42,9 +44,9 @@ Response getByResourceGroupWithResponse( /** * Deletes a Confidential Ledger resource. - * - *

Deletes an existing Confidential Ledger. - * + * + * Deletes an existing Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -55,9 +57,9 @@ Response getByResourceGroupWithResponse( /** * Deletes a Confidential Ledger resource. - * - *

Deletes an existing Confidential Ledger. - * + * + * Deletes an existing Confidential Ledger. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ledgerName Name of the Confidential Ledger. * @param context The context to associate with this operation. @@ -69,23 +71,23 @@ Response getByResourceGroupWithResponse( /** * Retrieves information about all Confidential Ledger resources under the given subscription and resource group - * - *

Retrieves the properties of all Confidential Ledgers. - * + * + * Retrieves the properties of all Confidential Ledgers. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 object that includes an array of Confidential Ledgers and a possible link for next set as paginated - * response with {@link PagedIterable}. + * response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); /** * Retrieves information about all Confidential Ledger resources under the given subscription and resource group - * - *

Retrieves the properties of all Confidential Ledgers. - * + * + * Retrieves the properties of all Confidential Ledgers. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @param context The context to associate with this operation. @@ -93,42 +95,108 @@ Response getByResourceGroupWithResponse( * @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 object that includes an array of Confidential Ledgers and a possible link for next set as paginated - * response with {@link PagedIterable}. + * response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, String filter, Context context); /** * Retrieves information about all Confidential Ledger resources under the given subscription - * - *

Retrieves the properties of all Confidential Ledgers. - * + * + * Retrieves the properties of all Confidential Ledgers. + * * @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 object that includes an array of Confidential Ledgers and a possible link for next set as paginated - * response with {@link PagedIterable}. + * response with {@link PagedIterable}. */ PagedIterable list(); /** * Retrieves information about all Confidential Ledger resources under the given subscription - * - *

Retrieves the properties of all Confidential Ledgers. - * + * + * Retrieves the properties of all Confidential Ledgers. + * * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Confidential Ledgers and a possible link for next set as paginated - * response with {@link PagedIterable}. + * response with {@link PagedIterable}. */ PagedIterable list(String filter, Context context); + /** + * Performs the backup operation on a Confidential Ledger Resource. + * + * Backs up a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Backup Request Body. + * @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 object representing the backup response of a Confidential Ledger Resource. + */ + ConfidentialLedgerBackupResponse backup(String resourceGroupName, String ledgerName, + ConfidentialLedgerBackup confidentialLedger); + + /** + * Performs the backup operation on a Confidential Ledger Resource. + * + * Backs up a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Backup Request Body. + * @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 object representing the backup response of a Confidential Ledger Resource. + */ + ConfidentialLedgerBackupResponse backup(String resourceGroupName, String ledgerName, + ConfidentialLedgerBackup confidentialLedger, Context context); + + /** + * Performs the restore operation to spin up a newly restored Confidential Ledger Resource. + * + * Restores a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Restore Request Body. + * @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 object representing the restore response of a Confidential Ledger Resource. + */ + ConfidentialLedgerRestoreResponse restore(String resourceGroupName, String ledgerName, + ConfidentialLedgerRestore confidentialLedger); + + /** + * Performs the restore operation to spin up a newly restored Confidential Ledger Resource. + * + * Restores a Confidential Ledger Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ledgerName Name of the Confidential Ledger. + * @param confidentialLedger Confidential Ledger Restore Request Body. + * @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 object representing the restore response of a Confidential Ledger Resource. + */ + ConfidentialLedgerRestoreResponse restore(String resourceGroupName, String ledgerName, + ConfidentialLedgerRestore confidentialLedger, Context context); + /** * Retrieves information about a Confidential Ledger resource. - * - *

Retrieves the properties of a Confidential Ledger. - * + * + * Retrieves the properties of a Confidential Ledger. + * * @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. @@ -139,9 +207,9 @@ Response getByResourceGroupWithResponse( /** * Retrieves information about a Confidential Ledger resource. - * - *

Retrieves the properties of a Confidential Ledger. - * + * + * Retrieves the properties of a Confidential Ledger. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -153,9 +221,9 @@ Response getByResourceGroupWithResponse( /** * Deletes a Confidential Ledger resource. - * - *

Deletes an existing Confidential Ledger. - * + * + * Deletes an existing Confidential Ledger. + * * @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. @@ -165,9 +233,9 @@ Response getByResourceGroupWithResponse( /** * Deletes a Confidential Ledger resource. - * - *

Deletes an existing Confidential Ledger. - * + * + * Deletes an existing Confidential Ledger. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -178,7 +246,7 @@ Response getByResourceGroupWithResponse( /** * Begins definition for a new ConfidentialLedger resource. - * + * * @param name resource name. * @return the first stage of the new ConfidentialLedger definition. */ diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcf.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcf.java index 8e74dccb8be6..1c72cc4530c5 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcf.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcf.java @@ -10,97 +10,113 @@ import com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfInner; import java.util.Map; -/** An immutable client-side representation of ManagedCcf. */ +/** + * An immutable client-side representation of ManagedCcf. + */ public interface ManagedCcf { /** * 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 properties property: ManagedCCFProperties - * - *

Properties of Managed CCF Resource. - * + * + * Properties of Managed CCF Resource. + * * @return the properties value. */ ManagedCcfProperties properties(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfInner object. - * + * * @return the inner object. */ ManagedCcfInner innerModel(); - /** The entirety of the ManagedCcf definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithCreate { + /** + * The entirety of the ManagedCcf definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } - /** The ManagedCcf definition stages. */ + + /** + * The ManagedCcf definition stages. + */ interface DefinitionStages { - /** The first stage of the ManagedCcf definition. */ + /** + * The first stage of the ManagedCcf definition. + */ interface Blank extends WithLocation { } - /** The stage of the ManagedCcf definition allowing to specify location. */ + + /** + * The stage of the ManagedCcf 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. */ @@ -108,22 +124,26 @@ interface WithLocation { /** * 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 ManagedCcf definition allowing to specify parent resource. */ + + /** + * The stage of the ManagedCcf definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the ManagedCcf 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. @@ -131,55 +151,179 @@ interface WithResourceGroup { interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { /** * Executes the create request. - * + * * @return the created resource. */ ManagedCcf create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ ManagedCcf create(Context context); } - /** The stage of the ManagedCcf definition allowing to specify tags. */ + + /** + * The stage of the ManagedCcf 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 ManagedCcf definition allowing to specify properties. */ + + /** + * The stage of the ManagedCcf definition allowing to specify properties. + */ interface WithProperties { /** * Specifies the properties property: ManagedCCFProperties - * - *

Properties of Managed CCF Resource.. - * + * + * Properties of Managed CCF Resource.. + * * @param properties ManagedCCFProperties - *

Properties of Managed CCF Resource. + * + * Properties of Managed CCF Resource. * @return the next definition stage. */ WithCreate withProperties(ManagedCcfProperties properties); } } + + /** + * Begins update for the ManagedCcf resource. + * + * @return the stage of resource update. + */ + ManagedCcf.Update update(); + + /** + * The template for ManagedCcf update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ManagedCcf apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ManagedCcf apply(Context context); + } + + /** + * The ManagedCcf update stages. + */ + interface UpdateStages { + /** + * The stage of the ManagedCcf update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the ManagedCcf update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: ManagedCCFProperties + * + * Properties of Managed CCF Resource.. + * + * @param properties ManagedCCFProperties + * + * Properties of Managed CCF Resource. + * @return the next definition stage. + */ + Update withProperties(ManagedCcfProperties properties); + } + } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ ManagedCcf refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ ManagedCcf refresh(Context context); + + /** + * Performs the backup operation on a Managed CCF Resource. + * + * Backs up a Managed CCF Resource. + * + * @param managedCcf Managed CCF Backup Request Body. + * @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 object representing the backup response of a Managed CCF Resource. + */ + ManagedCcfBackupResponse backup(ManagedCcfBackup managedCcf); + + /** + * Performs the backup operation on a Managed CCF Resource. + * + * Backs up a Managed CCF Resource. + * + * @param managedCcf Managed CCF Backup Request Body. + * @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 object representing the backup response of a Managed CCF Resource. + */ + ManagedCcfBackupResponse backup(ManagedCcfBackup managedCcf, Context context); + + /** + * Performs the restore operation to spin up a newly restored Managed CCF Resource. + * + * Restores a Managed CCF Resource. + * + * @param managedCcf Managed CCF Restore Request Body. + * @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 object representing the restore response of a Managed CCF Resource. + */ + ManagedCcfRestoreResponse restore(ManagedCcfRestore managedCcf); + + /** + * Performs the restore operation to spin up a newly restored Managed CCF Resource. + * + * Restores a Managed CCF Resource. + * + * @param managedCcf Managed CCF Restore Request Body. + * @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 object representing the restore response of a Managed CCF Resource. + */ + ManagedCcfRestoreResponse restore(ManagedCcfRestore managedCcf, Context context); } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfBackup.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfBackup.java new file mode 100644 index 000000000000..8ba605a12d6e --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfBackup.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.confidentialledger.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Object representing Backup properties of a Managed CCF Resource. + */ +@Fluent +public final class ManagedCcfBackup { + /* + * The region where the backup of the managed CCF resource will eventually be restored to. + */ + @JsonProperty(value = "restoreRegion") + private String restoreRegion; + + /* + * SAS URI used to access the backup Fileshare. + */ + @JsonProperty(value = "uri") + private String uri; + + /** + * Creates an instance of ManagedCcfBackup class. + */ + public ManagedCcfBackup() { + } + + /** + * Get the restoreRegion property: The region where the backup of the managed CCF resource will eventually be + * restored to. + * + * @return the restoreRegion value. + */ + public String restoreRegion() { + return this.restoreRegion; + } + + /** + * Set the restoreRegion property: The region where the backup of the managed CCF resource will eventually be + * restored to. + * + * @param restoreRegion the restoreRegion value to set. + * @return the ManagedCcfBackup object itself. + */ + public ManagedCcfBackup withRestoreRegion(String restoreRegion) { + this.restoreRegion = restoreRegion; + return this; + } + + /** + * Get the uri property: SAS URI used to access the backup Fileshare. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: SAS URI used to access the backup Fileshare. + * + * @param uri the uri value to set. + * @return the ManagedCcfBackup object itself. + */ + public ManagedCcfBackup withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (uri() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property uri in model ManagedCcfBackup")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedCcfBackup.class); +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfBackupResponse.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfBackupResponse.java new file mode 100644 index 000000000000..266d0f042da7 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfBackupResponse.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.confidentialledger.models; + +import com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfBackupResponseInner; + +/** + * An immutable client-side representation of ManagedCcfBackupResponse. + */ +public interface ManagedCcfBackupResponse { + /** + * Gets the message property: Response body stating if the managed CCF resource is being backed up. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfBackupResponseInner object. + * + * @return the inner object. + */ + ManagedCcfBackupResponseInner innerModel(); +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfList.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfList.java index 7daba6213dcf..07107f84a758 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfList.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfList.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Object that includes an array of Managed CCF and a possible link for next set. */ +/** + * Object that includes an array of Managed CCF and a possible link for next set. + */ @Fluent public final class ManagedCcfList { /* @@ -24,13 +26,15 @@ public final class ManagedCcfList { @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of ManagedCcfList class. */ + /** + * Creates an instance of ManagedCcfList class. + */ public ManagedCcfList() { } /** * Get the value property: List of Managed CCF. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Set the value property: List of Managed CCF. - * + * * @param value the value value to set. * @return the ManagedCcfList object itself. */ @@ -50,7 +54,7 @@ public ManagedCcfList withValue(List value) { /** * Get the nextLink property: The URL the client should use to fetch the next page (per server side paging). - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +63,7 @@ public String nextLink() { /** * Set the nextLink property: The URL the client should use to fetch the next page (per server side paging). - * + * * @param nextLink the nextLink value to set. * @return the ManagedCcfList object itself. */ @@ -70,7 +74,7 @@ public ManagedCcfList withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfProperties.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfProperties.java index 7f3ee6d2a85e..d13e09fabe7a 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfProperties.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfProperties.java @@ -10,8 +10,8 @@ /** * ManagedCCFProperties - * - *

Additional Managed CCF properties. + * + * Additional Managed CCF properties. */ @Fluent public final class ManagedCcfProperties { @@ -41,33 +41,41 @@ public final class ManagedCcfProperties { /* * DeploymentType - * + * * Deployment Type of Managed CCF */ @JsonProperty(value = "deploymentType") private DeploymentType deploymentType; /* - * Provisioning state of Ledger Resource + * Object representing RunningState for Managed CCF. + */ + @JsonProperty(value = "runningState") + private RunningState runningState; + + /* + * Provisioning state of Managed CCF Resource */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /* * NodeCount - * + * * Number of CCF nodes in the Managed CCF. */ @JsonProperty(value = "nodeCount") private Integer nodeCount; - /** Creates an instance of ManagedCcfProperties class. */ + /** + * Creates an instance of ManagedCcfProperties class. + */ public ManagedCcfProperties() { } /** * Get the appName property: Unique name for the Managed CCF. - * + * * @return the appName value. */ public String appName() { @@ -76,7 +84,7 @@ public String appName() { /** * Get the appUri property: Endpoint for calling Managed CCF Service. - * + * * @return the appUri value. */ public String appUri() { @@ -85,7 +93,7 @@ public String appUri() { /** * Get the identityServiceUri property: Endpoint for accessing network identity. - * + * * @return the identityServiceUri value. */ public String identityServiceUri() { @@ -94,7 +102,7 @@ public String identityServiceUri() { /** * Get the memberIdentityCertificates property: List of member identity certificates for Managed CCF. - * + * * @return the memberIdentityCertificates value. */ public List memberIdentityCertificates() { @@ -103,21 +111,21 @@ public List memberIdentityCertificates() { /** * Set the memberIdentityCertificates property: List of member identity certificates for Managed CCF. - * + * * @param memberIdentityCertificates the memberIdentityCertificates value to set. * @return the ManagedCcfProperties object itself. */ - public ManagedCcfProperties withMemberIdentityCertificates( - List memberIdentityCertificates) { + public ManagedCcfProperties + withMemberIdentityCertificates(List memberIdentityCertificates) { this.memberIdentityCertificates = memberIdentityCertificates; return this; } /** * Get the deploymentType property: DeploymentType - * - *

Deployment Type of Managed CCF. - * + * + * Deployment Type of Managed CCF. + * * @return the deploymentType value. */ public DeploymentType deploymentType() { @@ -126,9 +134,9 @@ public DeploymentType deploymentType() { /** * Set the deploymentType property: DeploymentType - * - *

Deployment Type of Managed CCF. - * + * + * Deployment Type of Managed CCF. + * * @param deploymentType the deploymentType value to set. * @return the ManagedCcfProperties object itself. */ @@ -138,8 +146,28 @@ public ManagedCcfProperties withDeploymentType(DeploymentType deploymentType) { } /** - * Get the provisioningState property: Provisioning state of Ledger Resource. - * + * Get the runningState property: Object representing RunningState for Managed CCF. + * + * @return the runningState value. + */ + public RunningState runningState() { + return this.runningState; + } + + /** + * Set the runningState property: Object representing RunningState for Managed CCF. + * + * @param runningState the runningState value to set. + * @return the ManagedCcfProperties object itself. + */ + public ManagedCcfProperties withRunningState(RunningState runningState) { + this.runningState = runningState; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of Managed CCF Resource. + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -148,9 +176,9 @@ public ProvisioningState provisioningState() { /** * Get the nodeCount property: NodeCount - * - *

Number of CCF nodes in the Managed CCF. - * + * + * Number of CCF nodes in the Managed CCF. + * * @return the nodeCount value. */ public Integer nodeCount() { @@ -159,9 +187,9 @@ public Integer nodeCount() { /** * Set the nodeCount property: NodeCount - * - *

Number of CCF nodes in the Managed CCF. - * + * + * Number of CCF nodes in the Managed CCF. + * * @param nodeCount the nodeCount value to set. * @return the ManagedCcfProperties object itself. */ @@ -172,7 +200,7 @@ public ManagedCcfProperties withNodeCount(Integer nodeCount) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfRestore.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfRestore.java new file mode 100644 index 000000000000..1e3727d346a7 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfRestore.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.confidentialledger.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Object representing Restore properties of Managed CCF Resource. + */ +@Fluent +public final class ManagedCcfRestore { + /* + * Fileshare where the managed CCF resource backup is stored. + */ + @JsonProperty(value = "fileShareName", required = true) + private String fileShareName; + + /* + * The region the managed CCF resource is being restored to. + */ + @JsonProperty(value = "restoreRegion", required = true) + private String restoreRegion; + + /* + * SAS URI used to access the backup Fileshare. + */ + @JsonProperty(value = "uri") + private String uri; + + /** + * Creates an instance of ManagedCcfRestore class. + */ + public ManagedCcfRestore() { + } + + /** + * Get the fileShareName property: Fileshare where the managed CCF resource backup is stored. + * + * @return the fileShareName value. + */ + public String fileShareName() { + return this.fileShareName; + } + + /** + * Set the fileShareName property: Fileshare where the managed CCF resource backup is stored. + * + * @param fileShareName the fileShareName value to set. + * @return the ManagedCcfRestore object itself. + */ + public ManagedCcfRestore withFileShareName(String fileShareName) { + this.fileShareName = fileShareName; + return this; + } + + /** + * Get the restoreRegion property: The region the managed CCF resource is being restored to. + * + * @return the restoreRegion value. + */ + public String restoreRegion() { + return this.restoreRegion; + } + + /** + * Set the restoreRegion property: The region the managed CCF resource is being restored to. + * + * @param restoreRegion the restoreRegion value to set. + * @return the ManagedCcfRestore object itself. + */ + public ManagedCcfRestore withRestoreRegion(String restoreRegion) { + this.restoreRegion = restoreRegion; + return this; + } + + /** + * Get the uri property: SAS URI used to access the backup Fileshare. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: SAS URI used to access the backup Fileshare. + * + * @param uri the uri value to set. + * @return the ManagedCcfRestore object itself. + */ + public ManagedCcfRestore withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (fileShareName() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property fileShareName in model ManagedCcfRestore")); + } + if (restoreRegion() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property restoreRegion in model ManagedCcfRestore")); + } + if (uri() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property uri in model ManagedCcfRestore")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedCcfRestore.class); +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfRestoreResponse.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfRestoreResponse.java new file mode 100644 index 000000000000..398f4301a584 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfRestoreResponse.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.confidentialledger.models; + +import com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfRestoreResponseInner; + +/** + * An immutable client-side representation of ManagedCcfRestoreResponse. + */ +public interface ManagedCcfRestoreResponse { + /** + * Gets the message property: Response body stating if the managed CCF resource is being restored. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfRestoreResponseInner object. + * + * @return the inner object. + */ + ManagedCcfRestoreResponseInner innerModel(); +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfs.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfs.java index b01ea9e89b09..b0ec1b6d9fa4 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfs.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ManagedCcfs.java @@ -7,15 +7,16 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfInner; -/** Resource collection API of ManagedCcfs. */ +/** + * Resource collection API of ManagedCcfs. + */ public interface ManagedCcfs { /** * Retrieves information about a Managed CCF resource. - * - *

Retrieves the properties of a Managed CCF app. - * + * + * Retrieves the properties of a Managed CCF app. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param context The context to associate with this operation. @@ -28,9 +29,9 @@ public interface ManagedCcfs { /** * Retrieves information about a Managed CCF resource. - * - *

Retrieves the properties of a Managed CCF app. - * + * + * Retrieves the properties of a Managed CCF app. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -42,9 +43,9 @@ public interface ManagedCcfs { /** * Deletes a Managed CCF resource. - * - *

Deletes an existing Managed CCF. - * + * + * Deletes an existing Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -55,9 +56,9 @@ public interface ManagedCcfs { /** * Deletes a Managed CCF resource. - * - *

Deletes an existing Managed CCF. - * + * + * Deletes an existing Managed CCF. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param context The context to associate with this operation. @@ -68,96 +69,131 @@ public interface ManagedCcfs { void delete(String resourceGroupName, String appName, Context context); /** - * Update Managed CCF properties - * - *

Updates properties of Managed CCF. - * + * Retrieves information about all Managed CCF resources under the given subscription and resource group + * + * Retrieves the properties of all Managed CCF apps. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appName Name of the Managed CCF. - * @param managedCcf Request body for Updating Managed CCF App. * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with + * {@link PagedIterable}. */ - void update(String resourceGroupName, String appName, ManagedCcfInner managedCcf); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Update Managed CCF properties - * - *

Updates properties of Managed CCF. - * + * Retrieves information about all Managed CCF resources under the given subscription and resource group + * + * Retrieves the properties of all Managed CCF apps. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param appName Name of the Managed CCF. - * @param managedCcf Request body for Updating Managed CCF App. + * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with + * {@link PagedIterable}. */ - void update(String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context); + PagedIterable listByResourceGroup(String resourceGroupName, String filter, Context context); /** - * Retrieves information about all Managed CCF resources under the given subscription and resource group - * - *

Retrieves the properties of all Managed CCF apps. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * Retrieves information about all Managed CCF resources under the given subscription + * + * Retrieves the properties of all Managed CCF. + * * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + PagedIterable list(); /** - * Retrieves information about all Managed CCF resources under the given subscription and resource group - * - *

Retrieves the properties of all Managed CCF apps. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * Retrieves information about all Managed CCF resources under the given subscription + * + * Retrieves the properties of all Managed CCF. + * * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName, String filter, Context context); + PagedIterable list(String filter, Context context); /** - * Retrieves information about all Managed CCF resources under the given subscription - * - *

Retrieves the properties of all Managed CCF. - * + * Performs the backup operation on a Managed CCF Resource. + * + * Backs up a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Backup Request Body. + * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with - * {@link PagedIterable}. + * @return object representing the backup response of a Managed CCF Resource. */ - PagedIterable list(); + ManagedCcfBackupResponse backup(String resourceGroupName, String appName, ManagedCcfBackup managedCcf); /** - * Retrieves information about all Managed CCF resources under the given subscription - * - *

Retrieves the properties of all Managed CCF. - * - * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. + * Performs the backup operation on a Managed CCF Resource. + * + * Backs up a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Backup Request Body. * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with - * {@link PagedIterable}. + * @return object representing the backup response of a Managed CCF Resource. */ - PagedIterable list(String filter, Context context); + ManagedCcfBackupResponse backup(String resourceGroupName, String appName, ManagedCcfBackup managedCcf, + Context context); + + /** + * Performs the restore operation to spin up a newly restored Managed CCF Resource. + * + * Restores a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Restore Request Body. + * @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 object representing the restore response of a Managed CCF Resource. + */ + ManagedCcfRestoreResponse restore(String resourceGroupName, String appName, ManagedCcfRestore managedCcf); + + /** + * Performs the restore operation to spin up a newly restored Managed CCF Resource. + * + * Restores a Managed CCF Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appName Name of the Managed CCF. + * @param managedCcf Managed CCF Restore Request Body. + * @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 object representing the restore response of a Managed CCF Resource. + */ + ManagedCcfRestoreResponse restore(String resourceGroupName, String appName, ManagedCcfRestore managedCcf, + Context context); /** * Retrieves information about a Managed CCF resource. - * - *

Retrieves the properties of a Managed CCF app. - * + * + * Retrieves the properties of a Managed CCF app. + * * @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. @@ -168,9 +204,9 @@ public interface ManagedCcfs { /** * Retrieves information about a Managed CCF resource. - * - *

Retrieves the properties of a Managed CCF app. - * + * + * Retrieves the properties of a Managed CCF app. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -182,9 +218,9 @@ public interface ManagedCcfs { /** * Deletes a Managed CCF resource. - * - *

Deletes an existing Managed CCF. - * + * + * Deletes an existing Managed CCF. + * * @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. @@ -194,9 +230,9 @@ public interface ManagedCcfs { /** * Deletes a Managed CCF resource. - * - *

Deletes an existing Managed CCF. - * + * + * Deletes an existing Managed CCF. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -207,7 +243,7 @@ public interface ManagedCcfs { /** * Begins definition for a new ManagedCcf resource. - * + * * @param name resource name. * @return the first stage of the new ManagedCcf definition. */ diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/MemberIdentityCertificate.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/MemberIdentityCertificate.java index 831f4bdcbc0e..fe5b26224a1c 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/MemberIdentityCertificate.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/MemberIdentityCertificate.java @@ -9,8 +9,8 @@ /** * MemberIdentityCertificate - * - *

Object representing MemberIdentityCertificate for Managed CCF. + * + * Object representing MemberIdentityCertificate for Managed CCF. */ @Fluent public final class MemberIdentityCertificate { @@ -32,13 +32,15 @@ public final class MemberIdentityCertificate { @JsonProperty(value = "tags") private Object tags; - /** Creates an instance of MemberIdentityCertificate class. */ + /** + * Creates an instance of MemberIdentityCertificate class. + */ public MemberIdentityCertificate() { } /** * Get the certificate property: Member Identity Certificate. - * + * * @return the certificate value. */ public String certificate() { @@ -47,7 +49,7 @@ public String certificate() { /** * Set the certificate property: Member Identity Certificate. - * + * * @param certificate the certificate value to set. * @return the MemberIdentityCertificate object itself. */ @@ -58,7 +60,7 @@ public MemberIdentityCertificate withCertificate(String certificate) { /** * Get the encryptionkey property: Member Identity Certificate Encryption Key. - * + * * @return the encryptionkey value. */ public String encryptionkey() { @@ -67,7 +69,7 @@ public String encryptionkey() { /** * Set the encryptionkey property: Member Identity Certificate Encryption Key. - * + * * @param encryptionkey the encryptionkey value to set. * @return the MemberIdentityCertificate object itself. */ @@ -78,7 +80,7 @@ public MemberIdentityCertificate withEncryptionkey(String encryptionkey) { /** * Get the tags property: Anything. - * + * * @return the tags value. */ public Object tags() { @@ -87,7 +89,7 @@ public Object tags() { /** * Set the tags property: Anything. - * + * * @param tags the tags value to set. * @return the MemberIdentityCertificate object itself. */ @@ -98,7 +100,7 @@ public MemberIdentityCertificate withTags(Object tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/Operations.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/Operations.java index a9fa628ca1b8..350cb2010e64 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/Operations.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/Operations.java @@ -7,31 +7,33 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of Operations. */ +/** + * Resource collection API of Operations. + */ public interface Operations { /** * Retrieves a list of available API operations under this Resource Provider. - * - *

Retrieves a list of available API operations. - * + * + * Retrieves a list of available API operations. + * * @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 list containing this Resource Provider's available operations as paginated response with {@link - * PagedIterable}. + * @return list containing this Resource Provider's available operations as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); /** * Retrieves a list of available API operations under this Resource Provider. - * - *

Retrieves a list of available API operations. - * + * + * Retrieves a list of available API operations. + * * @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 list containing this Resource Provider's available operations as paginated response with {@link - * PagedIterable}. + * @return list containing this Resource Provider's available operations as paginated response with + * {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ProvisioningState.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ProvisioningState.java index fcd73e28021d..99bf6578b3c9 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ProvisioningState.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ProvisioningState.java @@ -8,32 +8,48 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Object representing ProvisioningState for Confidential Ledger. */ +/** + * Object representing ProvisioningState for Confidential Ledger. + */ public final class ProvisioningState extends ExpandableStringEnum { - /** Static value Unknown for ProvisioningState. */ + /** + * Static value Unknown for ProvisioningState. + */ public static final ProvisioningState UNKNOWN = fromString("Unknown"); - /** Static value Succeeded for ProvisioningState. */ + /** + * Static value Succeeded for ProvisioningState. + */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for ProvisioningState. */ + /** + * Static value Failed for ProvisioningState. + */ public static final ProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for ProvisioningState. */ + /** + * Static value Canceled for ProvisioningState. + */ public static final ProvisioningState CANCELED = fromString("Canceled"); - /** Static value Creating for ProvisioningState. */ + /** + * Static value Creating for ProvisioningState. + */ public static final ProvisioningState CREATING = fromString("Creating"); - /** Static value Deleting for ProvisioningState. */ + /** + * Static value Deleting for ProvisioningState. + */ public static final ProvisioningState DELETING = fromString("Deleting"); - /** Static value Updating for ProvisioningState. */ + /** + * Static value Updating for ProvisioningState. + */ public static final ProvisioningState UPDATING = fromString("Updating"); /** * Creates a new instance of ProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -42,7 +58,7 @@ public ProvisioningState() { /** * Creates or finds a ProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding ProvisioningState. */ @@ -53,7 +69,7 @@ public static ProvisioningState fromString(String name) { /** * Gets known ProvisioningState values. - * + * * @return known ProvisioningState values. */ public static Collection values() { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ResourceProviderOperationDefinition.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ResourceProviderOperationDefinition.java index 1c9ace1cf67e..71f31bef74a3 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ResourceProviderOperationDefinition.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ResourceProviderOperationDefinition.java @@ -6,25 +6,27 @@ import com.azure.resourcemanager.confidentialledger.fluent.models.ResourceProviderOperationDefinitionInner; -/** An immutable client-side representation of ResourceProviderOperationDefinition. */ +/** + * An immutable client-side representation of ResourceProviderOperationDefinition. + */ public interface ResourceProviderOperationDefinition { /** * Gets the name property: Resource provider operation name. - * + * * @return the name value. */ String name(); /** * Gets the isDataAction property: Indicates whether the operation is data action or not. - * + * * @return the isDataAction value. */ Boolean isDataAction(); /** * Gets the display property: Details about the operations. - * + * * @return the display value. */ ResourceProviderOperationDisplay display(); @@ -32,7 +34,7 @@ public interface ResourceProviderOperationDefinition { /** * Gets the inner * com.azure.resourcemanager.confidentialledger.fluent.models.ResourceProviderOperationDefinitionInner object. - * + * * @return the inner object. */ ResourceProviderOperationDefinitionInner innerModel(); diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ResourceProviderOperationDisplay.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ResourceProviderOperationDisplay.java index ee30d22120bb..e05f4edd0a3b 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ResourceProviderOperationDisplay.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ResourceProviderOperationDisplay.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Describes the properties of the Operation. */ +/** + * Describes the properties of the Operation. + */ @Fluent public final class ResourceProviderOperationDisplay { /* @@ -34,13 +36,15 @@ public final class ResourceProviderOperationDisplay { @JsonProperty(value = "description") private String description; - /** Creates an instance of ResourceProviderOperationDisplay class. */ + /** + * Creates an instance of ResourceProviderOperationDisplay class. + */ public ResourceProviderOperationDisplay() { } /** * Get the provider property: Name of the resource provider. - * + * * @return the provider value. */ public String provider() { @@ -49,7 +53,7 @@ public String provider() { /** * Set the provider property: Name of the resource provider. - * + * * @param provider the provider value to set. * @return the ResourceProviderOperationDisplay object itself. */ @@ -60,7 +64,7 @@ public ResourceProviderOperationDisplay withProvider(String provider) { /** * Get the resource property: Name of the resource type. - * + * * @return the resource value. */ public String resource() { @@ -69,7 +73,7 @@ public String resource() { /** * Set the resource property: Name of the resource type. - * + * * @param resource the resource value to set. * @return the ResourceProviderOperationDisplay object itself. */ @@ -80,7 +84,7 @@ public ResourceProviderOperationDisplay withResource(String resource) { /** * Get the operation property: Name of the resource provider operation. - * + * * @return the operation value. */ public String operation() { @@ -89,7 +93,7 @@ public String operation() { /** * Set the operation property: Name of the resource provider operation. - * + * * @param operation the operation value to set. * @return the ResourceProviderOperationDisplay object itself. */ @@ -100,7 +104,7 @@ public ResourceProviderOperationDisplay withOperation(String operation) { /** * Get the description property: Description of the resource provider operation. - * + * * @return the description value. */ public String description() { @@ -109,7 +113,7 @@ public String description() { /** * Set the description property: Description of the resource provider operation. - * + * * @param description the description value to set. * @return the ResourceProviderOperationDisplay object itself. */ @@ -120,7 +124,7 @@ public ResourceProviderOperationDisplay withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ResourceProviderOperationList.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ResourceProviderOperationList.java index e0510cb9b206..222b7f874154 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ResourceProviderOperationList.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ResourceProviderOperationList.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List containing this Resource Provider's available operations. */ +/** + * List containing this Resource Provider's available operations. + */ @Immutable public final class ResourceProviderOperationList { /* @@ -24,13 +26,15 @@ public final class ResourceProviderOperationList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of ResourceProviderOperationList class. */ + /** + * Creates an instance of ResourceProviderOperationList class. + */ public ResourceProviderOperationList() { } /** * Get the value property: Resource provider operations list. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Get the nextLink property: The URI that can be used to request the next page for list of Azure operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -48,7 +52,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ResourceProviders.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ResourceProviders.java index 0d63c5ff7ab8..d9fe621ab7e1 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ResourceProviders.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/ResourceProviders.java @@ -7,11 +7,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of ResourceProviders. */ +/** + * Resource collection API of ResourceProviders. + */ public interface ResourceProviders { /** * To check whether a resource name is available. - * + * * @param nameAvailabilityRequest Name availability request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -19,12 +21,12 @@ public interface ResourceProviders { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the check availability result along with {@link Response}. */ - Response checkNameAvailabilityWithResponse( - CheckNameAvailabilityRequest nameAvailabilityRequest, Context context); + Response + checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest nameAvailabilityRequest, Context context); /** * To check whether a resource name is available. - * + * * @param nameAvailabilityRequest Name availability request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/RunningState.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/RunningState.java index 51b4bc98da45..f31effa5d3f6 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/RunningState.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/RunningState.java @@ -8,26 +8,38 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Object representing RunningState for Confidential Ledger. */ +/** + * Object representing RunningState for Confidential Ledger. + */ public final class RunningState extends ExpandableStringEnum { - /** Static value Active for RunningState. */ + /** + * Static value Active for RunningState. + */ public static final RunningState ACTIVE = fromString("Active"); - /** Static value Paused for RunningState. */ + /** + * Static value Paused for RunningState. + */ public static final RunningState PAUSED = fromString("Paused"); - /** Static value Unknown for RunningState. */ + /** + * Static value Unknown for RunningState. + */ public static final RunningState UNKNOWN = fromString("Unknown"); - /** Static value Pausing for RunningState. */ + /** + * Static value Pausing for RunningState. + */ public static final RunningState PAUSING = fromString("Pausing"); - /** Static value Resuming for RunningState. */ + /** + * Static value Resuming for RunningState. + */ public static final RunningState RESUMING = fromString("Resuming"); /** * Creates a new instance of RunningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,7 +48,7 @@ public RunningState() { /** * Creates or finds a RunningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding RunningState. */ @@ -47,7 +59,7 @@ public static RunningState fromString(String name) { /** * Gets known RunningState values. - * + * * @return known RunningState values. */ public static Collection values() { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/package-info.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/package-info.java index 6174d0311fe4..d61bdc8f4f56 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/package-info.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/models/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the data models for ConfidentialLedgerManagementClient. Microsoft Azure Confidential Compute - * Ledger Control Plane REST API version 2020-12-01-preview. + * Package containing the data models for ConfidentialLedgerManagementClient. + * Microsoft Azure Confidential Compute Ledger Control Plane REST API version 2020-12-01-preview. */ package com.azure.resourcemanager.confidentialledger.models; diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/package-info.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/package-info.java index 31daf1621a12..53576b31c29c 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/package-info.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/com/azure/resourcemanager/confidentialledger/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the classes for ConfidentialLedgerManagementClient. Microsoft Azure Confidential Compute Ledger - * Control Plane REST API version 2020-12-01-preview. + * Package containing the classes for ConfidentialLedgerManagementClient. + * Microsoft Azure Confidential Compute Ledger Control Plane REST API version 2020-12-01-preview. */ package com.azure.resourcemanager.confidentialledger; diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/module-info.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/module-info.java index 72e4b07e8652..59ddc93f247c 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/module-info.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/java/module-info.java @@ -4,16 +4,10 @@ module com.azure.resourcemanager.confidentialledger { requires transitive com.azure.core.management; - exports com.azure.resourcemanager.confidentialledger; exports com.azure.resourcemanager.confidentialledger.fluent; exports com.azure.resourcemanager.confidentialledger.fluent.models; exports com.azure.resourcemanager.confidentialledger.models; - - opens com.azure.resourcemanager.confidentialledger.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.confidentialledger.models to - com.azure.core, - com.fasterxml.jackson.databind; -} + opens com.azure.resourcemanager.confidentialledger.fluent.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.confidentialledger.models to com.azure.core, com.fasterxml.jackson.databind; +} \ No newline at end of file diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-confidentialledger/proxy-config.json b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-confidentialledger/proxy-config.json new file mode 100644 index 000000000000..8d925ad1f36f --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-confidentialledger/proxy-config.json @@ -0,0 +1 @@ +[ [ "com.azure.resourcemanager.confidentialledger.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.confidentialledger.implementation.ResourceProvidersClientImpl$ResourceProvidersService" ], [ "com.azure.resourcemanager.confidentialledger.implementation.LedgersClientImpl$LedgersService" ], [ "com.azure.resourcemanager.confidentialledger.implementation.ManagedCcfsClientImpl$ManagedCcfsService" ] ] \ No newline at end of file diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-confidentialledger/reflect-config.json b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-confidentialledger/reflect-config.json new file mode 100644 index 000000000000..3ea1fb2f448b --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-confidentialledger/reflect-config.json @@ -0,0 +1,151 @@ +[ { + "name" : "com.azure.resourcemanager.confidentialledger.models.ResourceProviderOperationList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.fluent.models.ResourceProviderOperationDefinitionInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.models.ResourceProviderOperationDisplay", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.models.CheckNameAvailabilityRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.fluent.models.CheckNameAvailabilityResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.models.LedgerProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.models.AadBasedSecurityPrincipal", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.models.CertBasedSecurityPrincipal", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerBackup", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerBackupResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerRestore", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerRestoreResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.models.ManagedCcfProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.models.MemberIdentityCertificate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.models.DeploymentType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.models.ManagedCcfList", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.models.ManagedCcfBackup", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfBackupResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.models.ManagedCcfRestore", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfRestoreResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.models.CheckNameAvailabilityReason", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.models.RunningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.models.LedgerType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.models.ProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.models.LedgerSku", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.models.LedgerRoleName", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.confidentialledger.models.LanguageRuntime", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +} ] \ No newline at end of file diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerBackupSamples.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerBackupSamples.java new file mode 100644 index 000000000000..f0032a93a688 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerBackupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.confidentialledger.generated; + +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerBackup; + +/** + * Samples for Ledger Backup. + */ +public final class LedgerBackupSamples { + /* + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_Backup.json + */ + /** + * Sample code: ConfidentialLedgerBackup. + * + * @param manager Entry point to ConfidentialLedgerManager. + */ + public static void + confidentialLedgerBackup(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + manager.ledgers() + .backup("DummyResourceGroupName", "DummyLedgerName", + new ConfidentialLedgerBackup().withRestoreRegion("EastUS").withUri("DummySASUri"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerCreateSamples.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerCreateSamples.java index d78b16efb0f2..3f502a6c6f59 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerCreateSamples.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerCreateSamples.java @@ -8,51 +8,44 @@ import com.azure.resourcemanager.confidentialledger.models.CertBasedSecurityPrincipal; import com.azure.resourcemanager.confidentialledger.models.LedgerProperties; import com.azure.resourcemanager.confidentialledger.models.LedgerRoleName; +import com.azure.resourcemanager.confidentialledger.models.LedgerSku; import com.azure.resourcemanager.confidentialledger.models.LedgerType; import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for Ledger Create. */ +/** + * Samples for Ledger Create. + */ public final class LedgerCreateSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ConfidentialLedger_Create.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_Create.json */ /** * Sample code: ConfidentialLedgerCreate. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ - public static void confidentialLedgerCreate( - com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { - manager - .ledgers() + public static void + confidentialLedgerCreate(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + manager.ledgers() .define("DummyLedgerName") .withRegion("EastUS") .withExistingResourceGroup("DummyResourceGroupName") .withTags(mapOf("additionalProps1", "additional properties")) - .withProperties( - new LedgerProperties() - .withLedgerType(LedgerType.PUBLIC) - .withAadBasedSecurityPrincipals( - Arrays - .asList( - new AadBasedSecurityPrincipal() - .withPrincipalId("34621747-6fc8-4771-a2eb-72f31c461f2e") - .withTenantId("bce123b9-2b7b-4975-8360-5ca0b9b1cd08") - .withLedgerRoleName(LedgerRoleName.ADMINISTRATOR))) - .withCertBasedSecurityPrincipals( - Arrays - .asList( - new CertBasedSecurityPrincipal() - .withCert( - "-----BEGIN" - + " CERTIFICATE-----MIIBsjCCATigAwIBAgIUZWIbyG79TniQLd2UxJuU74tqrKcwCgYIKoZIzj0EAwMwEDEOMAwGA1UEAwwFdXNlcjAwHhcNMjEwMzE2MTgwNjExWhcNMjIwMzE2MTgwNjExWjAQMQ4wDAYDVQQDDAV1c2VyMDB2MBAGByqGSM49AgEGBSuBBAAiA2IABBiWSo/j8EFit7aUMm5lF+lUmCu+IgfnpFD+7QMgLKtxRJ3aGSqgS/GpqcYVGddnODtSarNE/HyGKUFUolLPQ5ybHcouUk0kyfA7XMeSoUA4lBz63Wha8wmXo+NdBRo39qNTMFEwHQYDVR0OBBYEFPtuhrwgGjDFHeUUT4nGsXaZn69KMB8GA1UdIwQYMBaAFPtuhrwgGjDFHeUUT4nGsXaZn69KMA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwMDaAAwZQIxAOnozm2CyqRwSSQLls5r+mUHRGRyXHXwYtM4Dcst/VEZdmS9fqvHRCHbjUlO/+HNfgIwMWZ4FmsjD3wnPxONOm9YdVn/PRD7SsPRPbOjwBiE4EBGaHDsLjYAGDSGi7NJnSkA-----END" - + " CERTIFICATE-----") - .withLedgerRoleName(LedgerRoleName.READER)))) + .withProperties(new LedgerProperties().withLedgerType(LedgerType.PUBLIC) + .withLedgerSku(LedgerSku.STANDARD) + .withAadBasedSecurityPrincipals(Arrays + .asList(new AadBasedSecurityPrincipal().withPrincipalId("34621747-6fc8-4771-a2eb-72f31c461f2e") + .withTenantId("bce123b9-2b7b-4975-8360-5ca0b9b1cd08") + .withLedgerRoleName(LedgerRoleName.ADMINISTRATOR))) + .withCertBasedSecurityPrincipals(Arrays.asList(new CertBasedSecurityPrincipal().withCert( + "-----BEGIN CERTIFICATE-----MIIBsjCCATigAwIBAgIUZWIbyG79TniQLd2UxJuU74tqrKcwCgYIKoZIzj0EAwMwEDEOMAwGA1UEAwwFdXNlcjAwHhcNMjEwMzE2MTgwNjExWhcNMjIwMzE2MTgwNjExWjAQMQ4wDAYDVQQDDAV1c2VyMDB2MBAGByqGSM49AgEGBSuBBAAiA2IABBiWSo/j8EFit7aUMm5lF+lUmCu+IgfnpFD+7QMgLKtxRJ3aGSqgS/GpqcYVGddnODtSarNE/HyGKUFUolLPQ5ybHcouUk0kyfA7XMeSoUA4lBz63Wha8wmXo+NdBRo39qNTMFEwHQYDVR0OBBYEFPtuhrwgGjDFHeUUT4nGsXaZn69KMB8GA1UdIwQYMBaAFPtuhrwgGjDFHeUUT4nGsXaZn69KMA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwMDaAAwZQIxAOnozm2CyqRwSSQLls5r+mUHRGRyXHXwYtM4Dcst/VEZdmS9fqvHRCHbjUlO/+HNfgIwMWZ4FmsjD3wnPxONOm9YdVn/PRD7SsPRPbOjwBiE4EBGaHDsLjYAGDSGi7NJnSkA-----END CERTIFICATE-----") + .withLedgerRoleName(LedgerRoleName.READER)))) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerDeleteSamples.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerDeleteSamples.java index 8e943b7b3ee8..7ea8d1f71d13 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerDeleteSamples.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerDeleteSamples.java @@ -4,18 +4,20 @@ package com.azure.resourcemanager.confidentialledger.generated; -/** Samples for Ledger Delete. */ +/** + * Samples for Ledger Delete. + */ public final class LedgerDeleteSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ConfidentialLedger_Delete.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_Delete.json */ /** * Sample code: ConfidentialLedgerDelete. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ - public static void confidentialLedgerDelete( - com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + public static void + confidentialLedgerDelete(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { manager.ledgers().delete("DummyResourceGroupName", "DummyLedgerName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerGetByResourceGroupSamples.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerGetByResourceGroupSamples.java index 87773dd4cd43..facce386f4b1 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerGetByResourceGroupSamples.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerGetByResourceGroupSamples.java @@ -4,21 +4,22 @@ package com.azure.resourcemanager.confidentialledger.generated; -/** Samples for Ledger GetByResourceGroup. */ +/** + * Samples for Ledger GetByResourceGroup. + */ public final class LedgerGetByResourceGroupSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ConfidentialLedger_Get.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_Get.json */ /** * Sample code: ConfidentialLedgerGet. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ - public static void confidentialLedgerGet( - com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { - manager - .ledgers() - .getByResourceGroupWithResponse( - "DummyResourceGroupName", "DummyLedgerName", com.azure.core.util.Context.NONE); + public static void + confidentialLedgerGet(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + manager.ledgers() + .getByResourceGroupWithResponse("DummyResourceGroupName", "DummyLedgerName", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerListByResourceGroupSamples.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerListByResourceGroupSamples.java index 8bb4a0374018..b0b7e0396f7e 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerListByResourceGroupSamples.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerListByResourceGroupSamples.java @@ -4,18 +4,20 @@ package com.azure.resourcemanager.confidentialledger.generated; -/** Samples for Ledger ListByResourceGroup. */ +/** + * Samples for Ledger ListByResourceGroup. + */ public final class LedgerListByResourceGroupSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ConfidentialLedger_List.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_List.json */ /** * Sample code: ConfidentialLedgerList. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ - public static void confidentialLedgerList( - com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + public static void + confidentialLedgerList(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { manager.ledgers().listByResourceGroup("DummyResourceGroupName", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerListSamples.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerListSamples.java index 158bec3bcaf2..7226650ccdc0 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerListSamples.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerListSamples.java @@ -4,18 +4,20 @@ package com.azure.resourcemanager.confidentialledger.generated; -/** Samples for Ledger List. */ +/** + * Samples for Ledger List. + */ public final class LedgerListSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ConfidentialLedger_ListBySub.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_ListBySub.json */ /** * Sample code: ConfidentialLedgerListBySub. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ - public static void confidentialLedgerListBySub( - com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + public static void + confidentialLedgerListBySub(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { manager.ledgers().list(null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerRestoreSamples.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerRestoreSamples.java new file mode 100644 index 000000000000..6f2fc9bef6d0 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerRestoreSamples.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.confidentialledger.generated; + +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerRestore; + +/** + * Samples for Ledger Restore. + */ +public final class LedgerRestoreSamples { + /* + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_Restore.json + */ + /** + * Sample code: ConfidentialLedgerRestore. + * + * @param manager Entry point to ConfidentialLedgerManager. + */ + public static void + confidentialLedgerRestore(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + manager.ledgers() + .restore("DummyResourceGroupName", "DummyLedgerName", + new ConfidentialLedgerRestore().withFileShareName("DummyFileShareName") + .withRestoreRegion("EastUS") + .withUri("DummySASUri"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerUpdateSamples.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerUpdateSamples.java index 746c71cfc4ed..8715044cedde 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerUpdateSamples.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/LedgerUpdateSamples.java @@ -14,49 +14,38 @@ import java.util.HashMap; import java.util.Map; -/** Samples for Ledger Update. */ +/** + * Samples for Ledger Update. + */ public final class LedgerUpdateSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ConfidentialLedger_Update.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ConfidentialLedger_Update.json */ /** * Sample code: ConfidentialLedgerUpdate. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ - public static void confidentialLedgerUpdate( - com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { - ConfidentialLedger resource = - manager - .ledgers() - .getByResourceGroupWithResponse( - "DummyResourceGroupName", "DummyLedgerName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void + confidentialLedgerUpdate(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + ConfidentialLedger resource = manager.ledgers() + .getByResourceGroupWithResponse("DummyResourceGroupName", "DummyLedgerName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("additionProps2", "additional property value", "additionalProps1", "additional properties")) - .withProperties( - new LedgerProperties() - .withLedgerType(LedgerType.PUBLIC) - .withAadBasedSecurityPrincipals( - Arrays - .asList( - new AadBasedSecurityPrincipal() - .withPrincipalId("34621747-6fc8-4771-a2eb-72f31c461f2e") - .withTenantId("bce123b9-2b7b-4975-8360-5ca0b9b1cd08") - .withLedgerRoleName(LedgerRoleName.ADMINISTRATOR))) - .withCertBasedSecurityPrincipals( - Arrays - .asList( - new CertBasedSecurityPrincipal() - .withCert( - "-----BEGIN CERTIFICATE-----\n" - + "MIIDUjCCAjqgAwIBAgIQJ2IrDBawSkiAbkBYmiAopDANBgkqhkiG9w0BAQsFADAmMSQwIgYDVQQDExtTeW50aGV0aWNzIExlZGdlciBVc2VyIENlcnQwHhcNMjAwOTIzMjIxODQ2WhcNMjEwOTIzMjIyODQ2WjAmMSQwIgYDVQQDExtTeW50aGV0aWNzIExlZGdlciBVc2VyIENlcnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCX2s/Eu4q/eQ63N+Ugeg5oAciZua/YCJr41c/696szvSY7Zg1SNJlW88/nbz70+QpO55OmqlEE3QCU+T0Vl/h0Gf//n1PYcoBbTGUnYEmV+fTTHict6rFiEwrGJ62tvcpYgwapInSLyEeUzjki0zhOLJ1OfRnYd1eGnFVMpE5aVjiS8Q5dmTEUyd51EIprGE8RYAW9aeWSwTH7gjHUsRlJnHKcdhaK/v5QKJnNu5bzPFUcpC0ZBcizoMPAtroLAD4B68Jl0z3op18MgZe6lRrVoWuxfqnk5GojuB/Vu8ohAZKoFhQ6NB6r+LL2AUs+Zr7Bt26IkEdR178n9JMEA4gHAgMBAAGjfDB6MA4GA1UdDwEB/wQEAwIFoDAJBgNVHRMEAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAfBgNVHSMEGDAWgBS/a7PU9iOfOKEyZCp11Oen5VSuuDAdBgNVHQ4EFgQUv2uz1PYjnzihMmQqddTnp+VUrrgwDQYJKoZIhvcNAQELBQADggEBAF5q2fDwnse8egXhfaJCqqM969E9gSacqFmASpoDJPRPEX7gqoO7v1ww7nqRtRDoRiBvo/yNk7jlSAkRN3nRRnZLZZ3MYQdmCr4FGyIqRg4Y94+nja+Du9pDD761rxRktMVPSOaAVM/E5DQvscDlPvlPYe9mkcrLCE4DXYpiMmLT8Tm55LJJq5m07dVDgzAIR1L/hmEcbK0pnLgzciMtMLxGO2udnyyW/UW9WxnjvrrD2JluTHH9mVbb+XQP1oFtlRBfH7aui1ZgWfKvxrdP4zdK9QoWSUvRux3TLsGmHRBjBMtqYDY3y5mB+aNjLelvWpeVb0m2aOSVXynrLwNCAVA=\n" - + "-----END CERTIFICATE-----") - .withLedgerRoleName(LedgerRoleName.READER)))) + .withProperties(new LedgerProperties().withLedgerType(LedgerType.PUBLIC) + .withAadBasedSecurityPrincipals(Arrays + .asList(new AadBasedSecurityPrincipal().withPrincipalId("34621747-6fc8-4771-a2eb-72f31c461f2e") + .withTenantId("bce123b9-2b7b-4975-8360-5ca0b9b1cd08") + .withLedgerRoleName(LedgerRoleName.ADMINISTRATOR))) + .withCertBasedSecurityPrincipals(Arrays.asList(new CertBasedSecurityPrincipal().withCert( + "-----BEGIN CERTIFICATE-----\nMIIDUjCCAjqgAwIBAgIQJ2IrDBawSkiAbkBYmiAopDANBgkqhkiG9w0BAQsFADAmMSQwIgYDVQQDExtTeW50aGV0aWNzIExlZGdlciBVc2VyIENlcnQwHhcNMjAwOTIzMjIxODQ2WhcNMjEwOTIzMjIyODQ2WjAmMSQwIgYDVQQDExtTeW50aGV0aWNzIExlZGdlciBVc2VyIENlcnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCX2s/Eu4q/eQ63N+Ugeg5oAciZua/YCJr41c/696szvSY7Zg1SNJlW88/nbz70+QpO55OmqlEE3QCU+T0Vl/h0Gf//n1PYcoBbTGUnYEmV+fTTHict6rFiEwrGJ62tvcpYgwapInSLyEeUzjki0zhOLJ1OfRnYd1eGnFVMpE5aVjiS8Q5dmTEUyd51EIprGE8RYAW9aeWSwTH7gjHUsRlJnHKcdhaK/v5QKJnNu5bzPFUcpC0ZBcizoMPAtroLAD4B68Jl0z3op18MgZe6lRrVoWuxfqnk5GojuB/Vu8ohAZKoFhQ6NB6r+LL2AUs+Zr7Bt26IkEdR178n9JMEA4gHAgMBAAGjfDB6MA4GA1UdDwEB/wQEAwIFoDAJBgNVHRMEAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAfBgNVHSMEGDAWgBS/a7PU9iOfOKEyZCp11Oen5VSuuDAdBgNVHQ4EFgQUv2uz1PYjnzihMmQqddTnp+VUrrgwDQYJKoZIhvcNAQELBQADggEBAF5q2fDwnse8egXhfaJCqqM969E9gSacqFmASpoDJPRPEX7gqoO7v1ww7nqRtRDoRiBvo/yNk7jlSAkRN3nRRnZLZZ3MYQdmCr4FGyIqRg4Y94+nja+Du9pDD761rxRktMVPSOaAVM/E5DQvscDlPvlPYe9mkcrLCE4DXYpiMmLT8Tm55LJJq5m07dVDgzAIR1L/hmEcbK0pnLgzciMtMLxGO2udnyyW/UW9WxnjvrrD2JluTHH9mVbb+XQP1oFtlRBfH7aui1ZgWfKvxrdP4zdK9QoWSUvRux3TLsGmHRBjBMtqYDY3y5mB+aNjLelvWpeVb0m2aOSVXynrLwNCAVA=\n-----END CERTIFICATE-----") + .withLedgerRoleName(LedgerRoleName.READER)))) .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfBackupSamples.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfBackupSamples.java new file mode 100644 index 000000000000..b76db99b88d8 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfBackupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.confidentialledger.generated; + +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfBackup; + +/** + * Samples for ManagedCcf Backup. + */ +public final class ManagedCcfBackupSamples { + /* + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_Backup.json + */ + /** + * Sample code: ManagedCCFBackup. + * + * @param manager Entry point to ConfidentialLedgerManager. + */ + public static void + managedCCFBackup(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + manager.managedCcfs() + .backup("DummyResourceGroupName", "DummyMccfAppName", + new ManagedCcfBackup().withRestoreRegion("EastUS").withUri("DummySASUri"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfCreateSamples.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfCreateSamples.java index 87e26338c843..ead29700b385 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfCreateSamples.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfCreateSamples.java @@ -15,51 +15,40 @@ import java.util.HashMap; import java.util.Map; -/** Samples for ManagedCcf Create. */ +/** + * Samples for ManagedCcf Create. + */ public final class ManagedCcfCreateSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ManagedCCF_Create.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_Create.json */ /** * Sample code: ManagedCCFCreate. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ public static void managedCCFCreate(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) throws IOException { - manager - .managedCcfs() + manager.managedCcfs() .define("DummyMccfAppName") .withRegion("EastUS") .withExistingResourceGroup("DummyResourceGroupName") .withTags(mapOf("additionalProps1", "additional properties")) - .withProperties( - new ManagedCcfProperties() - .withMemberIdentityCertificates( - Arrays - .asList( - new MemberIdentityCertificate() - .withCertificate( - "-----BEGIN" - + " CERTIFICATE-----MIIBsjCCATigAwIBAgIUZWIbyG79TniQLd2UxJuU74tqrKcwCgYIKoZIzj0EAwMwEDEOMAwGA1UEAwwFdXNlcjAwHhcNMjEwMzE2MTgwNjExWhcNMjIwMzE2MTgwNjExWjAQMQ4wDAYDVQQDDAV1c2VyMDB2MBAGByqGSM49AgEGBSuBBAAiA2IABBiWSo/j8EFit7aUMm5lF+lUmCu+IgfnpFD+7QMgLKtxRJ3aGSqgS/GpqcYVGddnODtSarNE/HyGKUFUolLPQ5ybHcouUk0kyfA7XMeSoUA4lBz63Wha8wmXo+NdBRo39qNTMFEwHQYDVR0OBBYEFPtuhrwgGjDFHeUUT4nGsXaZn69KMB8GA1UdIwQYMBaAFPtuhrwgGjDFHeUUT4nGsXaZn69KMA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwMDaAAwZQIxAOnozm2CyqRwSSQLls5r+mUHRGRyXHXwYtM4Dcst/VEZdmS9fqvHRCHbjUlO/+HNfgIwMWZ4FmsjD3wnPxONOm9YdVn/PRD7SsPRPbOjwBiE4EBGaHDsLjYAGDSGi7NJnSkA-----END" - + " CERTIFICATE-----") - .withEncryptionkey("fakeTokenPlaceholder") - .withTags( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"additionalProps1\":\"additional properties\"}", - Object.class, - SerializerEncoding.JSON)))) - .withDeploymentType( - new DeploymentType() - .withLanguageRuntime(LanguageRuntime.CPP) - .withAppSourceUri( - "https://myaccount.blob.core.windows.net/storage/mccfsource?sv=2022-02-11%st=2022-03-11")) - .withNodeCount(5)) + .withProperties(new ManagedCcfProperties() + .withMemberIdentityCertificates(Arrays.asList(new MemberIdentityCertificate().withCertificate( + "-----BEGIN CERTIFICATE-----MIIBsjCCATigAwIBAgIUZWIbyG79TniQLd2UxJuU74tqrKcwCgYIKoZIzj0EAwMwEDEOMAwGA1UEAwwFdXNlcjAwHhcNMjEwMzE2MTgwNjExWhcNMjIwMzE2MTgwNjExWjAQMQ4wDAYDVQQDDAV1c2VyMDB2MBAGByqGSM49AgEGBSuBBAAiA2IABBiWSo/j8EFit7aUMm5lF+lUmCu+IgfnpFD+7QMgLKtxRJ3aGSqgS/GpqcYVGddnODtSarNE/HyGKUFUolLPQ5ybHcouUk0kyfA7XMeSoUA4lBz63Wha8wmXo+NdBRo39qNTMFEwHQYDVR0OBBYEFPtuhrwgGjDFHeUUT4nGsXaZn69KMB8GA1UdIwQYMBaAFPtuhrwgGjDFHeUUT4nGsXaZn69KMA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwMDaAAwZQIxAOnozm2CyqRwSSQLls5r+mUHRGRyXHXwYtM4Dcst/VEZdmS9fqvHRCHbjUlO/+HNfgIwMWZ4FmsjD3wnPxONOm9YdVn/PRD7SsPRPbOjwBiE4EBGaHDsLjYAGDSGi7NJnSkA-----END CERTIFICATE-----") + .withEncryptionkey("fakeTokenPlaceholder") + .withTags(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"additionalProps1\":\"additional properties\"}", Object.class, + SerializerEncoding.JSON)))) + .withDeploymentType(new DeploymentType().withLanguageRuntime(LanguageRuntime.CPP) + .withAppSourceUri( + "https://myaccount.blob.core.windows.net/storage/mccfsource?sv=2022-02-11%st=2022-03-11")) + .withNodeCount(5)) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfDeleteSamples.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfDeleteSamples.java index 3a159ab2c5a7..9dcd9b22f05f 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfDeleteSamples.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfDeleteSamples.java @@ -4,18 +4,20 @@ package com.azure.resourcemanager.confidentialledger.generated; -/** Samples for ManagedCcf Delete. */ +/** + * Samples for ManagedCcf Delete. + */ public final class ManagedCcfDeleteSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ManagedCCF_Delete.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_Delete.json */ /** * Sample code: ConfidentialLedgerDelete. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ - public static void confidentialLedgerDelete( - com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + public static void + confidentialLedgerDelete(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { manager.managedCcfs().delete("DummyResourceGroupName", "DummyMccfAppName", com.azure.core.util.Context.NONE); } } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfGetByResourceGroupSamples.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfGetByResourceGroupSamples.java index 0e0a60e8596a..1914c34d5a96 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfGetByResourceGroupSamples.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfGetByResourceGroupSamples.java @@ -4,20 +4,21 @@ package com.azure.resourcemanager.confidentialledger.generated; -/** Samples for ManagedCcf GetByResourceGroup. */ +/** + * Samples for ManagedCcf GetByResourceGroup. + */ public final class ManagedCcfGetByResourceGroupSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ManagedCCF_Get.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_Get.json */ /** * Sample code: ManagedCCFGet. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ public static void managedCCFGet(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { - manager - .managedCcfs() - .getByResourceGroupWithResponse( - "DummyResourceGroupName", "DummyMccfAppName", com.azure.core.util.Context.NONE); + manager.managedCcfs() + .getByResourceGroupWithResponse("DummyResourceGroupName", "DummyMccfAppName", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfListByResourceGroupSamples.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfListByResourceGroupSamples.java index 67e28bf91c16..54e26f95450e 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfListByResourceGroupSamples.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfListByResourceGroupSamples.java @@ -4,14 +4,16 @@ package com.azure.resourcemanager.confidentialledger.generated; -/** Samples for ManagedCcf ListByResourceGroup. */ +/** + * Samples for ManagedCcf ListByResourceGroup. + */ public final class ManagedCcfListByResourceGroupSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ManagedCCF_List.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_List.json */ /** * Sample code: ManagedCCFList. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ public static void managedCCFList(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfListSamples.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfListSamples.java index a0f4f6f56416..bfda499446b4 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfListSamples.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfListSamples.java @@ -4,18 +4,20 @@ package com.azure.resourcemanager.confidentialledger.generated; -/** Samples for ManagedCcf List. */ +/** + * Samples for ManagedCcf List. + */ public final class ManagedCcfListSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ManagedCCF_ListBySub.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_ListBySub.json */ /** * Sample code: ManagedCCFListBySub. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ - public static void managedCCFListBySub( - com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + public static void + managedCCFListBySub(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { manager.managedCcfs().list(null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfRestoreSamples.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfRestoreSamples.java new file mode 100644 index 000000000000..aeaeb43c640b --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfRestoreSamples.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.confidentialledger.generated; + +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfRestore; + +/** + * Samples for ManagedCcf Restore. + */ +public final class ManagedCcfRestoreSamples { + /* + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_Restore.json + */ + /** + * Sample code: ManagedCCFRestore. + * + * @param manager Entry point to ConfidentialLedgerManager. + */ + public static void + managedCCFRestore(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + manager.managedCcfs() + .restore("DummyResourceGroupName", "DummyMccfAppName", + new ManagedCcfRestore().withFileShareName("DummyFileShareName") + .withRestoreRegion("EastUS") + .withUri("DummySASUri"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfUpdateSamples.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfUpdateSamples.java index 54669915a478..7371a32e941f 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfUpdateSamples.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfUpdateSamples.java @@ -4,43 +4,41 @@ package com.azure.resourcemanager.confidentialledger.generated; -import com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfInner; import com.azure.resourcemanager.confidentialledger.models.DeploymentType; import com.azure.resourcemanager.confidentialledger.models.LanguageRuntime; +import com.azure.resourcemanager.confidentialledger.models.ManagedCcf; import com.azure.resourcemanager.confidentialledger.models.ManagedCcfProperties; import java.util.HashMap; import java.util.Map; -/** Samples for ManagedCcf Update. */ +/** + * Samples for ManagedCcf Update. + */ public final class ManagedCcfUpdateSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/ManagedCCF_Update.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/ManagedCCF_Update.json */ /** * Sample code: ManagedCCFUpdate. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ - public static void managedCCFUpdate( - com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { - manager - .managedCcfs() - .update( - "DummyResourceGroupName", - "DummyMccfAppName", - new ManagedCcfInner() - .withLocation("EastUS") - .withTags(mapOf("additionalProps1", "additional properties")) - .withProperties( - new ManagedCcfProperties() - .withDeploymentType( - new DeploymentType() - .withLanguageRuntime(LanguageRuntime.CPP) - .withAppSourceUri( - "https://myaccount.blob.core.windows.net/storage/mccfsource?sv=2022-02-11%st=2022-03-11"))), - com.azure.core.util.Context.NONE); + public static void + managedCCFUpdate(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + ManagedCcf resource = manager.managedCcfs() + .getByResourceGroupWithResponse("DummyResourceGroupName", "DummyMccfAppName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("additionalProps1", "additional properties")) + .withProperties(new ManagedCcfProperties() + .withDeploymentType(new DeploymentType().withLanguageRuntime(LanguageRuntime.CPP) + .withAppSourceUri( + "https://myaccount.blob.core.windows.net/storage/mccfsource?sv=2022-02-11%st=2022-03-11"))) + .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/OperationsListSamples.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/OperationsListSamples.java index 8e2deb8441d8..b897aa54777c 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/OperationsListSamples.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/OperationsListSamples.java @@ -4,14 +4,16 @@ package com.azure.resourcemanager.confidentialledger.generated; -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/Operations_Get.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/Operations_Get.json */ /** * Sample code: OperationsGet. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ public static void operationsGet(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ResourceProviderCheckNameAvailabilitySamples.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ResourceProviderCheckNameAvailabilitySamples.java index de79ad8929e5..e6fd96cf82f6 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ResourceProviderCheckNameAvailabilitySamples.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/samples/java/com/azure/resourcemanager/confidentialledger/generated/ResourceProviderCheckNameAvailabilitySamples.java @@ -6,24 +6,22 @@ import com.azure.resourcemanager.confidentialledger.models.CheckNameAvailabilityRequest; -/** Samples for ResourceProvider CheckNameAvailability. */ +/** + * Samples for ResourceProvider CheckNameAvailability. + */ public final class ResourceProviderCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-01-26-preview/examples/CheckNameAvailability.json + * x-ms-original-file: specification/confidentialledger/resource-manager/Microsoft.ConfidentialLedger/preview/2023-06-28-preview/examples/CheckNameAvailability.json */ /** * Sample code: CheckNameAvailability. - * + * * @param manager Entry point to ConfidentialLedgerManager. */ - public static void checkNameAvailability( - com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { - manager - .resourceProviders() - .checkNameAvailabilityWithResponse( - new CheckNameAvailabilityRequest() - .withName("sample-name") - .withType("Microsoft.ConfidentialLedger/ledgers"), - com.azure.core.util.Context.NONE); + public static void + checkNameAvailability(com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager manager) { + manager.resourceProviders() + .checkNameAvailabilityWithResponse(new CheckNameAvailabilityRequest().withName("sample-name") + .withType("Microsoft.ConfidentialLedger/ledgers"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/ConfidentialLedgerManagementTestBase.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/ConfidentialLedgerManagementTestBase.java index c394b48b5402..1cd1946151d2 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/ConfidentialLedgerManagementTestBase.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/ConfidentialLedgerManagementTestBase.java @@ -11,6 +11,7 @@ import com.azure.core.management.profile.AzureProfile; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.test.models.CustomMatcher; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.resourcemanager.resources.ResourceManager; @@ -22,6 +23,8 @@ import java.time.Duration; import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; import java.util.Map; @@ -33,6 +36,15 @@ public class ConfidentialLedgerManagementTestBase extends TestProxyTestBase { private static TokenCredential credential; private static ResourceGroup testResourceGroup; private ConfidentialLedgerManagementOperations ledgerOperationsInstance; + + @Override + protected void beforeTest() { + if (getTestMode() == TestMode.PLAYBACK) { + interceptorManager.addMatchers(Collections.singletonList(new CustomMatcher() + .setIgnoredQueryParameters(Arrays.asList("api-version")))); + } + } + @BeforeAll public static void setup() { // Authenticate diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/AadBasedSecurityPrincipalTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/AadBasedSecurityPrincipalTests.java index 96d26b5297a7..fe32e4ebad86 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/AadBasedSecurityPrincipalTests.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/AadBasedSecurityPrincipalTests.java @@ -12,25 +12,22 @@ public final class AadBasedSecurityPrincipalTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AadBasedSecurityPrincipal model = - BinaryData - .fromString("{\"principalId\":\"vamih\",\"tenantId\":\"gnarxzxtheo\",\"ledgerRoleName\":\"Reader\"}") - .toObject(AadBasedSecurityPrincipal.class); - Assertions.assertEquals("vamih", model.principalId()); - Assertions.assertEquals("gnarxzxtheo", model.tenantId()); + AadBasedSecurityPrincipal model = BinaryData + .fromString("{\"principalId\":\"ljofxqeofjaeqjh\",\"tenantId\":\"b\",\"ledgerRoleName\":\"Reader\"}") + .toObject(AadBasedSecurityPrincipal.class); + Assertions.assertEquals("ljofxqeofjaeqjh", model.principalId()); + Assertions.assertEquals("b", model.tenantId()); Assertions.assertEquals(LedgerRoleName.READER, model.ledgerRoleName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AadBasedSecurityPrincipal model = - new AadBasedSecurityPrincipal() - .withPrincipalId("vamih") - .withTenantId("gnarxzxtheo") - .withLedgerRoleName(LedgerRoleName.READER); + AadBasedSecurityPrincipal model = new AadBasedSecurityPrincipal().withPrincipalId("ljofxqeofjaeqjh") + .withTenantId("b") + .withLedgerRoleName(LedgerRoleName.READER); model = BinaryData.fromObject(model).toObject(AadBasedSecurityPrincipal.class); - Assertions.assertEquals("vamih", model.principalId()); - Assertions.assertEquals("gnarxzxtheo", model.tenantId()); + Assertions.assertEquals("ljofxqeofjaeqjh", model.principalId()); + Assertions.assertEquals("b", model.tenantId()); Assertions.assertEquals(LedgerRoleName.READER, model.ledgerRoleName()); } } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/CertBasedSecurityPrincipalTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/CertBasedSecurityPrincipalTests.java index 3f0c94f71c14..f6613ec4429e 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/CertBasedSecurityPrincipalTests.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/CertBasedSecurityPrincipalTests.java @@ -12,20 +12,19 @@ public final class CertBasedSecurityPrincipalTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CertBasedSecurityPrincipal model = - BinaryData - .fromString("{\"cert\":\"vyevcciqi\",\"ledgerRoleName\":\"Contributor\"}") + CertBasedSecurityPrincipal model + = BinaryData.fromString("{\"cert\":\"smjqulngsntnbyb\",\"ledgerRoleName\":\"Reader\"}") .toObject(CertBasedSecurityPrincipal.class); - Assertions.assertEquals("vyevcciqi", model.cert()); - Assertions.assertEquals(LedgerRoleName.CONTRIBUTOR, model.ledgerRoleName()); + Assertions.assertEquals("smjqulngsntnbyb", model.cert()); + Assertions.assertEquals(LedgerRoleName.READER, model.ledgerRoleName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CertBasedSecurityPrincipal model = - new CertBasedSecurityPrincipal().withCert("vyevcciqi").withLedgerRoleName(LedgerRoleName.CONTRIBUTOR); + CertBasedSecurityPrincipal model + = new CertBasedSecurityPrincipal().withCert("smjqulngsntnbyb").withLedgerRoleName(LedgerRoleName.READER); model = BinaryData.fromObject(model).toObject(CertBasedSecurityPrincipal.class); - Assertions.assertEquals("vyevcciqi", model.cert()); - Assertions.assertEquals(LedgerRoleName.CONTRIBUTOR, model.ledgerRoleName()); + Assertions.assertEquals("smjqulngsntnbyb", model.cert()); + Assertions.assertEquals(LedgerRoleName.READER, model.ledgerRoleName()); } } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/CheckNameAvailabilityRequestTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/CheckNameAvailabilityRequestTests.java index 42cbf2f0aa82..d522cc3bc1eb 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/CheckNameAvailabilityRequestTests.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/CheckNameAvailabilityRequestTests.java @@ -11,10 +11,8 @@ public final class CheckNameAvailabilityRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CheckNameAvailabilityRequest model = - BinaryData - .fromString("{\"name\":\"tu\",\"type\":\"nryrtihf\"}") - .toObject(CheckNameAvailabilityRequest.class); + CheckNameAvailabilityRequest model = BinaryData.fromString("{\"name\":\"tu\",\"type\":\"nryrtihf\"}") + .toObject(CheckNameAvailabilityRequest.class); Assertions.assertEquals("tu", model.name()); Assertions.assertEquals("nryrtihf", model.type()); } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/CheckNameAvailabilityResponseInnerTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/CheckNameAvailabilityResponseInnerTests.java index 29a8bc0eb0c6..4b50ce7ee9e3 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/CheckNameAvailabilityResponseInnerTests.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/CheckNameAvailabilityResponseInnerTests.java @@ -12,9 +12,8 @@ public final class CheckNameAvailabilityResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CheckNameAvailabilityResponseInner model = - BinaryData - .fromString("{\"nameAvailable\":true,\"reason\":\"Invalid\",\"message\":\"zvgnwzs\"}") + CheckNameAvailabilityResponseInner model + = BinaryData.fromString("{\"nameAvailable\":true,\"reason\":\"Invalid\",\"message\":\"zvgnwzs\"}") .toObject(CheckNameAvailabilityResponseInner.class); Assertions.assertEquals(true, model.nameAvailable()); Assertions.assertEquals(CheckNameAvailabilityReason.INVALID, model.reason()); @@ -23,11 +22,9 @@ public void testDeserialize() throws Exception { @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CheckNameAvailabilityResponseInner model = - new CheckNameAvailabilityResponseInner() - .withNameAvailable(true) - .withReason(CheckNameAvailabilityReason.INVALID) - .withMessage("zvgnwzs"); + CheckNameAvailabilityResponseInner model = new CheckNameAvailabilityResponseInner().withNameAvailable(true) + .withReason(CheckNameAvailabilityReason.INVALID) + .withMessage("zvgnwzs"); model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityResponseInner.class); Assertions.assertEquals(true, model.nameAvailable()); Assertions.assertEquals(CheckNameAvailabilityReason.INVALID, model.reason()); diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ConfidentialLedgerBackupResponseInnerTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ConfidentialLedgerBackupResponseInnerTests.java new file mode 100644 index 000000000000..1f0306426123 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ConfidentialLedgerBackupResponseInnerTests.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.confidentialledger.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerBackupResponseInner; + +public final class ConfidentialLedgerBackupResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConfidentialLedgerBackupResponseInner model + = BinaryData.fromString("{\"message\":\"majtjaod\"}").toObject(ConfidentialLedgerBackupResponseInner.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ConfidentialLedgerBackupResponseInner model = new ConfidentialLedgerBackupResponseInner(); + model = BinaryData.fromObject(model).toObject(ConfidentialLedgerBackupResponseInner.class); + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ConfidentialLedgerBackupTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ConfidentialLedgerBackupTests.java new file mode 100644 index 000000000000..8f78095cb352 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ConfidentialLedgerBackupTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.confidentialledger.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerBackup; +import org.junit.jupiter.api.Assertions; + +public final class ConfidentialLedgerBackupTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConfidentialLedgerBackup model = BinaryData.fromString("{\"restoreRegion\":\"ocxscpaierhhbcs\",\"uri\":\"l\"}") + .toObject(ConfidentialLedgerBackup.class); + Assertions.assertEquals("ocxscpaierhhbcs", model.restoreRegion()); + Assertions.assertEquals("l", model.uri()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ConfidentialLedgerBackup model + = new ConfidentialLedgerBackup().withRestoreRegion("ocxscpaierhhbcs").withUri("l"); + model = BinaryData.fromObject(model).toObject(ConfidentialLedgerBackup.class); + Assertions.assertEquals("ocxscpaierhhbcs", model.restoreRegion()); + Assertions.assertEquals("l", model.uri()); + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ConfidentialLedgerInnerTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ConfidentialLedgerInnerTests.java index 1bfad2294626..1a6e1432ceaa 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ConfidentialLedgerInnerTests.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ConfidentialLedgerInnerTests.java @@ -10,6 +10,7 @@ import com.azure.resourcemanager.confidentialledger.models.CertBasedSecurityPrincipal; import com.azure.resourcemanager.confidentialledger.models.LedgerProperties; import com.azure.resourcemanager.confidentialledger.models.LedgerRoleName; +import com.azure.resourcemanager.confidentialledger.models.LedgerSku; import com.azure.resourcemanager.confidentialledger.models.LedgerType; import com.azure.resourcemanager.confidentialledger.models.RunningState; import java.util.Arrays; @@ -20,65 +21,61 @@ public final class ConfidentialLedgerInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ConfidentialLedgerInner model = - BinaryData - .fromString( - "{\"properties\":{\"ledgerName\":\"lzufcyzkohdbi\",\"ledgerUri\":\"nufhf\",\"identityServiceUri\":\"jysagith\",\"ledgerInternalNamespace\":\"hab\",\"runningState\":\"Pausing\",\"ledgerType\":\"Private\",\"provisioningState\":\"Updating\",\"aadBasedSecurityPrincipals\":[{\"principalId\":\"yscnpqxu\",\"tenantId\":\"vyq\",\"ledgerRoleName\":\"Reader\"}],\"certBasedSecurityPrincipals\":[{\"cert\":\"rkxvdum\",\"ledgerRoleName\":\"Contributor\"}]},\"location\":\"fwvuk\",\"tags\":{\"yejhk\":\"udccsnhsjc\",\"kkvnipjox\":\"yhtnapczwlokjye\",\"podmailzydehojwy\":\"jnchgej\"},\"id\":\"huxinpmqnj\",\"name\":\"qwixjspro\",\"type\":\"vcputegj\"}") - .toObject(ConfidentialLedgerInner.class); - Assertions.assertEquals("fwvuk", model.location()); - Assertions.assertEquals("udccsnhsjc", model.tags().get("yejhk")); + ConfidentialLedgerInner model = BinaryData.fromString( + "{\"properties\":{\"ledgerName\":\"lzufcyzkohdbi\",\"ledgerUri\":\"nufhf\",\"identityServiceUri\":\"jysagith\",\"ledgerInternalNamespace\":\"hab\",\"runningState\":\"Pausing\",\"ledgerType\":\"Private\",\"provisioningState\":\"Updating\",\"ledgerSku\":\"Basic\",\"aadBasedSecurityPrincipals\":[{\"principalId\":\"cnpqxuhivyqniwby\",\"tenantId\":\"k\",\"ledgerRoleName\":\"Contributor\"},{\"principalId\":\"mjgr\",\"tenantId\":\"wvukx\",\"ledgerRoleName\":\"Administrator\"}],\"certBasedSecurityPrincipals\":[{\"cert\":\"snhsjcnyejhkryh\",\"ledgerRoleName\":\"Reader\"},{\"cert\":\"czwlokjyem\",\"ledgerRoleName\":\"Administrator\"}]},\"location\":\"ipjoxzjnchgejs\",\"tags\":{\"ahuxinpm\":\"mailzydehojw\",\"vcputegj\":\"njaqwixjspro\",\"uuvmkjozkrwfnd\":\"wmfdatscmdvpjhul\",\"vwryoqpso\":\"odjpslwejd\"},\"id\":\"cctazakljlahbc\",\"name\":\"yffdfdos\",\"type\":\"gexpaojakhmsbz\"}") + .toObject(ConfidentialLedgerInner.class); + Assertions.assertEquals("ipjoxzjnchgejs", model.location()); + Assertions.assertEquals("mailzydehojw", model.tags().get("ahuxinpm")); Assertions.assertEquals(RunningState.PAUSING, model.properties().runningState()); Assertions.assertEquals(LedgerType.PRIVATE, model.properties().ledgerType()); - Assertions.assertEquals("yscnpqxu", model.properties().aadBasedSecurityPrincipals().get(0).principalId()); - Assertions.assertEquals("vyq", model.properties().aadBasedSecurityPrincipals().get(0).tenantId()); - Assertions - .assertEquals( - LedgerRoleName.READER, model.properties().aadBasedSecurityPrincipals().get(0).ledgerRoleName()); - Assertions.assertEquals("rkxvdum", model.properties().certBasedSecurityPrincipals().get(0).cert()); - Assertions - .assertEquals( - LedgerRoleName.CONTRIBUTOR, model.properties().certBasedSecurityPrincipals().get(0).ledgerRoleName()); + Assertions.assertEquals(LedgerSku.BASIC, model.properties().ledgerSku()); + Assertions.assertEquals("cnpqxuhivyqniwby", + model.properties().aadBasedSecurityPrincipals().get(0).principalId()); + Assertions.assertEquals("k", model.properties().aadBasedSecurityPrincipals().get(0).tenantId()); + Assertions.assertEquals(LedgerRoleName.CONTRIBUTOR, + model.properties().aadBasedSecurityPrincipals().get(0).ledgerRoleName()); + Assertions.assertEquals("snhsjcnyejhkryh", model.properties().certBasedSecurityPrincipals().get(0).cert()); + Assertions.assertEquals(LedgerRoleName.READER, + model.properties().certBasedSecurityPrincipals().get(0).ledgerRoleName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ConfidentialLedgerInner model = - new ConfidentialLedgerInner() - .withLocation("fwvuk") - .withTags(mapOf("yejhk", "udccsnhsjc", "kkvnipjox", "yhtnapczwlokjye", "podmailzydehojwy", "jnchgej")) - .withProperties( - new LedgerProperties() - .withRunningState(RunningState.PAUSING) - .withLedgerType(LedgerType.PRIVATE) - .withAadBasedSecurityPrincipals( - Arrays - .asList( - new AadBasedSecurityPrincipal() - .withPrincipalId("yscnpqxu") - .withTenantId("vyq") - .withLedgerRoleName(LedgerRoleName.READER))) - .withCertBasedSecurityPrincipals( - Arrays - .asList( - new CertBasedSecurityPrincipal() - .withCert("rkxvdum") - .withLedgerRoleName(LedgerRoleName.CONTRIBUTOR)))); + ConfidentialLedgerInner model = new ConfidentialLedgerInner().withLocation("ipjoxzjnchgejs") + .withTags(mapOf("ahuxinpm", "mailzydehojw", "vcputegj", "njaqwixjspro", "uuvmkjozkrwfnd", + "wmfdatscmdvpjhul", "vwryoqpso", "odjpslwejd")) + .withProperties(new LedgerProperties().withRunningState(RunningState.PAUSING) + .withLedgerType(LedgerType.PRIVATE) + .withLedgerSku(LedgerSku.BASIC) + .withAadBasedSecurityPrincipals(Arrays.asList( + new AadBasedSecurityPrincipal().withPrincipalId("cnpqxuhivyqniwby") + .withTenantId("k") + .withLedgerRoleName(LedgerRoleName.CONTRIBUTOR), + new AadBasedSecurityPrincipal().withPrincipalId("mjgr") + .withTenantId("wvukx") + .withLedgerRoleName(LedgerRoleName.ADMINISTRATOR))) + .withCertBasedSecurityPrincipals(Arrays.asList( + new CertBasedSecurityPrincipal().withCert("snhsjcnyejhkryh") + .withLedgerRoleName(LedgerRoleName.READER), + new CertBasedSecurityPrincipal().withCert("czwlokjyem") + .withLedgerRoleName(LedgerRoleName.ADMINISTRATOR)))); model = BinaryData.fromObject(model).toObject(ConfidentialLedgerInner.class); - Assertions.assertEquals("fwvuk", model.location()); - Assertions.assertEquals("udccsnhsjc", model.tags().get("yejhk")); + Assertions.assertEquals("ipjoxzjnchgejs", model.location()); + Assertions.assertEquals("mailzydehojw", model.tags().get("ahuxinpm")); Assertions.assertEquals(RunningState.PAUSING, model.properties().runningState()); Assertions.assertEquals(LedgerType.PRIVATE, model.properties().ledgerType()); - Assertions.assertEquals("yscnpqxu", model.properties().aadBasedSecurityPrincipals().get(0).principalId()); - Assertions.assertEquals("vyq", model.properties().aadBasedSecurityPrincipals().get(0).tenantId()); - Assertions - .assertEquals( - LedgerRoleName.READER, model.properties().aadBasedSecurityPrincipals().get(0).ledgerRoleName()); - Assertions.assertEquals("rkxvdum", model.properties().certBasedSecurityPrincipals().get(0).cert()); - Assertions - .assertEquals( - LedgerRoleName.CONTRIBUTOR, model.properties().certBasedSecurityPrincipals().get(0).ledgerRoleName()); + Assertions.assertEquals(LedgerSku.BASIC, model.properties().ledgerSku()); + Assertions.assertEquals("cnpqxuhivyqniwby", + model.properties().aadBasedSecurityPrincipals().get(0).principalId()); + Assertions.assertEquals("k", model.properties().aadBasedSecurityPrincipals().get(0).tenantId()); + Assertions.assertEquals(LedgerRoleName.CONTRIBUTOR, + model.properties().aadBasedSecurityPrincipals().get(0).ledgerRoleName()); + Assertions.assertEquals("snhsjcnyejhkryh", model.properties().certBasedSecurityPrincipals().get(0).cert()); + Assertions.assertEquals(LedgerRoleName.READER, + model.properties().certBasedSecurityPrincipals().get(0).ledgerRoleName()); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ConfidentialLedgerListTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ConfidentialLedgerListTests.java index ca86a11e17d0..629242ec5699 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ConfidentialLedgerListTests.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ConfidentialLedgerListTests.java @@ -6,8 +6,12 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerInner; +import com.azure.resourcemanager.confidentialledger.models.AadBasedSecurityPrincipal; +import com.azure.resourcemanager.confidentialledger.models.CertBasedSecurityPrincipal; import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerList; import com.azure.resourcemanager.confidentialledger.models.LedgerProperties; +import com.azure.resourcemanager.confidentialledger.models.LedgerRoleName; +import com.azure.resourcemanager.confidentialledger.models.LedgerSku; import com.azure.resourcemanager.confidentialledger.models.LedgerType; import com.azure.resourcemanager.confidentialledger.models.RunningState; import java.util.Arrays; @@ -18,68 +22,115 @@ public final class ConfidentialLedgerListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ConfidentialLedgerList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"ledgerName\":\"wjzrnfygxgisp\",\"ledgerUri\":\"vtz\",\"identityServiceUri\":\"ufubl\",\"ledgerInternalNamespace\":\"fxqeof\",\"runningState\":\"Active\",\"ledgerType\":\"Private\",\"provisioningState\":\"Creating\",\"aadBasedSecurityPrincipals\":[],\"certBasedSecurityPrincipals\":[]},\"location\":\"s\",\"tags\":{\"nbybkzgcwrwcl\":\"mjqulngsn\",\"cjdkwtnhxbnjbi\":\"xwrljdouskcqvkoc\",\"jwnzlljfmp\":\"sqrglssainq\",\"yqduujit\":\"eebvmgxsab\"},\"id\":\"jczdzevndh\",\"name\":\"rwpdappdsbdkvwrw\",\"type\":\"feusnhut\"},{\"properties\":{\"ledgerName\":\"tmrldhugjzzdatq\",\"ledgerUri\":\"oc\",\"identityServiceUri\":\"eablg\",\"ledgerInternalNamespace\":\"uticndvkaozwyif\",\"runningState\":\"Resuming\",\"ledgerType\":\"Private\",\"provisioningState\":\"Unknown\",\"aadBasedSecurityPrincipals\":[],\"certBasedSecurityPrincipals\":[]},\"location\":\"tyxolniwpwc\",\"tags\":{\"ryplwckbasyypn\":\"fkgiawxk\",\"phejkotynqgoulz\":\"dhsgcba\",\"gakeqsr\":\"dlikwyqkgfgibma\"},\"id\":\"yb\",\"name\":\"qqedqytbciqfou\",\"type\":\"lmmnkzsmodmglo\"}],\"nextLink\":\"pbkwtmu\"}") - .toObject(ConfidentialLedgerList.class); - Assertions.assertEquals("s", model.value().get(0).location()); - Assertions.assertEquals("mjqulngsn", model.value().get(0).tags().get("nbybkzgcwrwcl")); - Assertions.assertEquals(RunningState.ACTIVE, model.value().get(0).properties().runningState()); - Assertions.assertEquals(LedgerType.PRIVATE, model.value().get(0).properties().ledgerType()); - Assertions.assertEquals("pbkwtmu", model.nextLink()); + ConfidentialLedgerList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"ledgerName\":\"clxxwrljdo\",\"ledgerUri\":\"kcqvkocrc\",\"identityServiceUri\":\"kwt\",\"ledgerInternalNamespace\":\"xbnjbiksq\",\"runningState\":\"Unknown\",\"ledgerType\":\"Public\",\"provisioningState\":\"Failed\",\"ledgerSku\":\"Standard\",\"aadBasedSecurityPrincipals\":[{\"principalId\":\"nzl\",\"tenantId\":\"fmppe\",\"ledgerRoleName\":\"Contributor\"},{\"principalId\":\"gxsabkyq\",\"tenantId\":\"ujitcjcz\",\"ledgerRoleName\":\"Contributor\"},{\"principalId\":\"ndhkrw\",\"tenantId\":\"appd\",\"ledgerRoleName\":\"Reader\"}],\"certBasedSecurityPrincipals\":[{\"cert\":\"rwjfe\",\"ledgerRoleName\":\"Reader\"},{\"cert\":\"utjeltmrldhugj\",\"ledgerRoleName\":\"Reader\"}]},\"location\":\"tqxhocdgeab\",\"tags\":{\"wyiftyhxhur\":\"huticndvkao\"},\"id\":\"k\",\"name\":\"tyxolniwpwc\",\"type\":\"kjfkg\"},{\"properties\":{\"ledgerName\":\"xklrypl\",\"ledgerUri\":\"kbasyypn\",\"identityServiceUri\":\"hsgcbacphejkot\",\"ledgerInternalNamespace\":\"qgoulznd\",\"runningState\":\"Active\",\"ledgerType\":\"Public\",\"provisioningState\":\"Creating\",\"ledgerSku\":\"Unknown\",\"aadBasedSecurityPrincipals\":[{\"principalId\":\"madgakeqsrxyb\",\"tenantId\":\"qedqytbciqfoufl\",\"ledgerRoleName\":\"Contributor\"},{\"principalId\":\"zsm\",\"tenantId\":\"mglougpbkw\",\"ledgerRoleName\":\"Contributor\"},{\"principalId\":\"duqkt\",\"tenantId\":\"spwgcuertumkdosv\",\"ledgerRoleName\":\"Reader\"},{\"principalId\":\"mdgbbjfdd\",\"tenantId\":\"bmbexppbhtqqro\",\"ledgerRoleName\":\"Reader\"}],\"certBasedSecurityPrincipals\":[{\"cert\":\"algbquxigjyjg\",\"ledgerRoleName\":\"Administrator\"},{\"cert\":\"yfhrtxilnerkujy\",\"ledgerRoleName\":\"Contributor\"},{\"cert\":\"juvf\",\"ledgerRoleName\":\"Reader\"}]},\"location\":\"lyxwjkcprbnwbx\",\"tags\":{\"qguhmuo\":\"tbvpysszdnru\"},\"id\":\"qfprwzwbn\",\"name\":\"uitnwuiz\",\"type\":\"a\"},{\"properties\":{\"ledgerName\":\"fizuckyf\",\"ledgerUri\":\"rfidfvzwdz\",\"identityServiceUri\":\"tymw\",\"ledgerInternalNamespace\":\"dkfthwxmnt\",\"runningState\":\"Paused\",\"ledgerType\":\"Unknown\",\"provisioningState\":\"Succeeded\",\"ledgerSku\":\"Standard\",\"aadBasedSecurityPrincipals\":[{\"principalId\":\"mmxdcu\",\"tenantId\":\"fsrpymzidnse\",\"ledgerRoleName\":\"Contributor\"},{\"principalId\":\"bzsgfyccsne\",\"tenantId\":\"dwzjeiach\",\"ledgerRoleName\":\"Contributor\"},{\"principalId\":\"flnrosfqpteehzz\",\"tenantId\":\"pyqr\",\"ledgerRoleName\":\"Reader\"},{\"principalId\":\"npvswjdkirso\",\"tenantId\":\"qxhcrmn\",\"ledgerRoleName\":\"Administrator\"}],\"certBasedSecurityPrincipals\":[{\"cert\":\"whdsoifiyip\",\"ledgerRoleName\":\"Contributor\"},{\"cert\":\"wpgrjbzno\",\"ledgerRoleName\":\"Reader\"}]},\"location\":\"vsnb\",\"tags\":{\"zafb\":\"abnmocpcyshu\",\"oq\":\"jjgpb\"},\"id\":\"jmkljavbqidtqajz\",\"name\":\"ulpkudjkrl\",\"type\":\"hbzhfepg\"}],\"nextLink\":\"qex\"}") + .toObject(ConfidentialLedgerList.class); + Assertions.assertEquals("tqxhocdgeab", model.value().get(0).location()); + Assertions.assertEquals("huticndvkao", model.value().get(0).tags().get("wyiftyhxhur")); + Assertions.assertEquals(RunningState.UNKNOWN, model.value().get(0).properties().runningState()); + Assertions.assertEquals(LedgerType.PUBLIC, model.value().get(0).properties().ledgerType()); + Assertions.assertEquals(LedgerSku.STANDARD, model.value().get(0).properties().ledgerSku()); + Assertions.assertEquals("nzl", + model.value().get(0).properties().aadBasedSecurityPrincipals().get(0).principalId()); + Assertions.assertEquals("fmppe", + model.value().get(0).properties().aadBasedSecurityPrincipals().get(0).tenantId()); + Assertions.assertEquals(LedgerRoleName.CONTRIBUTOR, + model.value().get(0).properties().aadBasedSecurityPrincipals().get(0).ledgerRoleName()); + Assertions.assertEquals("rwjfe", model.value().get(0).properties().certBasedSecurityPrincipals().get(0).cert()); + Assertions.assertEquals(LedgerRoleName.READER, + model.value().get(0).properties().certBasedSecurityPrincipals().get(0).ledgerRoleName()); + Assertions.assertEquals("qex", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ConfidentialLedgerList model = - new ConfidentialLedgerList() - .withValue( - Arrays - .asList( - new ConfidentialLedgerInner() - .withLocation("s") - .withTags( - mapOf( - "nbybkzgcwrwcl", - "mjqulngsn", - "cjdkwtnhxbnjbi", - "xwrljdouskcqvkoc", - "jwnzlljfmp", - "sqrglssainq", - "yqduujit", - "eebvmgxsab")) - .withProperties( - new LedgerProperties() - .withRunningState(RunningState.ACTIVE) - .withLedgerType(LedgerType.PRIVATE) - .withAadBasedSecurityPrincipals(Arrays.asList()) - .withCertBasedSecurityPrincipals(Arrays.asList())), - new ConfidentialLedgerInner() - .withLocation("tyxolniwpwc") - .withTags( - mapOf( - "ryplwckbasyypn", - "fkgiawxk", - "phejkotynqgoulz", - "dhsgcba", - "gakeqsr", - "dlikwyqkgfgibma")) - .withProperties( - new LedgerProperties() - .withRunningState(RunningState.RESUMING) - .withLedgerType(LedgerType.PRIVATE) - .withAadBasedSecurityPrincipals(Arrays.asList()) - .withCertBasedSecurityPrincipals(Arrays.asList())))) - .withNextLink("pbkwtmu"); + ConfidentialLedgerList model = new ConfidentialLedgerList().withValue(Arrays.asList( + new ConfidentialLedgerInner().withLocation("tqxhocdgeab") + .withTags(mapOf("wyiftyhxhur", "huticndvkao")) + .withProperties(new LedgerProperties().withRunningState(RunningState.UNKNOWN) + .withLedgerType(LedgerType.PUBLIC) + .withLedgerSku(LedgerSku.STANDARD) + .withAadBasedSecurityPrincipals(Arrays.asList( + new AadBasedSecurityPrincipal().withPrincipalId("nzl") + .withTenantId("fmppe") + .withLedgerRoleName(LedgerRoleName.CONTRIBUTOR), + new AadBasedSecurityPrincipal().withPrincipalId("gxsabkyq") + .withTenantId("ujitcjcz") + .withLedgerRoleName(LedgerRoleName.CONTRIBUTOR), + new AadBasedSecurityPrincipal().withPrincipalId("ndhkrw") + .withTenantId("appd") + .withLedgerRoleName(LedgerRoleName.READER))) + .withCertBasedSecurityPrincipals(Arrays.asList( + new CertBasedSecurityPrincipal().withCert("rwjfe").withLedgerRoleName(LedgerRoleName.READER), + new CertBasedSecurityPrincipal().withCert("utjeltmrldhugj") + .withLedgerRoleName(LedgerRoleName.READER)))), + new ConfidentialLedgerInner().withLocation("lyxwjkcprbnwbx") + .withTags(mapOf("qguhmuo", "tbvpysszdnru")) + .withProperties(new LedgerProperties().withRunningState(RunningState.ACTIVE) + .withLedgerType(LedgerType.PUBLIC) + .withLedgerSku(LedgerSku.UNKNOWN) + .withAadBasedSecurityPrincipals(Arrays.asList( + new AadBasedSecurityPrincipal().withPrincipalId("madgakeqsrxyb") + .withTenantId("qedqytbciqfoufl") + .withLedgerRoleName(LedgerRoleName.CONTRIBUTOR), + new AadBasedSecurityPrincipal().withPrincipalId("zsm") + .withTenantId("mglougpbkw") + .withLedgerRoleName(LedgerRoleName.CONTRIBUTOR), + new AadBasedSecurityPrincipal().withPrincipalId("duqkt") + .withTenantId("spwgcuertumkdosv") + .withLedgerRoleName(LedgerRoleName.READER), + new AadBasedSecurityPrincipal().withPrincipalId("mdgbbjfdd") + .withTenantId("bmbexppbhtqqro") + .withLedgerRoleName(LedgerRoleName.READER))) + .withCertBasedSecurityPrincipals(Arrays.asList( + new CertBasedSecurityPrincipal().withCert("algbquxigjyjg") + .withLedgerRoleName(LedgerRoleName.ADMINISTRATOR), + new CertBasedSecurityPrincipal().withCert("yfhrtxilnerkujy") + .withLedgerRoleName(LedgerRoleName.CONTRIBUTOR), + new CertBasedSecurityPrincipal().withCert("juvf").withLedgerRoleName(LedgerRoleName.READER)))), + new ConfidentialLedgerInner().withLocation("vsnb") + .withTags(mapOf("zafb", "abnmocpcyshu", "oq", "jjgpb")) + .withProperties(new LedgerProperties().withRunningState(RunningState.PAUSED) + .withLedgerType(LedgerType.UNKNOWN) + .withLedgerSku(LedgerSku.STANDARD) + .withAadBasedSecurityPrincipals(Arrays.asList( + new AadBasedSecurityPrincipal().withPrincipalId("mmxdcu") + .withTenantId("fsrpymzidnse") + .withLedgerRoleName(LedgerRoleName.CONTRIBUTOR), + new AadBasedSecurityPrincipal().withPrincipalId("bzsgfyccsne") + .withTenantId("dwzjeiach") + .withLedgerRoleName(LedgerRoleName.CONTRIBUTOR), + new AadBasedSecurityPrincipal().withPrincipalId("flnrosfqpteehzz") + .withTenantId("pyqr") + .withLedgerRoleName(LedgerRoleName.READER), + new AadBasedSecurityPrincipal().withPrincipalId("npvswjdkirso") + .withTenantId("qxhcrmn") + .withLedgerRoleName(LedgerRoleName.ADMINISTRATOR))) + .withCertBasedSecurityPrincipals(Arrays.asList( + new CertBasedSecurityPrincipal().withCert("whdsoifiyip") + .withLedgerRoleName(LedgerRoleName.CONTRIBUTOR), + new CertBasedSecurityPrincipal().withCert("wpgrjbzno") + .withLedgerRoleName(LedgerRoleName.READER)))))) + .withNextLink("qex"); model = BinaryData.fromObject(model).toObject(ConfidentialLedgerList.class); - Assertions.assertEquals("s", model.value().get(0).location()); - Assertions.assertEquals("mjqulngsn", model.value().get(0).tags().get("nbybkzgcwrwcl")); - Assertions.assertEquals(RunningState.ACTIVE, model.value().get(0).properties().runningState()); - Assertions.assertEquals(LedgerType.PRIVATE, model.value().get(0).properties().ledgerType()); - Assertions.assertEquals("pbkwtmu", model.nextLink()); + Assertions.assertEquals("tqxhocdgeab", model.value().get(0).location()); + Assertions.assertEquals("huticndvkao", model.value().get(0).tags().get("wyiftyhxhur")); + Assertions.assertEquals(RunningState.UNKNOWN, model.value().get(0).properties().runningState()); + Assertions.assertEquals(LedgerType.PUBLIC, model.value().get(0).properties().ledgerType()); + Assertions.assertEquals(LedgerSku.STANDARD, model.value().get(0).properties().ledgerSku()); + Assertions.assertEquals("nzl", + model.value().get(0).properties().aadBasedSecurityPrincipals().get(0).principalId()); + Assertions.assertEquals("fmppe", + model.value().get(0).properties().aadBasedSecurityPrincipals().get(0).tenantId()); + Assertions.assertEquals(LedgerRoleName.CONTRIBUTOR, + model.value().get(0).properties().aadBasedSecurityPrincipals().get(0).ledgerRoleName()); + Assertions.assertEquals("rwjfe", model.value().get(0).properties().certBasedSecurityPrincipals().get(0).cert()); + Assertions.assertEquals(LedgerRoleName.READER, + model.value().get(0).properties().certBasedSecurityPrincipals().get(0).ledgerRoleName()); + Assertions.assertEquals("qex", model.nextLink()); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ConfidentialLedgerRestoreResponseInnerTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ConfidentialLedgerRestoreResponseInnerTests.java new file mode 100644 index 000000000000..4c930531b027 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ConfidentialLedgerRestoreResponseInnerTests.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.confidentialledger.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.confidentialledger.fluent.models.ConfidentialLedgerRestoreResponseInner; + +public final class ConfidentialLedgerRestoreResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConfidentialLedgerRestoreResponseInner model = BinaryData.fromString("{\"message\":\"maajrmvdjwzrlo\"}") + .toObject(ConfidentialLedgerRestoreResponseInner.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ConfidentialLedgerRestoreResponseInner model = new ConfidentialLedgerRestoreResponseInner(); + model = BinaryData.fromObject(model).toObject(ConfidentialLedgerRestoreResponseInner.class); + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ConfidentialLedgerRestoreTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ConfidentialLedgerRestoreTests.java new file mode 100644 index 000000000000..957a718a6c94 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ConfidentialLedgerRestoreTests.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.confidentialledger.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerRestore; +import org.junit.jupiter.api.Assertions; + +public final class ConfidentialLedgerRestoreTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConfidentialLedgerRestore model = BinaryData + .fromString("{\"fileShareName\":\"obnbdxkqpxokaj\",\"restoreRegion\":\"onpimexgstxg\",\"uri\":\"po\"}") + .toObject(ConfidentialLedgerRestore.class); + Assertions.assertEquals("obnbdxkqpxokaj", model.fileShareName()); + Assertions.assertEquals("onpimexgstxg", model.restoreRegion()); + Assertions.assertEquals("po", model.uri()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ConfidentialLedgerRestore model = new ConfidentialLedgerRestore().withFileShareName("obnbdxkqpxokaj") + .withRestoreRegion("onpimexgstxg") + .withUri("po"); + model = BinaryData.fromObject(model).toObject(ConfidentialLedgerRestore.class); + Assertions.assertEquals("obnbdxkqpxokaj", model.fileShareName()); + Assertions.assertEquals("onpimexgstxg", model.restoreRegion()); + Assertions.assertEquals("po", model.uri()); + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/DeploymentTypeTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/DeploymentTypeTests.java index f223a5b3197e..179faf4e0983 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/DeploymentTypeTests.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/DeploymentTypeTests.java @@ -12,20 +12,17 @@ public final class DeploymentTypeTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DeploymentType model = - BinaryData - .fromString("{\"languageRuntime\":\"JS\",\"appSourceUri\":\"hmuouqfprwzwbn\"}") - .toObject(DeploymentType.class); + DeploymentType model = BinaryData.fromString("{\"languageRuntime\":\"JS\",\"appSourceUri\":\"dtopbob\"}") + .toObject(DeploymentType.class); Assertions.assertEquals(LanguageRuntime.JS, model.languageRuntime()); - Assertions.assertEquals("hmuouqfprwzwbn", model.appSourceUri()); + Assertions.assertEquals("dtopbob", model.appSourceUri()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeploymentType model = - new DeploymentType().withLanguageRuntime(LanguageRuntime.JS).withAppSourceUri("hmuouqfprwzwbn"); + DeploymentType model = new DeploymentType().withLanguageRuntime(LanguageRuntime.JS).withAppSourceUri("dtopbob"); model = BinaryData.fromObject(model).toObject(DeploymentType.class); Assertions.assertEquals(LanguageRuntime.JS, model.languageRuntime()); - Assertions.assertEquals("hmuouqfprwzwbn", model.appSourceUri()); + Assertions.assertEquals("dtopbob", model.appSourceUri()); } } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgerPropertiesTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgerPropertiesTests.java index f959dc8939ec..f9cc06c0c060 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgerPropertiesTests.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgerPropertiesTests.java @@ -9,6 +9,7 @@ import com.azure.resourcemanager.confidentialledger.models.CertBasedSecurityPrincipal; import com.azure.resourcemanager.confidentialledger.models.LedgerProperties; import com.azure.resourcemanager.confidentialledger.models.LedgerRoleName; +import com.azure.resourcemanager.confidentialledger.models.LedgerSku; import com.azure.resourcemanager.confidentialledger.models.LedgerType; import com.azure.resourcemanager.confidentialledger.models.RunningState; import java.util.Arrays; @@ -17,65 +18,48 @@ public final class LedgerPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - LedgerProperties model = - BinaryData - .fromString( - "{\"ledgerName\":\"mfdatscmdvpj\",\"ledgerUri\":\"lsuuvmkjozkrwfnd\",\"identityServiceUri\":\"djpslw\",\"ledgerInternalNamespace\":\"dpvwryoqpsoaccta\",\"runningState\":\"Active\",\"ledgerType\":\"Unknown\",\"provisioningState\":\"Succeeded\",\"aadBasedSecurityPrincipals\":[{\"principalId\":\"ryffdfdosy\",\"tenantId\":\"xpaojakhmsbz\",\"ledgerRoleName\":\"Administrator\"},{\"principalId\":\"zevdphlx\",\"tenantId\":\"lthqtrgqjbp\",\"ledgerRoleName\":\"Administrator\"},{\"principalId\":\"inzgvfcj\",\"tenantId\":\"zoxxjtf\",\"ledgerRoleName\":\"Administrator\"}],\"certBasedSecurityPrincipals\":[{\"cert\":\"zitonpeqfpjkjl\",\"ledgerRoleName\":\"Reader\"},{\"cert\":\"dvhpfxxypininm\",\"ledgerRoleName\":\"Administrator\"},{\"cert\":\"ybb\",\"ledgerRoleName\":\"Contributor\"},{\"cert\":\"epoo\",\"ledgerRoleName\":\"Administrator\"}]}") - .toObject(LedgerProperties.class); - Assertions.assertEquals(RunningState.ACTIVE, model.runningState()); + LedgerProperties model = BinaryData.fromString( + "{\"ledgerName\":\"crzevdphlx\",\"ledgerUri\":\"lthqtrgqjbp\",\"identityServiceUri\":\"fsinzgvfcjrwzoxx\",\"ledgerInternalNamespace\":\"felluwfzitonpe\",\"runningState\":\"Paused\",\"ledgerType\":\"Unknown\",\"provisioningState\":\"Canceled\",\"ledgerSku\":\"Standard\",\"aadBasedSecurityPrincipals\":[{\"principalId\":\"vhpfxxypininmay\",\"tenantId\":\"ybb\",\"ledgerRoleName\":\"Contributor\"},{\"principalId\":\"epoo\",\"tenantId\":\"nuvamiheogna\",\"ledgerRoleName\":\"Administrator\"},{\"principalId\":\"theotusiv\",\"tenantId\":\"v\",\"ledgerRoleName\":\"Administrator\"}],\"certBasedSecurityPrincipals\":[{\"cert\":\"nhungbw\",\"ledgerRoleName\":\"Administrator\"},{\"cert\":\"fygxgispemvtzfk\",\"ledgerRoleName\":\"Reader\"}]}") + .toObject(LedgerProperties.class); + Assertions.assertEquals(RunningState.PAUSED, model.runningState()); Assertions.assertEquals(LedgerType.UNKNOWN, model.ledgerType()); - Assertions.assertEquals("ryffdfdosy", model.aadBasedSecurityPrincipals().get(0).principalId()); - Assertions.assertEquals("xpaojakhmsbz", model.aadBasedSecurityPrincipals().get(0).tenantId()); - Assertions - .assertEquals(LedgerRoleName.ADMINISTRATOR, model.aadBasedSecurityPrincipals().get(0).ledgerRoleName()); - Assertions.assertEquals("zitonpeqfpjkjl", model.certBasedSecurityPrincipals().get(0).cert()); - Assertions.assertEquals(LedgerRoleName.READER, model.certBasedSecurityPrincipals().get(0).ledgerRoleName()); + Assertions.assertEquals(LedgerSku.STANDARD, model.ledgerSku()); + Assertions.assertEquals("vhpfxxypininmay", model.aadBasedSecurityPrincipals().get(0).principalId()); + Assertions.assertEquals("ybb", model.aadBasedSecurityPrincipals().get(0).tenantId()); + Assertions.assertEquals(LedgerRoleName.CONTRIBUTOR, model.aadBasedSecurityPrincipals().get(0).ledgerRoleName()); + Assertions.assertEquals("nhungbw", model.certBasedSecurityPrincipals().get(0).cert()); + Assertions.assertEquals(LedgerRoleName.ADMINISTRATOR, + model.certBasedSecurityPrincipals().get(0).ledgerRoleName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LedgerProperties model = - new LedgerProperties() - .withRunningState(RunningState.ACTIVE) - .withLedgerType(LedgerType.UNKNOWN) - .withAadBasedSecurityPrincipals( - Arrays - .asList( - new AadBasedSecurityPrincipal() - .withPrincipalId("ryffdfdosy") - .withTenantId("xpaojakhmsbz") - .withLedgerRoleName(LedgerRoleName.ADMINISTRATOR), - new AadBasedSecurityPrincipal() - .withPrincipalId("zevdphlx") - .withTenantId("lthqtrgqjbp") - .withLedgerRoleName(LedgerRoleName.ADMINISTRATOR), - new AadBasedSecurityPrincipal() - .withPrincipalId("inzgvfcj") - .withTenantId("zoxxjtf") - .withLedgerRoleName(LedgerRoleName.ADMINISTRATOR))) - .withCertBasedSecurityPrincipals( - Arrays - .asList( - new CertBasedSecurityPrincipal() - .withCert("zitonpeqfpjkjl") - .withLedgerRoleName(LedgerRoleName.READER), - new CertBasedSecurityPrincipal() - .withCert("dvhpfxxypininm") - .withLedgerRoleName(LedgerRoleName.ADMINISTRATOR), - new CertBasedSecurityPrincipal() - .withCert("ybb") - .withLedgerRoleName(LedgerRoleName.CONTRIBUTOR), - new CertBasedSecurityPrincipal() - .withCert("epoo") - .withLedgerRoleName(LedgerRoleName.ADMINISTRATOR))); + LedgerProperties model = new LedgerProperties().withRunningState(RunningState.PAUSED) + .withLedgerType(LedgerType.UNKNOWN) + .withLedgerSku(LedgerSku.STANDARD) + .withAadBasedSecurityPrincipals(Arrays.asList( + new AadBasedSecurityPrincipal().withPrincipalId("vhpfxxypininmay") + .withTenantId("ybb") + .withLedgerRoleName(LedgerRoleName.CONTRIBUTOR), + new AadBasedSecurityPrincipal().withPrincipalId("epoo") + .withTenantId("nuvamiheogna") + .withLedgerRoleName(LedgerRoleName.ADMINISTRATOR), + new AadBasedSecurityPrincipal().withPrincipalId("theotusiv") + .withTenantId("v") + .withLedgerRoleName(LedgerRoleName.ADMINISTRATOR))) + .withCertBasedSecurityPrincipals(Arrays.asList( + new CertBasedSecurityPrincipal().withCert("nhungbw").withLedgerRoleName(LedgerRoleName.ADMINISTRATOR), + new CertBasedSecurityPrincipal().withCert("fygxgispemvtzfk") + .withLedgerRoleName(LedgerRoleName.READER))); model = BinaryData.fromObject(model).toObject(LedgerProperties.class); - Assertions.assertEquals(RunningState.ACTIVE, model.runningState()); + Assertions.assertEquals(RunningState.PAUSED, model.runningState()); Assertions.assertEquals(LedgerType.UNKNOWN, model.ledgerType()); - Assertions.assertEquals("ryffdfdosy", model.aadBasedSecurityPrincipals().get(0).principalId()); - Assertions.assertEquals("xpaojakhmsbz", model.aadBasedSecurityPrincipals().get(0).tenantId()); - Assertions - .assertEquals(LedgerRoleName.ADMINISTRATOR, model.aadBasedSecurityPrincipals().get(0).ledgerRoleName()); - Assertions.assertEquals("zitonpeqfpjkjl", model.certBasedSecurityPrincipals().get(0).cert()); - Assertions.assertEquals(LedgerRoleName.READER, model.certBasedSecurityPrincipals().get(0).ledgerRoleName()); + Assertions.assertEquals(LedgerSku.STANDARD, model.ledgerSku()); + Assertions.assertEquals("vhpfxxypininmay", model.aadBasedSecurityPrincipals().get(0).principalId()); + Assertions.assertEquals("ybb", model.aadBasedSecurityPrincipals().get(0).tenantId()); + Assertions.assertEquals(LedgerRoleName.CONTRIBUTOR, model.aadBasedSecurityPrincipals().get(0).ledgerRoleName()); + Assertions.assertEquals("nhungbw", model.certBasedSecurityPrincipals().get(0).cert()); + Assertions.assertEquals(LedgerRoleName.ADMINISTRATOR, + model.certBasedSecurityPrincipals().get(0).ledgerRoleName()); } } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersBackupMockTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersBackupMockTests.java new file mode 100644 index 000000000000..ea013cd7a051 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersBackupMockTests.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.confidentialledger.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager; +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerBackup; +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerBackupResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class LedgersBackupMockTests { + @Test + public void testBackup() throws Exception { + String responseStr = "{\"message\":\"qjsdpydnfyhxdeo\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ConfidentialLedgerManager manager = ConfidentialLedgerManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + ConfidentialLedgerBackupResponse response = manager.ledgers() + .backup("yxoegukgjnp", "ucgygevqz", + new ConfidentialLedgerBackup().withRestoreRegion("yp").withUri("rbpizc"), + com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersCreateMockTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersCreateMockTests.java index d6ff9afa1882..256d8b510969 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersCreateMockTests.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersCreateMockTests.java @@ -6,17 +6,18 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager; +import com.azure.resourcemanager.confidentialledger.models.AadBasedSecurityPrincipal; +import com.azure.resourcemanager.confidentialledger.models.CertBasedSecurityPrincipal; import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedger; import com.azure.resourcemanager.confidentialledger.models.LedgerProperties; +import com.azure.resourcemanager.confidentialledger.models.LedgerRoleName; +import com.azure.resourcemanager.confidentialledger.models.LedgerSku; import com.azure.resourcemanager.confidentialledger.models.LedgerType; import com.azure.resourcemanager.confidentialledger.models.RunningState; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; @@ -24,77 +25,60 @@ import java.util.Map; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class LedgersCreateMockTests { @Test public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + String responseStr + = "{\"properties\":{\"ledgerName\":\"pnq\",\"ledgerUri\":\"hmgkbrpyy\",\"identityServiceUri\":\"ibnuqqkpik\",\"ledgerInternalNamespace\":\"rgvtqag\",\"runningState\":\"Paused\",\"ledgerType\":\"Private\",\"provisioningState\":\"Succeeded\",\"ledgerSku\":\"Unknown\",\"aadBasedSecurityPrincipals\":[{\"principalId\":\"bfs\",\"tenantId\":\"rbu\",\"ledgerRoleName\":\"Reader\"}],\"certBasedSecurityPrincipals\":[{\"cert\":\"azzmhjrunmpxt\",\"ledgerRoleName\":\"Administrator\"},{\"cert\":\"rbnlankxmyskp\",\"ledgerRoleName\":\"Reader\"}]},\"location\":\"btkcxywnytnrsyn\",\"tags\":{\"dbabp\":\"dybyxczfclhaa\",\"fkts\":\"lwrq\",\"nyyazttbtwwrqpue\":\"hsucoc\"},\"id\":\"ckzywbiexzfeyue\",\"name\":\"xibxujwbhqwalm\",\"type\":\"zyoxaepdkzjan\"}"; - String responseStr = - "{\"properties\":{\"ledgerName\":\"cciw\",\"ledgerUri\":\"juqk\",\"identityServiceUri\":\"sa\",\"ledgerInternalNamespace\":\"wkuofoskghsauu\",\"runningState\":\"Unknown\",\"ledgerType\":\"Unknown\",\"provisioningState\":\"Succeeded\",\"aadBasedSecurityPrincipals\":[],\"certBasedSecurityPrincipals\":[]},\"location\":\"idyjrrfbyaosvexc\",\"tags\":{\"vleggzfbuhfmvfax\":\"pclhocohslk\"},\"id\":\"ffeii\",\"name\":\"hl\",\"type\":\"m\"}"; + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ConfidentialLedgerManager manager = ConfidentialLedgerManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + ConfidentialLedger response = manager.ledgers() + .define("yqzrnkcqvyxlw") + .withRegion("wutttxfvjrbi") + .withExistingResourceGroup("uzoqft") + .withTags(mapOf("jky", "xepcyvahfn", "ljyoxgvcltb", "xjvuujqgidokg", "bijhtxfvgxbf", "sncghkjeszz", "ec", + "mxnehmp")) + .withProperties(new LedgerProperties().withRunningState(RunningState.PAUSING) + .withLedgerType(LedgerType.UNKNOWN) + .withLedgerSku(LedgerSku.STANDARD) + .withAadBasedSecurityPrincipals(Arrays.asList( + new AadBasedSecurityPrincipal().withPrincipalId("fkbey") + .withTenantId("wrmjmwvvjektc") + .withLedgerRoleName(LedgerRoleName.READER), + new AadBasedSecurityPrincipal().withPrincipalId("hwlrsf") + .withTenantId("zpwv") + .withLedgerRoleName(LedgerRoleName.CONTRIBUTOR))) + .withCertBasedSecurityPrincipals(Arrays.asList( + new CertBasedSecurityPrincipal().withCert("iqylihkaetck").withLedgerRoleName(LedgerRoleName.READER), + new CertBasedSecurityPrincipal().withCert("ivfsnk") + .withLedgerRoleName(LedgerRoleName.ADMINISTRATOR), + new CertBasedSecurityPrincipal().withCert("tqhjfbebrjcx") + .withLedgerRoleName(LedgerRoleName.CONTRIBUTOR)))) + .create(); - ConfidentialLedgerManager manager = - ConfidentialLedgerManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ConfidentialLedger response = - manager - .ledgers() - .define("tuo") - .withRegion("wqsmbsur") - .withExistingResourceGroup("yhltrpmopjmcm") - .withTags( - mapOf( - "dystkiiuxhqyud", - "moryocfsfksym", - "rq", - "o", - "oczvy", - "b", - "watkpnpulexxb", - "fqrvkdvjsllrmvvd")) - .withProperties( - new LedgerProperties() - .withRunningState(RunningState.RESUMING) - .withLedgerType(LedgerType.PRIVATE) - .withAadBasedSecurityPrincipals(Arrays.asList()) - .withCertBasedSecurityPrincipals(Arrays.asList())) - .create(); - - Assertions.assertEquals("idyjrrfbyaosvexc", response.location()); - Assertions.assertEquals("pclhocohslk", response.tags().get("vleggzfbuhfmvfax")); - Assertions.assertEquals(RunningState.UNKNOWN, response.properties().runningState()); - Assertions.assertEquals(LedgerType.UNKNOWN, response.properties().ledgerType()); + Assertions.assertEquals("btkcxywnytnrsyn", response.location()); + Assertions.assertEquals("dybyxczfclhaa", response.tags().get("dbabp")); + Assertions.assertEquals(RunningState.PAUSED, response.properties().runningState()); + Assertions.assertEquals(LedgerType.PRIVATE, response.properties().ledgerType()); + Assertions.assertEquals(LedgerSku.UNKNOWN, response.properties().ledgerSku()); + Assertions.assertEquals("bfs", response.properties().aadBasedSecurityPrincipals().get(0).principalId()); + Assertions.assertEquals("rbu", response.properties().aadBasedSecurityPrincipals().get(0).tenantId()); + Assertions.assertEquals(LedgerRoleName.READER, + response.properties().aadBasedSecurityPrincipals().get(0).ledgerRoleName()); + Assertions.assertEquals("azzmhjrunmpxt", response.properties().certBasedSecurityPrincipals().get(0).cert()); + Assertions.assertEquals(LedgerRoleName.ADMINISTRATOR, + response.properties().certBasedSecurityPrincipals().get(0).ledgerRoleName()); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersDeleteMockTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersDeleteMockTests.java index f0a88f96f813..ec062db058cc 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersDeleteMockTests.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersDeleteMockTests.java @@ -6,56 +6,28 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class LedgersDeleteMockTests { @Test public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ConfidentialLedgerManager manager = ConfidentialLedgerManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - ConfidentialLedgerManager manager = - ConfidentialLedgerManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + manager.ledgers().delete("yggdtjixh", "kuofqweykhme", com.azure.core.util.Context.NONE); - manager.ledgers().delete("feallnwsu", "isnjampmngnz", com.azure.core.util.Context.NONE); } } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersGetByResourceGroupWithResponseMockTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersGetByResourceGroupWithResponseMockTests.java index b0559b1399dd..fde9dfb17130 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersGetByResourceGroupWithResponseMockTests.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersGetByResourceGroupWithResponseMockTests.java @@ -6,67 +6,49 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager; import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedger; +import com.azure.resourcemanager.confidentialledger.models.LedgerRoleName; +import com.azure.resourcemanager.confidentialledger.models.LedgerSku; import com.azure.resourcemanager.confidentialledger.models.LedgerType; import com.azure.resourcemanager.confidentialledger.models.RunningState; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class LedgersGetByResourceGroupWithResponseMockTests { @Test public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"ledgerName\":\"nyktzlcuiy\",\"ledgerUri\":\"qyw\",\"identityServiceUri\":\"drvyn\",\"ledgerInternalNamespace\":\"gpphrcgyn\",\"runningState\":\"Pausing\",\"ledgerType\":\"Unknown\",\"provisioningState\":\"Canceled\",\"aadBasedSecurityPrincipals\":[],\"certBasedSecurityPrincipals\":[]},\"location\":\"ofsx\",\"tags\":{\"bmqj\":\"v\",\"lzu\":\"abcypmivk\"},\"id\":\"ccfwnfnbacfion\",\"name\":\"ebxetqgtzxdp\",\"type\":\"qbqqwxr\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ConfidentialLedgerManager manager = - ConfidentialLedgerManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ConfidentialLedger response = - manager.ledgers().getByResourceGroupWithResponse("h", "qfbow", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("ofsx", response.location()); - Assertions.assertEquals("v", response.tags().get("bmqj")); + String responseStr + = "{\"properties\":{\"ledgerName\":\"c\",\"ledgerUri\":\"qwoochcbon\",\"identityServiceUri\":\"pkvlrxn\",\"ledgerInternalNamespace\":\"ase\",\"runningState\":\"Pausing\",\"ledgerType\":\"Unknown\",\"provisioningState\":\"Canceled\",\"ledgerSku\":\"Basic\",\"aadBasedSecurityPrincipals\":[{\"principalId\":\"ienjbdlwtgr\",\"tenantId\":\"djpjumasxazjpq\",\"ledgerRoleName\":\"Reader\"},{\"principalId\":\"alhbx\",\"tenantId\":\"e\",\"ledgerRoleName\":\"Contributor\"}],\"certBasedSecurityPrincipals\":[{\"cert\":\"udgwdslfho\",\"ledgerRoleName\":\"Reader\"}]},\"location\":\"ynpwlbj\",\"tags\":{\"ehxnltyfsop\":\"acfta\",\"nzwdejba\":\"usue\",\"xdn\":\"orxzdmohctbqvud\"},\"id\":\"nvowgujju\",\"name\":\"wdkcglhsl\",\"type\":\"zj\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ConfidentialLedgerManager manager = ConfidentialLedgerManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + ConfidentialLedger response = manager.ledgers() + .getByResourceGroupWithResponse("xrjfeallnwsub", "snjampmng", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("ynpwlbj", response.location()); + Assertions.assertEquals("acfta", response.tags().get("ehxnltyfsop")); Assertions.assertEquals(RunningState.PAUSING, response.properties().runningState()); Assertions.assertEquals(LedgerType.UNKNOWN, response.properties().ledgerType()); + Assertions.assertEquals(LedgerSku.BASIC, response.properties().ledgerSku()); + Assertions.assertEquals("ienjbdlwtgr", response.properties().aadBasedSecurityPrincipals().get(0).principalId()); + Assertions.assertEquals("djpjumasxazjpq", response.properties().aadBasedSecurityPrincipals().get(0).tenantId()); + Assertions.assertEquals(LedgerRoleName.READER, + response.properties().aadBasedSecurityPrincipals().get(0).ledgerRoleName()); + Assertions.assertEquals("udgwdslfho", response.properties().certBasedSecurityPrincipals().get(0).cert()); + Assertions.assertEquals(LedgerRoleName.READER, + response.properties().certBasedSecurityPrincipals().get(0).ledgerRoleName()); } } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersListByResourceGroupMockTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersListByResourceGroupMockTests.java index 1a91489c5333..130bb59bbd77 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersListByResourceGroupMockTests.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersListByResourceGroupMockTests.java @@ -6,68 +6,52 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager; import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedger; +import com.azure.resourcemanager.confidentialledger.models.LedgerRoleName; +import com.azure.resourcemanager.confidentialledger.models.LedgerSku; import com.azure.resourcemanager.confidentialledger.models.LedgerType; import com.azure.resourcemanager.confidentialledger.models.RunningState; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class LedgersListByResourceGroupMockTests { @Test public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"ledgerName\":\"hcbonqvpkvlr\",\"ledgerUri\":\"jease\",\"identityServiceUri\":\"heoflokeyyienjbd\",\"ledgerInternalNamespace\":\"tgrhpdjpjumas\",\"runningState\":\"Unknown\",\"ledgerType\":\"Public\",\"provisioningState\":\"Unknown\",\"aadBasedSecurityPrincipals\":[],\"certBasedSecurityPrincipals\":[]},\"location\":\"hb\",\"tags\":{\"jzzvdud\":\"e\",\"pwlbjnpg\":\"wdslfhotwmcy\"},\"id\":\"cftadeh\",\"name\":\"nltyfsoppusuesnz\",\"type\":\"dejbavo\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ConfidentialLedgerManager manager = - ConfidentialLedgerManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.ledgers().listByResourceGroup("c", "aqw", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("hb", response.iterator().next().location()); - Assertions.assertEquals("e", response.iterator().next().tags().get("jzzvdud")); - Assertions.assertEquals(RunningState.UNKNOWN, response.iterator().next().properties().runningState()); - Assertions.assertEquals(LedgerType.PUBLIC, response.iterator().next().properties().ledgerType()); + String responseStr + = "{\"value\":[{\"properties\":{\"ledgerName\":\"ctehfiqscjey\",\"ledgerUri\":\"hezrkgq\",\"identityServiceUri\":\"jrefovgmkqsle\",\"ledgerInternalNamespace\":\"vxyqjpkcattpngjc\",\"runningState\":\"Resuming\",\"ledgerType\":\"Private\",\"provisioningState\":\"Unknown\",\"ledgerSku\":\"Standard\",\"aadBasedSecurityPrincipals\":[{\"principalId\":\"ajvnysounqe\",\"tenantId\":\"noae\",\"ledgerRoleName\":\"Administrator\"},{\"principalId\":\"yhltrpmopjmcm\",\"tenantId\":\"u\",\"ledgerRoleName\":\"Reader\"}],\"certBasedSecurityPrincipals\":[{\"cert\":\"iuaod\",\"ledgerRoleName\":\"Administrator\"}]},\"location\":\"kvxod\",\"tags\":{\"axbezyiuo\":\"zmyzydagf\",\"dxwzywqsmbsurexi\":\"ktwh\",\"yocf\":\"o\"},\"id\":\"fksymddystki\",\"name\":\"uxh\",\"type\":\"yudxorrqnbp\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ConfidentialLedgerManager manager = ConfidentialLedgerManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response + = manager.ledgers().listByResourceGroup("evfyexfwhybcib", "yvdcsitynnaa", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("kvxod", response.iterator().next().location()); + Assertions.assertEquals("zmyzydagf", response.iterator().next().tags().get("axbezyiuo")); + Assertions.assertEquals(RunningState.RESUMING, response.iterator().next().properties().runningState()); + Assertions.assertEquals(LedgerType.PRIVATE, response.iterator().next().properties().ledgerType()); + Assertions.assertEquals(LedgerSku.STANDARD, response.iterator().next().properties().ledgerSku()); + Assertions.assertEquals("ajvnysounqe", + response.iterator().next().properties().aadBasedSecurityPrincipals().get(0).principalId()); + Assertions.assertEquals("noae", + response.iterator().next().properties().aadBasedSecurityPrincipals().get(0).tenantId()); + Assertions.assertEquals(LedgerRoleName.ADMINISTRATOR, + response.iterator().next().properties().aadBasedSecurityPrincipals().get(0).ledgerRoleName()); + Assertions.assertEquals("iuaod", + response.iterator().next().properties().certBasedSecurityPrincipals().get(0).cert()); + Assertions.assertEquals(LedgerRoleName.ADMINISTRATOR, + response.iterator().next().properties().certBasedSecurityPrincipals().get(0).ledgerRoleName()); } } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersListMockTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersListMockTests.java index 6330da9a9ce8..9ab81c8d7bcb 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersListMockTests.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersListMockTests.java @@ -6,68 +6,52 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager; import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedger; +import com.azure.resourcemanager.confidentialledger.models.LedgerRoleName; +import com.azure.resourcemanager.confidentialledger.models.LedgerSku; import com.azure.resourcemanager.confidentialledger.models.LedgerType; import com.azure.resourcemanager.confidentialledger.models.RunningState; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class LedgersListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"ledgerName\":\"dwxdndnv\",\"ledgerUri\":\"gujjugwdkcglh\",\"identityServiceUri\":\"azjdyggd\",\"ledgerInternalNamespace\":\"ixhbkuofqweykhm\",\"runningState\":\"Paused\",\"ledgerType\":\"Private\",\"provisioningState\":\"Unknown\",\"aadBasedSecurityPrincipals\":[],\"certBasedSecurityPrincipals\":[]},\"location\":\"bcibvyvdcsitynn\",\"tags\":{\"eypvhezrkg\":\"dectehfiqsc\",\"sle\":\"hcjrefovgmk\",\"cattpngjcrcczsq\":\"yvxyqjp\",\"mdajv\":\"jh\"},\"id\":\"ysou\",\"name\":\"q\",\"type\":\"canoaeupf\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ConfidentialLedgerManager manager = - ConfidentialLedgerManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.ledgers().list("xzdmohctb", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("bcibvyvdcsitynn", response.iterator().next().location()); - Assertions.assertEquals("dectehfiqsc", response.iterator().next().tags().get("eypvhezrkg")); - Assertions.assertEquals(RunningState.PAUSED, response.iterator().next().properties().runningState()); + String responseStr + = "{\"value\":[{\"properties\":{\"ledgerName\":\"dvjsllrmvvdf\",\"ledgerUri\":\"t\",\"identityServiceUri\":\"n\",\"ledgerInternalNamespace\":\"lexxbczwtru\",\"runningState\":\"Resuming\",\"ledgerType\":\"Private\",\"provisioningState\":\"Failed\",\"ledgerSku\":\"Basic\",\"aadBasedSecurityPrincipals\":[{\"principalId\":\"yokacspkw\",\"tenantId\":\"zdobpxjmflbvvnch\",\"ledgerRoleName\":\"Reader\"},{\"principalId\":\"iwwzjuqk\",\"tenantId\":\"sa\",\"ledgerRoleName\":\"Administrator\"},{\"principalId\":\"uo\",\"tenantId\":\"skghsauuimj\",\"ledgerRoleName\":\"Administrator\"}],\"certBasedSecurityPrincipals\":[{\"cert\":\"uugidyjrrfby\",\"ledgerRoleName\":\"Contributor\"},{\"cert\":\"e\",\"ledgerRoleName\":\"Reader\"}]},\"location\":\"npc\",\"tags\":{\"eggzfb\":\"cohslkev\",\"ithlvmezyvshxm\":\"hfmvfaxkffe\",\"gigr\":\"sbbzo\"},\"id\":\"wburvjxxjnspydpt\",\"name\":\"oenkouknvudwti\",\"type\":\"kbldngkpocipa\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ConfidentialLedgerManager manager = ConfidentialLedgerManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response + = manager.ledgers().list("czvyifq", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("npc", response.iterator().next().location()); + Assertions.assertEquals("cohslkev", response.iterator().next().tags().get("eggzfb")); + Assertions.assertEquals(RunningState.RESUMING, response.iterator().next().properties().runningState()); Assertions.assertEquals(LedgerType.PRIVATE, response.iterator().next().properties().ledgerType()); + Assertions.assertEquals(LedgerSku.BASIC, response.iterator().next().properties().ledgerSku()); + Assertions.assertEquals("yokacspkw", + response.iterator().next().properties().aadBasedSecurityPrincipals().get(0).principalId()); + Assertions.assertEquals("zdobpxjmflbvvnch", + response.iterator().next().properties().aadBasedSecurityPrincipals().get(0).tenantId()); + Assertions.assertEquals(LedgerRoleName.READER, + response.iterator().next().properties().aadBasedSecurityPrincipals().get(0).ledgerRoleName()); + Assertions.assertEquals("uugidyjrrfby", + response.iterator().next().properties().certBasedSecurityPrincipals().get(0).cert()); + Assertions.assertEquals(LedgerRoleName.CONTRIBUTOR, + response.iterator().next().properties().certBasedSecurityPrincipals().get(0).ledgerRoleName()); } } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersRestoreMockTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersRestoreMockTests.java new file mode 100644 index 000000000000..3b6c7a745e85 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/LedgersRestoreMockTests.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.confidentialledger.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager; +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerRestore; +import com.azure.resourcemanager.confidentialledger.models.ConfidentialLedgerRestoreResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class LedgersRestoreMockTests { + @Test + public void testRestore() throws Exception { + String responseStr = "{\"message\":\"ixzbinjeputtmryw\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ConfidentialLedgerManager manager = ConfidentialLedgerManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + ConfidentialLedgerRestoreResponse response = manager.ledgers() + .restore("jzicwifsjt", "gzfbishcbk", + new ConfidentialLedgerRestore().withFileShareName("ajdeyeamdphaga") + .withRestoreRegion("pbuxwgipwhon") + .withUri("wkgshwa"), + com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfBackupResponseInnerTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfBackupResponseInnerTests.java new file mode 100644 index 000000000000..6fffaa2116ea --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfBackupResponseInnerTests.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.confidentialledger.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfBackupResponseInner; + +public final class ManagedCcfBackupResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedCcfBackupResponseInner model + = BinaryData.fromString("{\"message\":\"qdrabhjybigehoqf\"}").toObject(ManagedCcfBackupResponseInner.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedCcfBackupResponseInner model = new ManagedCcfBackupResponseInner(); + model = BinaryData.fromObject(model).toObject(ManagedCcfBackupResponseInner.class); + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfBackupTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfBackupTests.java new file mode 100644 index 000000000000..46393592d2aa --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfBackupTests.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.confidentialledger.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfBackup; +import org.junit.jupiter.api.Assertions; + +public final class ManagedCcfBackupTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedCcfBackup model = BinaryData.fromString("{\"restoreRegion\":\"fgugnxkrxdqmid\",\"uri\":\"thz\"}") + .toObject(ManagedCcfBackup.class); + Assertions.assertEquals("fgugnxkrxdqmid", model.restoreRegion()); + Assertions.assertEquals("thz", model.uri()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedCcfBackup model = new ManagedCcfBackup().withRestoreRegion("fgugnxkrxdqmid").withUri("thz"); + model = BinaryData.fromObject(model).toObject(ManagedCcfBackup.class); + Assertions.assertEquals("fgugnxkrxdqmid", model.restoreRegion()); + Assertions.assertEquals("thz", model.uri()); + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfListTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfListTests.java deleted file mode 100644 index d9bc842006e5..000000000000 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfListTests.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.confidentialledger.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfInner; -import com.azure.resourcemanager.confidentialledger.models.ManagedCcfList; -import com.azure.resourcemanager.confidentialledger.models.ManagedCcfProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ManagedCcfListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedCcfList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"appName\":\"wu\",\"appUri\":\"gazxuf\",\"identityServiceUri\":\"uckyf\",\"memberIdentityCertificates\":[],\"provisioningState\":\"Canceled\",\"nodeCount\":534635279},\"location\":\"zwdzuh\",\"tags\":{\"wxmnteiwao\":\"wisdkft\",\"fsrpymzidnse\":\"vkmijcmmxdcuf\",\"yc\":\"cxtbzsg\",\"mdwzjeiachboo\":\"sne\"},\"id\":\"flnrosfqpteehzz\",\"name\":\"ypyqrimzinp\",\"type\":\"swjdkirso\"},{\"properties\":{\"appName\":\"xhcr\",\"appUri\":\"ohjtckw\",\"identityServiceUri\":\"soifiyipjxsqw\",\"memberIdentityCertificates\":[],\"provisioningState\":\"Unknown\",\"nodeCount\":1837885218},\"location\":\"rcjxvsnbyxqabn\",\"tags\":{\"zafb\":\"pcyshu\"},\"id\":\"jjgpb\",\"name\":\"oq\",\"type\":\"jmkljavbqidtqajz\"},{\"properties\":{\"appName\":\"pku\",\"appUri\":\"krlkhbzhfepg\",\"identityServiceUri\":\"qex\",\"memberIdentityCertificates\":[],\"provisioningState\":\"Succeeded\",\"nodeCount\":149734817},\"location\":\"aierhhb\",\"tags\":{\"mmajtjaodx\":\"l\"},\"id\":\"bnbdxkqpxokajion\",\"name\":\"imexgstxgcpodgma\",\"type\":\"jrmvdjwzrlo\"},{\"properties\":{\"appName\":\"lwhijcoejctbzaq\",\"appUri\":\"sycbkbfk\",\"identityServiceUri\":\"kdkexxp\",\"memberIdentityCertificates\":[],\"provisioningState\":\"Creating\",\"nodeCount\":159547648},\"location\":\"fjpgddtocjjxhvp\",\"tags\":{\"xibqeojnx\":\"exhd\",\"dntwndeicbtw\":\"bzv\"},\"id\":\"pzaoqvuhr\",\"name\":\"cffcyddglmj\",\"type\":\"hjq\"}],\"nextLink\":\"pyeicxm\"}") - .toObject(ManagedCcfList.class); - Assertions.assertEquals("zwdzuh", model.value().get(0).location()); - Assertions.assertEquals("wisdkft", model.value().get(0).tags().get("wxmnteiwao")); - Assertions.assertEquals(534635279, model.value().get(0).properties().nodeCount()); - Assertions.assertEquals("pyeicxm", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedCcfList model = - new ManagedCcfList() - .withValue( - Arrays - .asList( - new ManagedCcfInner() - .withLocation("zwdzuh") - .withTags( - mapOf( - "wxmnteiwao", - "wisdkft", - "fsrpymzidnse", - "vkmijcmmxdcuf", - "yc", - "cxtbzsg", - "mdwzjeiachboo", - "sne")) - .withProperties( - new ManagedCcfProperties() - .withMemberIdentityCertificates(Arrays.asList()) - .withNodeCount(534635279)), - new ManagedCcfInner() - .withLocation("rcjxvsnbyxqabn") - .withTags(mapOf("zafb", "pcyshu")) - .withProperties( - new ManagedCcfProperties() - .withMemberIdentityCertificates(Arrays.asList()) - .withNodeCount(1837885218)), - new ManagedCcfInner() - .withLocation("aierhhb") - .withTags(mapOf("mmajtjaodx", "l")) - .withProperties( - new ManagedCcfProperties() - .withMemberIdentityCertificates(Arrays.asList()) - .withNodeCount(149734817)), - new ManagedCcfInner() - .withLocation("fjpgddtocjjxhvp") - .withTags(mapOf("xibqeojnx", "exhd", "dntwndeicbtw", "bzv")) - .withProperties( - new ManagedCcfProperties() - .withMemberIdentityCertificates(Arrays.asList()) - .withNodeCount(159547648)))) - .withNextLink("pyeicxm"); - model = BinaryData.fromObject(model).toObject(ManagedCcfList.class); - Assertions.assertEquals("zwdzuh", model.value().get(0).location()); - Assertions.assertEquals("wisdkft", model.value().get(0).tags().get("wxmnteiwao")); - Assertions.assertEquals(534635279, model.value().get(0).properties().nodeCount()); - Assertions.assertEquals("pyeicxm", model.nextLink()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfRestoreResponseInnerTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfRestoreResponseInnerTests.java new file mode 100644 index 000000000000..69b94cf07ea7 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfRestoreResponseInnerTests.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.confidentialledger.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfRestoreResponseInner; + +public final class ManagedCcfRestoreResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedCcfRestoreResponseInner model + = BinaryData.fromString("{\"message\":\"hrc\"}").toObject(ManagedCcfRestoreResponseInner.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedCcfRestoreResponseInner model = new ManagedCcfRestoreResponseInner(); + model = BinaryData.fromObject(model).toObject(ManagedCcfRestoreResponseInner.class); + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfRestoreTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfRestoreTests.java new file mode 100644 index 000000000000..0ccd63d193d8 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfRestoreTests.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.confidentialledger.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfRestore; +import org.junit.jupiter.api.Assertions; + +public final class ManagedCcfRestoreTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedCcfRestore model = BinaryData + .fromString("{\"fileShareName\":\"owskanyktz\",\"restoreRegion\":\"cuiywgqyw\",\"uri\":\"ndrvynhzg\"}") + .toObject(ManagedCcfRestore.class); + Assertions.assertEquals("owskanyktz", model.fileShareName()); + Assertions.assertEquals("cuiywgqyw", model.restoreRegion()); + Assertions.assertEquals("ndrvynhzg", model.uri()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedCcfRestore model = new ManagedCcfRestore().withFileShareName("owskanyktz") + .withRestoreRegion("cuiywgqyw") + .withUri("ndrvynhzg"); + model = BinaryData.fromObject(model).toObject(ManagedCcfRestore.class); + Assertions.assertEquals("owskanyktz", model.fileShareName()); + Assertions.assertEquals("cuiywgqyw", model.restoreRegion()); + Assertions.assertEquals("ndrvynhzg", model.uri()); + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsBackupMockTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsBackupMockTests.java new file mode 100644 index 000000000000..6c39f2c617a8 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsBackupMockTests.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.confidentialledger.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager; +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfBackup; +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfBackupResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ManagedCcfsBackupMockTests { + @Test + public void testBackup() throws Exception { + String responseStr = "{\"message\":\"njbkcnxdhbttkph\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ConfidentialLedgerManager manager = ConfidentialLedgerManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + ManagedCcfBackupResponse response = manager.managedCcfs() + .backup("twrupqsxvnm", "cykvceo", new ManagedCcfBackup().withRestoreRegion("ilovnot").withUri("fj"), + com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsCreateMockTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsCreateMockTests.java deleted file mode 100644 index 7b4ae97e4f18..000000000000 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsCreateMockTests.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.confidentialledger.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager; -import com.azure.resourcemanager.confidentialledger.models.DeploymentType; -import com.azure.resourcemanager.confidentialledger.models.LanguageRuntime; -import com.azure.resourcemanager.confidentialledger.models.ManagedCcf; -import com.azure.resourcemanager.confidentialledger.models.ManagedCcfProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ManagedCcfsCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"appName\":\"phoxus\",\"appUri\":\"pabgyeps\",\"identityServiceUri\":\"tazqugxywpmueefj\",\"memberIdentityCertificates\":[],\"deploymentType\":{\"languageRuntime\":\"CPP\",\"appSourceUri\":\"jidsuyonobglaoc\"},\"provisioningState\":\"Succeeded\",\"nodeCount\":1581079817},\"location\":\"g\",\"tags\":{\"lmoyrx\":\"xy\"},\"id\":\"wfudwpzntxhdzhl\",\"name\":\"qj\",\"type\":\"hckfrlhrx\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ConfidentialLedgerManager manager = - ConfidentialLedgerManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ManagedCcf response = - manager - .managedCcfs() - .define("fpl") - .withRegion("smtxpsieb") - .withExistingResourceGroup("svmkfssxquk") - .withTags( - mapOf( - "tldwkyzxuutk", - "vpesapskrdqmhjjd", - "togt", - "cwscwsvlx", - "vce", - "rupqsxvnmicy", - "ovnotyfjfcnjbkcn", - "vei")) - .withProperties( - new ManagedCcfProperties() - .withMemberIdentityCertificates(Arrays.asList()) - .withDeploymentType( - new DeploymentType() - .withLanguageRuntime(LanguageRuntime.CPP) - .withAppSourceUri("baumnyqupedeoj")) - .withNodeCount(996509936)) - .create(); - - Assertions.assertEquals("g", response.location()); - Assertions.assertEquals("xy", response.tags().get("lmoyrx")); - Assertions.assertEquals(LanguageRuntime.CPP, response.properties().deploymentType().languageRuntime()); - Assertions.assertEquals("jidsuyonobglaoc", response.properties().deploymentType().appSourceUri()); - Assertions.assertEquals(1581079817, response.properties().nodeCount()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsDeleteMockTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsDeleteMockTests.java index e987734e3f10..ef34e0237091 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsDeleteMockTests.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsDeleteMockTests.java @@ -6,56 +6,28 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ManagedCcfsDeleteMockTests { @Test public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ConfidentialLedgerManager manager = ConfidentialLedgerManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - ConfidentialLedgerManager manager = - ConfidentialLedgerManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + manager.managedCcfs().delete("ovplw", "bhvgy", com.azure.core.util.Context.NONE); - manager.managedCcfs().delete("qnwvlrya", "w", com.azure.core.util.Context.NONE); } } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsGetByResourceGroupWithResponseMockTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index dce859e75cb0..000000000000 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.confidentialledger.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager; -import com.azure.resourcemanager.confidentialledger.models.LanguageRuntime; -import com.azure.resourcemanager.confidentialledger.models.ManagedCcf; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ManagedCcfsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"appName\":\"rvjx\",\"appUri\":\"nspydptkoenkoukn\",\"identityServiceUri\":\"dwtiukbldngkp\",\"memberIdentityCertificates\":[],\"deploymentType\":{\"languageRuntime\":\"CPP\",\"appSourceUri\":\"xoegukgjnpiucgy\"},\"provisioningState\":\"Creating\",\"nodeCount\":2009239525},\"location\":\"typmrbpizcdrqjsd\",\"tags\":{\"eoejzic\":\"nfyhx\",\"hajdeyeamdpha\":\"ifsjttgzfbishcb\",\"wkgshwa\":\"alpbuxwgipwhon\",\"bin\":\"kix\"},\"id\":\"eputtmrywnuzoqf\",\"name\":\"iyqzrnk\",\"type\":\"qvyxlwhzlsicoho\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ConfidentialLedgerManager manager = - ConfidentialLedgerManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ManagedCcf response = - manager - .managedCcfs() - .getByResourceGroupWithResponse("zy", "shxmzsbbzoggigrx", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("typmrbpizcdrqjsd", response.location()); - Assertions.assertEquals("nfyhx", response.tags().get("eoejzic")); - Assertions.assertEquals(LanguageRuntime.CPP, response.properties().deploymentType().languageRuntime()); - Assertions.assertEquals("xoegukgjnpiucgy", response.properties().deploymentType().appSourceUri()); - Assertions.assertEquals(2009239525, response.properties().nodeCount()); - } -} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsListByResourceGroupMockTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsListByResourceGroupMockTests.java deleted file mode 100644 index ee54b88c9155..000000000000 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsListByResourceGroupMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.confidentialledger.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager; -import com.azure.resourcemanager.confidentialledger.models.LanguageRuntime; -import com.azure.resourcemanager.confidentialledger.models.ManagedCcf; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ManagedCcfsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"appName\":\"vecxgodebfqkk\",\"appUri\":\"mpukgriw\",\"identityServiceUri\":\"zlfbxzpuzycispnq\",\"memberIdentityCertificates\":[],\"deploymentType\":{\"languageRuntime\":\"JS\",\"appSourceUri\":\"rp\"},\"provisioningState\":\"Succeeded\",\"nodeCount\":380689806},\"location\":\"nuqqkpikadrgvt\",\"tags\":{\"uynhijg\":\"n\",\"iarbutrcvpna\":\"mebf\"},\"id\":\"zmhjrunmp\",\"name\":\"ttdbhrbnl\",\"type\":\"nkxmyskpbhenbtk\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ConfidentialLedgerManager manager = - ConfidentialLedgerManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .managedCcfs() - .listByResourceGroup("bgsncghkjeszzhb", "jhtxfvgxbfsmxne", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("nuqqkpikadrgvt", response.iterator().next().location()); - Assertions.assertEquals("n", response.iterator().next().tags().get("uynhijg")); - Assertions - .assertEquals( - LanguageRuntime.JS, response.iterator().next().properties().deploymentType().languageRuntime()); - Assertions.assertEquals("rp", response.iterator().next().properties().deploymentType().appSourceUri()); - Assertions.assertEquals(380689806, response.iterator().next().properties().nodeCount()); - } -} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsListMockTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsListMockTests.java deleted file mode 100644 index 8ee42971f441..000000000000 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsListMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.confidentialledger.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager; -import com.azure.resourcemanager.confidentialledger.models.LanguageRuntime; -import com.azure.resourcemanager.confidentialledger.models.ManagedCcf; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ManagedCcfsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"appName\":\"czfc\",\"appUri\":\"aaxdbabphlwrq\",\"identityServiceUri\":\"ktsthsucocmny\",\"memberIdentityCertificates\":[],\"deploymentType\":{\"languageRuntime\":\"CPP\",\"appSourceUri\":\"wwrq\"},\"provisioningState\":\"Deleting\",\"nodeCount\":1640743814},\"location\":\"zywbiex\",\"tags\":{\"qwalmuzyoxaepd\":\"yueaxibxujwb\",\"d\":\"zjancuxr\",\"dbpgnxytxhp\":\"bavxbniwdjswzt\",\"lcuhxwtctyqiklb\":\"xbzpfzab\"},\"id\":\"ovplw\",\"name\":\"bhvgy\",\"type\":\"gu\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ConfidentialLedgerManager manager = - ConfidentialLedgerManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.managedCcfs().list("xywnytnrsynlqidy", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("zywbiex", response.iterator().next().location()); - Assertions.assertEquals("yueaxibxujwb", response.iterator().next().tags().get("qwalmuzyoxaepd")); - Assertions - .assertEquals( - LanguageRuntime.CPP, response.iterator().next().properties().deploymentType().languageRuntime()); - Assertions.assertEquals("wwrq", response.iterator().next().properties().deploymentType().appSourceUri()); - Assertions.assertEquals(1640743814, response.iterator().next().properties().nodeCount()); - } -} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsRestoreMockTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsRestoreMockTests.java new file mode 100644 index 000000000000..3f34a40ca4f7 --- /dev/null +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsRestoreMockTests.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.confidentialledger.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager; +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfRestore; +import com.azure.resourcemanager.confidentialledger.models.ManagedCcfRestoreResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ManagedCcfsRestoreMockTests { + @Test + public void testRestore() throws Exception { + String responseStr = "{\"message\":\"ugxywpmueef\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ConfidentialLedgerManager manager = ConfidentialLedgerManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + ManagedCcfRestoreResponse response = manager.managedCcfs() + .restore("wpn", "jtoqne", + new ManagedCcfRestore().withFileShareName("mclfplphoxuscr").withRestoreRegion("abgy").withUri("psbjta"), + com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsUpdateMockTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsUpdateMockTests.java deleted file mode 100644 index 0db56cbe91a2..000000000000 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ManagedCcfsUpdateMockTests.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.confidentialledger.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager; -import com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfInner; -import com.azure.resourcemanager.confidentialledger.models.DeploymentType; -import com.azure.resourcemanager.confidentialledger.models.LanguageRuntime; -import com.azure.resourcemanager.confidentialledger.models.ManagedCcfProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ManagedCcfsUpdateMockTests { - @Test - public void testUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ConfidentialLedgerManager manager = - ConfidentialLedgerManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .managedCcfs() - .update( - "heun", - "mqhgyxzkonocuk", - new ManagedCcfInner() - .withLocation("ihkaetcktvfc") - .withTags(mapOf("jf", "snkymuctq", "fuwutttxf", "ebrjcxe", "hfnljkyq", "jrbirphxepcyv")) - .withProperties( - new ManagedCcfProperties() - .withMemberIdentityCertificates(Arrays.asList()) - .withDeploymentType( - new DeploymentType() - .withLanguageRuntime(LanguageRuntime.JS) - .withAppSourceUri("pwvlqdq")) - .withNodeCount(629213684)), - com.azure.core.util.Context.NONE); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/OperationsListMockTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/OperationsListMockTests.java index 87f8c4321a46..7aacae9ba26b 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/OperationsListMockTests.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/OperationsListMockTests.java @@ -6,68 +6,39 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager; import com.azure.resourcemanager.confidentialledger.models.ResourceProviderOperationDefinition; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class OperationsListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"iwqvhkh\",\"isDataAction\":true,\"display\":{\"provider\":\"dtopbob\",\"resource\":\"ghmewuam\",\"operation\":\"hrzayvvtpgvdf\",\"description\":\"otkftutqxlngx\"}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ConfidentialLedgerManager manager = - ConfidentialLedgerManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.operations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("iwqvhkh", response.iterator().next().name()); - Assertions.assertEquals(true, response.iterator().next().isDataAction()); - Assertions.assertEquals("dtopbob", response.iterator().next().display().provider()); - Assertions.assertEquals("ghmewuam", response.iterator().next().display().resource()); - Assertions.assertEquals("hrzayvvtpgvdf", response.iterator().next().display().operation()); - Assertions.assertEquals("otkftutqxlngx", response.iterator().next().display().description()); + String responseStr + = "{\"value\":[{\"name\":\"nc\",\"isDataAction\":false,\"display\":{\"provider\":\"fvm\",\"resource\":\"oo\",\"operation\":\"xlzevgbmqjqabcy\",\"description\":\"ivkwlzuvccfwnfnb\"}}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ConfidentialLedgerManager manager = ConfidentialLedgerManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response + = manager.operations().list(com.azure.core.util.Context.NONE); + + Assertions.assertEquals("nc", response.iterator().next().name()); + Assertions.assertEquals(false, response.iterator().next().isDataAction()); + Assertions.assertEquals("fvm", response.iterator().next().display().provider()); + Assertions.assertEquals("oo", response.iterator().next().display().resource()); + Assertions.assertEquals("xlzevgbmqjqabcy", response.iterator().next().display().operation()); + Assertions.assertEquals("ivkwlzuvccfwnfnb", response.iterator().next().display().description()); } } diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ResourceProviderOperationDefinitionInnerTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ResourceProviderOperationDefinitionInnerTests.java index aa1894ebaada..aa02a68f6ad2 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ResourceProviderOperationDefinitionInnerTests.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ResourceProviderOperationDefinitionInnerTests.java @@ -12,11 +12,9 @@ public final class ResourceProviderOperationDefinitionInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ResourceProviderOperationDefinitionInner model = - BinaryData - .fromString( - "{\"name\":\"fogknygjofjdde\",\"isDataAction\":false,\"display\":{\"provider\":\"upewnwreitjzy\",\"resource\":\"usarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"}}") - .toObject(ResourceProviderOperationDefinitionInner.class); + ResourceProviderOperationDefinitionInner model = BinaryData.fromString( + "{\"name\":\"fogknygjofjdde\",\"isDataAction\":false,\"display\":{\"provider\":\"upewnwreitjzy\",\"resource\":\"usarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"}}") + .toObject(ResourceProviderOperationDefinitionInner.class); Assertions.assertEquals("fogknygjofjdde", model.name()); Assertions.assertEquals(false, model.isDataAction()); Assertions.assertEquals("upewnwreitjzy", model.display().provider()); @@ -27,16 +25,13 @@ public void testDeserialize() throws Exception { @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ResourceProviderOperationDefinitionInner model = - new ResourceProviderOperationDefinitionInner() - .withName("fogknygjofjdde") + ResourceProviderOperationDefinitionInner model + = new ResourceProviderOperationDefinitionInner().withName("fogknygjofjdde") .withIsDataAction(false) - .withDisplay( - new ResourceProviderOperationDisplay() - .withProvider("upewnwreitjzy") - .withResource("usarhmofc") - .withOperation("smy") - .withDescription("kdtmlxhekuk")); + .withDisplay(new ResourceProviderOperationDisplay().withProvider("upewnwreitjzy") + .withResource("usarhmofc") + .withOperation("smy") + .withDescription("kdtmlxhekuk")); model = BinaryData.fromObject(model).toObject(ResourceProviderOperationDefinitionInner.class); Assertions.assertEquals("fogknygjofjdde", model.name()); Assertions.assertEquals(false, model.isDataAction()); diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ResourceProviderOperationDisplayTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ResourceProviderOperationDisplayTests.java index 9135fe382a7e..f40ae3b6f766 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ResourceProviderOperationDisplayTests.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ResourceProviderOperationDisplayTests.java @@ -11,11 +11,9 @@ public final class ResourceProviderOperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ResourceProviderOperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"txukcdmp\",\"resource\":\"cryuan\",\"operation\":\"uxzdxtay\",\"description\":\"hmwhfpmrqo\"}") - .toObject(ResourceProviderOperationDisplay.class); + ResourceProviderOperationDisplay model = BinaryData.fromString( + "{\"provider\":\"txukcdmp\",\"resource\":\"cryuan\",\"operation\":\"uxzdxtay\",\"description\":\"hmwhfpmrqo\"}") + .toObject(ResourceProviderOperationDisplay.class); Assertions.assertEquals("txukcdmp", model.provider()); Assertions.assertEquals("cryuan", model.resource()); Assertions.assertEquals("uxzdxtay", model.operation()); @@ -24,12 +22,10 @@ public void testDeserialize() throws Exception { @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ResourceProviderOperationDisplay model = - new ResourceProviderOperationDisplay() - .withProvider("txukcdmp") - .withResource("cryuan") - .withOperation("uxzdxtay") - .withDescription("hmwhfpmrqo"); + ResourceProviderOperationDisplay model = new ResourceProviderOperationDisplay().withProvider("txukcdmp") + .withResource("cryuan") + .withOperation("uxzdxtay") + .withDescription("hmwhfpmrqo"); model = BinaryData.fromObject(model).toObject(ResourceProviderOperationDisplay.class); Assertions.assertEquals("txukcdmp", model.provider()); Assertions.assertEquals("cryuan", model.resource()); diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ResourceProviderOperationListTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ResourceProviderOperationListTests.java index 2f839ad1e62d..75a34c2ba86e 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ResourceProviderOperationListTests.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ResourceProviderOperationListTests.java @@ -10,11 +10,9 @@ public final class ResourceProviderOperationListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ResourceProviderOperationList model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"}},{\"name\":\"ownoizhw\",\"isDataAction\":true,\"display\":{\"provider\":\"qsoqijgkd\",\"resource\":\"pazlobcufpdz\",\"operation\":\"btcqq\",\"description\":\"qglhq\"}},{\"name\":\"ufo\",\"isDataAction\":false,\"display\":{\"provider\":\"ifsqesaagdfmg\",\"resource\":\"lhjxr\",\"operation\":\"kwm\",\"description\":\"ktsizntocipaou\"}}],\"nextLink\":\"psqucmpoyf\"}") - .toObject(ResourceProviderOperationList.class); + ResourceProviderOperationList model = BinaryData.fromString( + "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"}},{\"name\":\"ownoizhw\",\"isDataAction\":true,\"display\":{\"provider\":\"qsoqijgkd\",\"resource\":\"pazlobcufpdz\",\"operation\":\"btcqq\",\"description\":\"qglhq\"}},{\"name\":\"ufo\",\"isDataAction\":false,\"display\":{\"provider\":\"ifsqesaagdfmg\",\"resource\":\"lhjxr\",\"operation\":\"kwm\",\"description\":\"ktsizntocipaou\"}}],\"nextLink\":\"psqucmpoyf\"}") + .toObject(ResourceProviderOperationList.class); } @org.junit.jupiter.api.Test diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ResourceProvidersCheckNameAvailabilityWithResponseMockTests.java b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ResourceProvidersCheckNameAvailabilityWithResponseMockTests.java index 327b741e6402..eedb54195361 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ResourceProvidersCheckNameAvailabilityWithResponseMockTests.java +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/src/test/java/com/azure/resourcemanager/confidentialledger/generated/ResourceProvidersCheckNameAvailabilityWithResponseMockTests.java @@ -6,70 +6,38 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.confidentialledger.ConfidentialLedgerManager; import com.azure.resourcemanager.confidentialledger.models.CheckNameAvailabilityReason; import com.azure.resourcemanager.confidentialledger.models.CheckNameAvailabilityRequest; import com.azure.resourcemanager.confidentialledger.models.CheckNameAvailabilityResponse; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ResourceProvidersCheckNameAvailabilityWithResponseMockTests { @Test public void testCheckNameAvailabilityWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + String responseStr = "{\"nameAvailable\":false,\"reason\":\"AlreadyExists\",\"message\":\"xdpnqbqq\"}"; - String responseStr = "{\"nameAvailable\":false,\"reason\":\"Invalid\",\"message\":\"big\"}"; + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ConfidentialLedgerManager manager = ConfidentialLedgerManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ConfidentialLedgerManager manager = - ConfidentialLedgerManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CheckNameAvailabilityResponse response = - manager - .resourceProviders() - .checkNameAvailabilityWithResponse( - new CheckNameAvailabilityRequest().withName("fgugnxkrxdqmid").withType("hzrvqd"), - com.azure.core.util.Context.NONE) - .getValue(); + CheckNameAvailabilityResponse response = manager.resourceProviders() + .checkNameAvailabilityWithResponse(new CheckNameAvailabilityRequest().withName("fionl").withType("x"), + com.azure.core.util.Context.NONE) + .getValue(); Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.INVALID, response.reason()); - Assertions.assertEquals("big", response.message()); + Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, response.reason()); + Assertions.assertEquals("xdpnqbqq", response.message()); } }