From 4b3dbc919c7d36f0f48212a4ca22a77edcd81ac7 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Thu, 19 Dec 2024 02:13:41 +0000 Subject: [PATCH] [Automation] Generate Fluent Lite from Swagger confluent#package-2024-02 --- eng/versioning/version_client.txt | 2 +- .../CHANGELOG.md | 15 +- .../azure-resourcemanager-confluent/README.md | 13 +- .../azure-resourcemanager-confluent/SAMPLE.md | 188 ++++++---- .../azure-resourcemanager-confluent/pom.xml | 3 +- .../confluent/ConfluentManager.java | 6 +- ...AccessListClusterSuccessResponseInner.java | 56 ++- ...sListEnvironmentsSuccessResponseInner.java | 57 ++- ...ssListInvitationsSuccessResponseInner.java | 58 ++- ...sListRoleBindingsSuccessResponseInner.java | 57 ++- ...stServiceAccountsSuccessResponseInner.java | 58 ++- .../AccessListUsersSuccessResponseInner.java | 56 ++- ...leBindingNameListSuccessResponseInner.java | 57 ++- .../fluent/models/ApiKeyProperties.java | 49 ++- .../fluent/models/ApiKeyRecordInner.java | 53 ++- .../fluent/models/ClusterProperties.java | 53 ++- .../models/ConfluentAgreementProperties.java | 79 +++- .../ConfluentAgreementResourceInner.java | 99 ++++- .../fluent/models/EnvironmentProperties.java | 45 ++- .../fluent/models/InvitationRecordInner.java | 73 +++- .../ListRegionsSuccessResponseInner.java | 47 ++- .../fluent/models/OperationResultInner.java | 53 ++- .../models/OrganizationResourceInner.java | 114 +++++- .../OrganizationResourceProperties.java | 86 ++++- .../fluent/models/RegionProperties.java | 49 ++- .../fluent/models/SCClusterRecordInner.java | 57 ++- .../models/SCEnvironmentRecordInner.java | 57 ++- .../SchemaRegistryClusterProperties.java | 55 ++- .../SchemaRegistryClusterRecordInner.java | 55 ++- .../models/ValidationResponseInner.java | 48 ++- .../ConfluentManagementClientImpl.java | 3 +- .../MarketplaceAgreementsClientImpl.java | 8 +- .../OrganizationOperationsClientImpl.java | 8 +- .../OrganizationsClientImpl.java | 40 +-- .../implementation/ResourceManagerUtils.java | 2 - .../AccessCreateRoleBindingRequestModel.java | 61 +++- .../models/AccessInviteUserAccountModel.java | 58 ++- .../models/AccessInvitedUserDetails.java | 49 ++- .../confluent/models/ApiKeyOwnerEntity.java | 57 ++- .../models/ApiKeyResourceEntity.java | 61 +++- .../confluent/models/ApiKeySpecEntity.java | 61 +++- .../confluent/models/ClusterByokEntity.java | 53 ++- .../confluent/models/ClusterConfigEntity.java | 45 ++- .../models/ClusterEnvironmentEntity.java | 57 ++- .../models/ClusterNetworkEntity.java | 57 ++- .../confluent/models/ClusterRecord.java | 65 +++- .../confluent/models/ClusterSpecEntity.java | 89 ++++- .../confluent/models/ClusterStatusEntity.java | 49 ++- ...onfluentAgreementResourceListResponse.java | 53 ++- .../models/ConfluentListMetadata.java | 61 +++- .../confluent/models/CreateApiKeyModel.java | 49 ++- .../confluent/models/EnvironmentRecord.java | 57 ++- .../models/GetEnvironmentsResponse.java | 51 ++- .../confluent/models/LinkOrganization.java | 50 ++- .../models/ListAccessRequestModel.java | 48 ++- .../models/ListClustersSuccessResponse.java | 51 ++- .../ListSchemaRegistryClustersResponse.java | 52 ++- .../confluent/models/MetadataEntity.java | 61 +++- .../confluent/models/OfferDetail.java | 110 ++++-- .../confluent/models/OperationDisplay.java | 57 ++- .../confluent/models/OperationListResult.java | 51 ++- .../models/OrganizationResource.java | 4 +- .../OrganizationResourceListResult.java | 52 ++- .../models/OrganizationResourceUpdate.java | 48 ++- .../confluent/models/ProvisionState.java | 2 - .../confluent/models/RegionRecord.java | 53 ++- .../confluent/models/RegionSpecEntity.java | 58 ++- .../confluent/models/RoleBindingRecord.java | 71 +++- .../confluent/models/SCClusterByokEntity.java | 53 ++- .../SCClusterNetworkEnvironmentEntity.java | 58 ++- .../confluent/models/SCClusterSpecEntity.java | 89 ++++- .../confluent/models/SCMetadataEntity.java | 61 +++- .../confluent/models/SaaSOfferStatus.java | 2 - ...egistryClusterEnvironmentRegionEntity.java | 55 ++- .../SchemaRegistryClusterSpecEntity.java | 68 +++- .../SchemaRegistryClusterStatusEntity.java | 46 ++- .../models/ServiceAccountRecord.java | 61 +++- .../confluent/models/UserDetail.java | 66 +++- .../confluent/models/UserRecord.java | 65 +++- .../src/main/java/module-info.java | 4 +- .../proxy-config.json | 2 +- .../reflect-config.json | 337 +----------------- .../AccessCreateRoleBindingSamples.java | 12 +- .../AccessDeleteRoleBindingSamples.java | 5 +- .../generated/AccessInviteUserSamples.java | 10 +- .../AccessListInvitationsSamples.java | 9 +- .../AccessListRoleBindingNameListSamples.java | 11 +- .../generated/AccessListUsersSamples.java | 6 +- .../OrganizationCreateApiKeySamples.java | 9 +- .../generated/OrganizationCreateSamples.java | 23 +- ...rganizationDeleteClusterApiKeySamples.java | 5 +- ...OrganizationGetByResourceGroupSamples.java | 4 +- .../OrganizationGetClusterApiKeySamples.java | 5 +- .../OrganizationGetClusterByIdSamples.java | 5 +- ...OrganizationGetEnvironmentByIdSamples.java | 5 +- ...onGetSchemaRegistryClusterByIdSamples.java | 5 +- .../OrganizationListClustersSamples.java | 4 +- .../OrganizationListEnvironmentsSamples.java | 4 +- .../OrganizationListRegionsSamples.java | 9 +- ...tionListSchemaRegistryClustersSamples.java | 5 +- ...alidationsValidateOrganizationSamples.java | 26 +- ...idationsValidateOrganizationV2Samples.java | 26 +- ...reateRoleBindingWithResponseMockTests.java | 25 +- ...eleteRoleBindingWithResponseMockTests.java | 25 +- ...AccessInviteUserWithResponseMockTests.java | 25 +- ...cessListClustersWithResponseMockTests.java | 25 +- ...ListEnvironmentsWithResponseMockTests.java | 25 +- ...sListInvitationsWithResponseMockTests.java | 25 +- ...eBindingNameListWithResponseMockTests.java | 25 +- ...ListRoleBindingsWithResponseMockTests.java | 25 +- ...tServiceAccountsWithResponseMockTests.java | 25 +- .../AccessListUsersWithResponseMockTests.java | 25 +- ...AgreementsCreateWithResponseMockTests.java | 25 +- .../MarketplaceAgreementsListMockTests.java | 25 +- .../OrganizationOperationsListMockTests.java | 25 +- ...eteClusterApiKeyWithResponseMockTests.java | 25 +- .../OrganizationsDeleteMockTests.java | 25 +- ...nsGetClusterByIdWithResponseMockTests.java | 25 +- ...tEnvironmentByIdWithResponseMockTests.java | 25 +- ...istryClusterByIdWithResponseMockTests.java | 25 +- .../OrganizationsListClustersMockTests.java | 25 +- ...rganizationsListEnvironmentsMockTests.java | 25 +- ...tionsListRegionsWithResponseMockTests.java | 25 +- ...nsListSchemaRegistryClustersMockTests.java | 25 +- 124 files changed, 3807 insertions(+), 1458 deletions(-) diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index b84be386aa81..b014ec846d92 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -304,7 +304,7 @@ com.azure.resourcemanager:azure-resourcemanager-kusto;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-loganalytics;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-eventgrid;1.1.0;1.2.0-beta.8 com.azure.resourcemanager:azure-resourcemanager-healthbot;1.0.0-beta.3;1.0.0-beta.4 -com.azure.resourcemanager:azure-resourcemanager-confluent;1.1.0;1.2.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-confluent;1.1.0;1.2.0 com.azure.resourcemanager:azure-resourcemanager-digitaltwins;1.3.0;1.4.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-netapp;1.5.1;1.6.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-storagecache;1.0.0-beta.12;1.0.0-beta.13 diff --git a/sdk/confluent/azure-resourcemanager-confluent/CHANGELOG.md b/sdk/confluent/azure-resourcemanager-confluent/CHANGELOG.md index 6c98baaddf57..cb8dde6da0d4 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/CHANGELOG.md +++ b/sdk/confluent/azure-resourcemanager-confluent/CHANGELOG.md @@ -1,14 +1,21 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 1.2.0 (2024-12-19) -### Features Added +- Azure Resource Manager Confluent client library for Java. This package contains Microsoft Azure SDK for Confluent Management SDK. Package tag package-2024-02. 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 +#### Serialization/Deserialization change + +- `Jackson` is removed from dependency and no longer supported. + +##### Migration Guide -### Other Changes +If you are using `Jackson`/`ObjectMapper` for manual serialization/deserialization, configure your `ObjectMapper` for backward compatibility: +```java +objectMapper.registerModule(com.azure.core.serializer.json.jackson.JacksonJsonProvider.getJsonSerializableDatabindModule()); +``` ## 1.1.0 (2024-03-21) diff --git a/sdk/confluent/azure-resourcemanager-confluent/README.md b/sdk/confluent/azure-resourcemanager-confluent/README.md index 3f402eccfcf1..12b4da188610 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/README.md +++ b/sdk/confluent/azure-resourcemanager-confluent/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-confluent - 1.1.0 + 1.2.0 ``` [//]: # ({x-version-update-end}) @@ -45,15 +45,11 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. - -With above configuration, `azure` client can be authenticated using the following code: +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -97,6 +93,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [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_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/confluent/azure-resourcemanager-confluent/SAMPLE.md b/sdk/confluent/azure-resourcemanager-confluent/SAMPLE.md index 8874bf6c0efb..f699596d5189 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/SAMPLE.md +++ b/sdk/confluent/azure-resourcemanager-confluent/SAMPLE.md @@ -66,11 +66,13 @@ public final class AccessCreateRoleBindingSamples { * @param manager Entry point to ConfluentManager. */ public static void accessCreateRoleBinding(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.access().createRoleBindingWithResponse("myResourceGroup", "myOrganization", - new AccessCreateRoleBindingRequestModel().withPrincipal("User:u-111aaa").withRoleName("CloudClusterAdmin") - .withCrnPattern( - "crn://confluent.cloud/organization=1111aaaa-11aa-11aa-11aa-111111aaaaaa/environment=env-aaa1111/cloud-cluster=lkc-1111aaa"), - com.azure.core.util.Context.NONE); + manager.access() + .createRoleBindingWithResponse("myResourceGroup", "myOrganization", + new AccessCreateRoleBindingRequestModel().withPrincipal("User:u-111aaa") + .withRoleName("CloudClusterAdmin") + .withCrnPattern( + "crn://confluent.cloud/organization=1111aaaa-11aa-11aa-11aa-111111aaaaaa/environment=env-aaa1111/cloud-cluster=lkc-1111aaa"), + com.azure.core.util.Context.NONE); } } ``` @@ -93,8 +95,9 @@ public final class AccessDeleteRoleBindingSamples { * @param manager Entry point to ConfluentManager. */ public static void accessDeleteRoleBinding(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.access().deleteRoleBindingWithResponse("myResourceGroup", "myOrganization", "dlz-f3a90de", - com.azure.core.util.Context.NONE); + manager.access() + .deleteRoleBindingWithResponse("myResourceGroup", "myOrganization", "dlz-f3a90de", + com.azure.core.util.Context.NONE); } } ``` @@ -119,10 +122,12 @@ public final class AccessInviteUserSamples { * @param manager Entry point to ConfluentManager. */ public static void accessInviteUser(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.access().inviteUserWithResponse("myResourceGroup", "myOrganization", - new AccessInviteUserAccountModel().withInvitedUserDetails( - new AccessInvitedUserDetails().withInvitedEmail("user2@onmicrosoft.com").withAuthType("AUTH_TYPE_SSO")), - com.azure.core.util.Context.NONE); + manager.access() + .inviteUserWithResponse("myResourceGroup", "myOrganization", + new AccessInviteUserAccountModel() + .withInvitedUserDetails(new AccessInvitedUserDetails().withInvitedEmail("user2@onmicrosoft.com") + .withAuthType("AUTH_TYPE_SSO")), + com.azure.core.util.Context.NONE); } } ``` @@ -232,10 +237,11 @@ public final class AccessListInvitationsSamples { * @param manager Entry point to ConfluentManager. */ public static void accessInvitationsList(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.access().listInvitationsWithResponse("myResourceGroup", "myOrganization", - new ListAccessRequestModel().withSearchFilters( - mapOf("pageSize", "10", "pageToken", "fakeTokenPlaceholder", "status", "INVITE_STATUS_SENT")), - com.azure.core.util.Context.NONE); + manager.access() + .listInvitationsWithResponse("myResourceGroup", "myOrganization", + new ListAccessRequestModel().withSearchFilters( + mapOf("pageSize", "10", "pageToken", "fakeTokenPlaceholder", "status", "INVITE_STATUS_SENT")), + com.azure.core.util.Context.NONE); } // Use "Map.of" if available @@ -273,11 +279,12 @@ public final class AccessListRoleBindingNameListSamples { * @param manager Entry point to ConfluentManager. */ public static void accessRoleBindingNameList(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.access().listRoleBindingNameListWithResponse("myResourceGroup", "myOrganization", - new ListAccessRequestModel().withSearchFilters(mapOf("crn_pattern", - "crn://confluent.cloud/organization=1aa7de07-298e-479c-8f2f-16ac91fd8e76", "namespace", - "public,dataplane,networking,identity,datagovernance,connect,streamcatalog,pipelines,ksql")), - com.azure.core.util.Context.NONE); + manager.access() + .listRoleBindingNameListWithResponse("myResourceGroup", "myOrganization", + new ListAccessRequestModel().withSearchFilters(mapOf("crn_pattern", + "crn://confluent.cloud/organization=1aa7de07-298e-479c-8f2f-16ac91fd8e76", "namespace", + "public,dataplane,networking,identity,datagovernance,connect,streamcatalog,pipelines,ksql")), + com.azure.core.util.Context.NONE); } // Use "Map.of" if available @@ -398,9 +405,9 @@ public final class AccessListUsersSamples { * @param manager Entry point to ConfluentManager. */ public static void accessUsersList(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.access().listUsersWithResponse("myResourceGroup", "myOrganization", new ListAccessRequestModel() - .withSearchFilters(mapOf("pageSize", "10", "pageToken", "fakeTokenPlaceholder")), - com.azure.core.util.Context.NONE); + manager.access() + .listUsersWithResponse("myResourceGroup", "myOrganization", new ListAccessRequestModel().withSearchFilters( + mapOf("pageSize", "10", "pageToken", "fakeTokenPlaceholder")), com.azure.core.util.Context.NONE); } // Use "Map.of" if available @@ -486,16 +493,25 @@ public final class OrganizationCreateSamples { * @param manager Entry point to ConfluentManager. */ public static void organizationCreate(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().define("myOrganization").withRegion("West US") + manager.organizations() + .define("myOrganization") + .withRegion("West US") .withExistingResourceGroup("myResourceGroup") - .withOfferDetail( - new OfferDetail().withPublisherId("string").withId("string").withPlanId("string").withPlanName("string") - .withTermUnit("string").withPrivateOfferId("string").withPrivateOfferIds(Arrays.asList("string"))) - .withUserDetail(new UserDetail().withFirstName("string").withLastName("string") - .withEmailAddress("contoso@microsoft.com").withUserPrincipalName("contoso@microsoft.com") + .withOfferDetail(new OfferDetail().withPublisherId("string") + .withId("string") + .withPlanId("string") + .withPlanName("string") + .withTermUnit("string") + .withPrivateOfferId("string") + .withPrivateOfferIds(Arrays.asList("string"))) + .withUserDetail(new UserDetail().withFirstName("string") + .withLastName("string") + .withEmailAddress("contoso@microsoft.com") + .withUserPrincipalName("contoso@microsoft.com") .withAadEmail("contoso@microsoft.com")) .withTags(mapOf("Environment", "Dev")) - .withLinkOrganization(new LinkOrganization().withToken("fakeTokenPlaceholder")).create(); + .withLinkOrganization(new LinkOrganization().withToken("fakeTokenPlaceholder")) + .create(); } // Use "Map.of" if available @@ -531,10 +547,11 @@ public final class OrganizationCreateApiKeySamples { * @param manager Entry point to ConfluentManager. */ public static void organizationCreateAPIKey(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().createApiKeyWithResponse( - "myResourceGroup", "myOrganization", "env-12132", "clusterId-123", new CreateApiKeyModel() - .withName("CI kafka access key").withDescription("This API key provides kafka access to cluster x"), - com.azure.core.util.Context.NONE); + manager.organizations() + .createApiKeyWithResponse("myResourceGroup", "myOrganization", "env-12132", "clusterId-123", + new CreateApiKeyModel().withName("CI kafka access key") + .withDescription("This API key provides kafka access to cluster x"), + com.azure.core.util.Context.NONE); } } ``` @@ -578,8 +595,9 @@ public final class OrganizationDeleteClusterApiKeySamples { * @param manager Entry point to ConfluentManager. */ public static void organizationDeleteClusterAPIKey(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().deleteClusterApiKeyWithResponse("myResourceGroup", "myOrganization", "ZFZ6SZZZWGYBEIFB", - com.azure.core.util.Context.NONE); + manager.organizations() + .deleteClusterApiKeyWithResponse("myResourceGroup", "myOrganization", "ZFZ6SZZZWGYBEIFB", + com.azure.core.util.Context.NONE); } } ``` @@ -601,8 +619,8 @@ public final class OrganizationGetByResourceGroupSamples { * @param manager Entry point to ConfluentManager. */ public static void organizationGet(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().getByResourceGroupWithResponse("myResourceGroup", "myOrganization", - com.azure.core.util.Context.NONE); + manager.organizations() + .getByResourceGroupWithResponse("myResourceGroup", "myOrganization", com.azure.core.util.Context.NONE); } } ``` @@ -624,8 +642,9 @@ public final class OrganizationGetClusterApiKeySamples { * @param manager Entry point to ConfluentManager. */ public static void organizationGetClusterAPIKey(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().getClusterApiKeyWithResponse("myResourceGroup", "myOrganization", "apiKeyId-123", - com.azure.core.util.Context.NONE); + manager.organizations() + .getClusterApiKeyWithResponse("myResourceGroup", "myOrganization", "apiKeyId-123", + com.azure.core.util.Context.NONE); } } ``` @@ -647,8 +666,9 @@ public final class OrganizationGetClusterByIdSamples { * @param manager Entry point to ConfluentManager. */ public static void organizationGetClusterById(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().getClusterByIdWithResponse("myResourceGroup", "myOrganization", "env-12132", - "dlz-f3a90de", com.azure.core.util.Context.NONE); + manager.organizations() + .getClusterByIdWithResponse("myResourceGroup", "myOrganization", "env-12132", "dlz-f3a90de", + com.azure.core.util.Context.NONE); } } ``` @@ -670,8 +690,9 @@ public final class OrganizationGetEnvironmentByIdSamples { * @param manager Entry point to ConfluentManager. */ public static void organizationGetEnvironmentById(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().getEnvironmentByIdWithResponse("myResourceGroup", "myOrganization", "dlz-f3a90de", - com.azure.core.util.Context.NONE); + manager.organizations() + .getEnvironmentByIdWithResponse("myResourceGroup", "myOrganization", "dlz-f3a90de", + com.azure.core.util.Context.NONE); } } ``` @@ -694,8 +715,9 @@ public final class OrganizationGetSchemaRegistryClusterByIdSamples { */ public static void organizationGetSchemaRegistryClusterById(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().getSchemaRegistryClusterByIdWithResponse("myResourceGroup", "myOrganization", - "env-stgcczjp2j3", "lsrc-stgczkq22z", com.azure.core.util.Context.NONE); + manager.organizations() + .getSchemaRegistryClusterByIdWithResponse("myResourceGroup", "myOrganization", "env-stgcczjp2j3", + "lsrc-stgczkq22z", com.azure.core.util.Context.NONE); } } ``` @@ -762,8 +784,8 @@ public final class OrganizationListClustersSamples { * @param manager Entry point to ConfluentManager. */ public static void organizationListClusters(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().listClusters("myResourceGroup", "myOrganization", "env-12132", 10, null, - com.azure.core.util.Context.NONE); + manager.organizations() + .listClusters("myResourceGroup", "myOrganization", "env-12132", 10, null, com.azure.core.util.Context.NONE); } } ``` @@ -785,8 +807,8 @@ public final class OrganizationListEnvironmentsSamples { * @param manager Entry point to ConfluentManager. */ public static void organizationListEnvironments(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().listEnvironments("myResourceGroup", "myOrganization", 10, null, - com.azure.core.util.Context.NONE); + manager.organizations() + .listEnvironments("myResourceGroup", "myOrganization", 10, null, com.azure.core.util.Context.NONE); } } ``` @@ -813,10 +835,11 @@ public final class OrganizationListRegionsSamples { * @param manager Entry point to ConfluentManager. */ public static void organizationListRegions(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().listRegionsWithResponse("myResourceGroup", "myOrganization", - new ListAccessRequestModel() - .withSearchFilters(mapOf("cloud", "azure", "packages", "ADVANCED,ESSENTIALS", "region", "eastus")), - com.azure.core.util.Context.NONE); + manager.organizations() + .listRegionsWithResponse("myResourceGroup", "myOrganization", + new ListAccessRequestModel() + .withSearchFilters(mapOf("cloud", "azure", "packages", "ADVANCED,ESSENTIALS", "region", "eastus")), + com.azure.core.util.Context.NONE); } // Use "Map.of" if available @@ -851,8 +874,9 @@ public final class OrganizationListSchemaRegistryClustersSamples { */ public static void organizationListSchemaRegistryClusters(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().listSchemaRegistryClusters("myResourceGroup", "myOrganization", "env-stgcczjp2j3", null, - null, com.azure.core.util.Context.NONE); + manager.organizations() + .listSchemaRegistryClusters("myResourceGroup", "myOrganization", "env-stgcczjp2j3", null, null, + com.azure.core.util.Context.NONE); } } ``` @@ -944,15 +968,23 @@ public final class ValidationsValidateOrganizationSamples { * @param manager Entry point to ConfluentManager. */ public static void validationsValidateOrganizations(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.validations().validateOrganizationWithResponse("myResourceGroup", "myOrganization", - new OrganizationResourceInner().withLocation("West US").withTags(mapOf("Environment", "Dev")) - .withOfferDetail(new OfferDetail().withPublisherId("string").withId("string").withPlanId("string") - .withPlanName("string").withTermUnit("string").withPrivateOfferId("string") - .withPrivateOfferIds(Arrays.asList("string"))) - .withUserDetail(new UserDetail().withFirstName("string").withLastName("string") - .withEmailAddress("abc@microsoft.com").withUserPrincipalName("abc@microsoft.com") - .withAadEmail("abc@microsoft.com")), - com.azure.core.util.Context.NONE); + manager.validations() + .validateOrganizationWithResponse("myResourceGroup", "myOrganization", + new OrganizationResourceInner().withLocation("West US") + .withTags(mapOf("Environment", "Dev")) + .withOfferDetail(new OfferDetail().withPublisherId("string") + .withId("string") + .withPlanId("string") + .withPlanName("string") + .withTermUnit("string") + .withPrivateOfferId("string") + .withPrivateOfferIds(Arrays.asList("string"))) + .withUserDetail(new UserDetail().withFirstName("string") + .withLastName("string") + .withEmailAddress("abc@microsoft.com") + .withUserPrincipalName("abc@microsoft.com") + .withAadEmail("abc@microsoft.com")), + com.azure.core.util.Context.NONE); } // Use "Map.of" if available @@ -993,15 +1025,23 @@ public final class ValidationsValidateOrganizationV2Samples { * @param manager Entry point to ConfluentManager. */ public static void validationsValidateOrganizations(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.validations().validateOrganizationV2WithResponse("myResourceGroup", "myOrganization", - new OrganizationResourceInner().withLocation("West US").withTags(mapOf("Environment", "Dev")) - .withOfferDetail(new OfferDetail().withPublisherId("string").withId("string").withPlanId("string") - .withPlanName("string").withTermUnit("string").withPrivateOfferId("string") - .withPrivateOfferIds(Arrays.asList("string"))) - .withUserDetail(new UserDetail().withFirstName("string").withLastName("string") - .withEmailAddress("abc@microsoft.com").withUserPrincipalName("abc@microsoft.com") - .withAadEmail("abc@microsoft.com")), - com.azure.core.util.Context.NONE); + manager.validations() + .validateOrganizationV2WithResponse("myResourceGroup", "myOrganization", + new OrganizationResourceInner().withLocation("West US") + .withTags(mapOf("Environment", "Dev")) + .withOfferDetail(new OfferDetail().withPublisherId("string") + .withId("string") + .withPlanId("string") + .withPlanName("string") + .withTermUnit("string") + .withPrivateOfferId("string") + .withPrivateOfferIds(Arrays.asList("string"))) + .withUserDetail(new UserDetail().withFirstName("string") + .withLastName("string") + .withEmailAddress("abc@microsoft.com") + .withUserPrincipalName("abc@microsoft.com") + .withAadEmail("abc@microsoft.com")), + com.azure.core.util.Context.NONE); } // Use "Map.of" if available diff --git a/sdk/confluent/azure-resourcemanager-confluent/pom.xml b/sdk/confluent/azure-resourcemanager-confluent/pom.xml index 593d96d13af5..0ec1d9d2af9e 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/pom.xml +++ b/sdk/confluent/azure-resourcemanager-confluent/pom.xml @@ -14,7 +14,7 @@ com.azure.resourcemanager azure-resourcemanager-confluent - 1.2.0-beta.1 + 1.2.0 jar Microsoft Azure SDK for Confluent Management @@ -45,6 +45,7 @@ UTF-8 0 0 + false diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/ConfluentManager.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/ConfluentManager.java index d6251ef05c00..49f70d3bf923 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/ConfluentManager.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/ConfluentManager.java @@ -11,6 +11,7 @@ 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.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -19,7 +20,6 @@ import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -220,7 +220,7 @@ public ConfluentManager authenticate(TokenCredential credential, AzureProfile pr .append("-") .append("com.azure.resourcemanager.confluent") .append("/") - .append("1.1.0"); + .append("1.2.0"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -253,7 +253,7 @@ public ConfluentManager authenticate(TokenCredential credential, AzureProfile pr HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); - policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies.addAll(this.policies.stream() .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) .collect(Collectors.toList())); diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListClusterSuccessResponseInner.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListClusterSuccessResponseInner.java index e1710c526fff..eb52a4edca12 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListClusterSuccessResponseInner.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListClusterSuccessResponseInner.java @@ -5,32 +5,34 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.models.ClusterRecord; import com.azure.resourcemanager.confluent.models.ConfluentListMetadata; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Details of the clusters returned on successful response. */ @Fluent -public final class AccessListClusterSuccessResponseInner { +public final class AccessListClusterSuccessResponseInner + implements JsonSerializable { /* * Type of response */ - @JsonProperty(value = "kind") private String kind; /* * Metadata of the list */ - @JsonProperty(value = "metadata") private ConfluentListMetadata metadata; /* * List of clusters */ - @JsonProperty(value = "data") private List data; /** @@ -112,4 +114,48 @@ public void validate() { data().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeJsonField("metadata", this.metadata); + jsonWriter.writeArrayField("data", this.data, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessListClusterSuccessResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessListClusterSuccessResponseInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessListClusterSuccessResponseInner. + */ + public static AccessListClusterSuccessResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessListClusterSuccessResponseInner deserializedAccessListClusterSuccessResponseInner + = new AccessListClusterSuccessResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedAccessListClusterSuccessResponseInner.kind = reader.getString(); + } else if ("metadata".equals(fieldName)) { + deserializedAccessListClusterSuccessResponseInner.metadata = ConfluentListMetadata.fromJson(reader); + } else if ("data".equals(fieldName)) { + List data = reader.readArray(reader1 -> ClusterRecord.fromJson(reader1)); + deserializedAccessListClusterSuccessResponseInner.data = data; + } else { + reader.skipChildren(); + } + } + + return deserializedAccessListClusterSuccessResponseInner; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListEnvironmentsSuccessResponseInner.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListEnvironmentsSuccessResponseInner.java index 1770543beb35..eca88301790c 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListEnvironmentsSuccessResponseInner.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListEnvironmentsSuccessResponseInner.java @@ -5,32 +5,34 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.models.ConfluentListMetadata; import com.azure.resourcemanager.confluent.models.EnvironmentRecord; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Details of the environments returned on successful response. */ @Fluent -public final class AccessListEnvironmentsSuccessResponseInner { +public final class AccessListEnvironmentsSuccessResponseInner + implements JsonSerializable { /* * Type of response */ - @JsonProperty(value = "kind") private String kind; /* * Metadata of the environment list */ - @JsonProperty(value = "metadata") private ConfluentListMetadata metadata; /* * Environment list data */ - @JsonProperty(value = "data") private List data; /** @@ -112,4 +114,49 @@ public void validate() { data().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeJsonField("metadata", this.metadata); + jsonWriter.writeArrayField("data", this.data, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessListEnvironmentsSuccessResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessListEnvironmentsSuccessResponseInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessListEnvironmentsSuccessResponseInner. + */ + public static AccessListEnvironmentsSuccessResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessListEnvironmentsSuccessResponseInner deserializedAccessListEnvironmentsSuccessResponseInner + = new AccessListEnvironmentsSuccessResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedAccessListEnvironmentsSuccessResponseInner.kind = reader.getString(); + } else if ("metadata".equals(fieldName)) { + deserializedAccessListEnvironmentsSuccessResponseInner.metadata + = ConfluentListMetadata.fromJson(reader); + } else if ("data".equals(fieldName)) { + List data = reader.readArray(reader1 -> EnvironmentRecord.fromJson(reader1)); + deserializedAccessListEnvironmentsSuccessResponseInner.data = data; + } else { + reader.skipChildren(); + } + } + + return deserializedAccessListEnvironmentsSuccessResponseInner; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListInvitationsSuccessResponseInner.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListInvitationsSuccessResponseInner.java index f2c1fc5391aa..cdf317715576 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListInvitationsSuccessResponseInner.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListInvitationsSuccessResponseInner.java @@ -5,31 +5,33 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.models.ConfluentListMetadata; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * List invitations success response. */ @Fluent -public final class AccessListInvitationsSuccessResponseInner { +public final class AccessListInvitationsSuccessResponseInner + implements JsonSerializable { /* * Type of response */ - @JsonProperty(value = "kind") private String kind; /* * Metadata of the list */ - @JsonProperty(value = "metadata") private ConfluentListMetadata metadata; /* * Data of the invitations list */ - @JsonProperty(value = "data") private List data; /** @@ -111,4 +113,50 @@ public void validate() { data().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeJsonField("metadata", this.metadata); + jsonWriter.writeArrayField("data", this.data, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessListInvitationsSuccessResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessListInvitationsSuccessResponseInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessListInvitationsSuccessResponseInner. + */ + public static AccessListInvitationsSuccessResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessListInvitationsSuccessResponseInner deserializedAccessListInvitationsSuccessResponseInner + = new AccessListInvitationsSuccessResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedAccessListInvitationsSuccessResponseInner.kind = reader.getString(); + } else if ("metadata".equals(fieldName)) { + deserializedAccessListInvitationsSuccessResponseInner.metadata + = ConfluentListMetadata.fromJson(reader); + } else if ("data".equals(fieldName)) { + List data + = reader.readArray(reader1 -> InvitationRecordInner.fromJson(reader1)); + deserializedAccessListInvitationsSuccessResponseInner.data = data; + } else { + reader.skipChildren(); + } + } + + return deserializedAccessListInvitationsSuccessResponseInner; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListRoleBindingsSuccessResponseInner.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListRoleBindingsSuccessResponseInner.java index 09552c145877..7adced8425bd 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListRoleBindingsSuccessResponseInner.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListRoleBindingsSuccessResponseInner.java @@ -5,32 +5,34 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.models.ConfluentListMetadata; import com.azure.resourcemanager.confluent.models.RoleBindingRecord; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Details of the role bindings returned on successful response. */ @Fluent -public final class AccessListRoleBindingsSuccessResponseInner { +public final class AccessListRoleBindingsSuccessResponseInner + implements JsonSerializable { /* * Type of response */ - @JsonProperty(value = "kind") private String kind; /* * Metadata of the list */ - @JsonProperty(value = "metadata") private ConfluentListMetadata metadata; /* * List of role binding */ - @JsonProperty(value = "data") private List data; /** @@ -112,4 +114,49 @@ public void validate() { data().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeJsonField("metadata", this.metadata); + jsonWriter.writeArrayField("data", this.data, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessListRoleBindingsSuccessResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessListRoleBindingsSuccessResponseInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessListRoleBindingsSuccessResponseInner. + */ + public static AccessListRoleBindingsSuccessResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessListRoleBindingsSuccessResponseInner deserializedAccessListRoleBindingsSuccessResponseInner + = new AccessListRoleBindingsSuccessResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedAccessListRoleBindingsSuccessResponseInner.kind = reader.getString(); + } else if ("metadata".equals(fieldName)) { + deserializedAccessListRoleBindingsSuccessResponseInner.metadata + = ConfluentListMetadata.fromJson(reader); + } else if ("data".equals(fieldName)) { + List data = reader.readArray(reader1 -> RoleBindingRecord.fromJson(reader1)); + deserializedAccessListRoleBindingsSuccessResponseInner.data = data; + } else { + reader.skipChildren(); + } + } + + return deserializedAccessListRoleBindingsSuccessResponseInner; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListServiceAccountsSuccessResponseInner.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListServiceAccountsSuccessResponseInner.java index 9488843b42c9..8d7e59eb68c6 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListServiceAccountsSuccessResponseInner.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListServiceAccountsSuccessResponseInner.java @@ -5,32 +5,34 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.models.ConfluentListMetadata; import com.azure.resourcemanager.confluent.models.ServiceAccountRecord; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * List service accounts success response. */ @Fluent -public final class AccessListServiceAccountsSuccessResponseInner { +public final class AccessListServiceAccountsSuccessResponseInner + implements JsonSerializable { /* * Type of response */ - @JsonProperty(value = "kind") private String kind; /* * Metadata of the list */ - @JsonProperty(value = "metadata") private ConfluentListMetadata metadata; /* * Data of the service accounts list */ - @JsonProperty(value = "data") private List data; /** @@ -112,4 +114,50 @@ public void validate() { data().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeJsonField("metadata", this.metadata); + jsonWriter.writeArrayField("data", this.data, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessListServiceAccountsSuccessResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessListServiceAccountsSuccessResponseInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessListServiceAccountsSuccessResponseInner. + */ + public static AccessListServiceAccountsSuccessResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessListServiceAccountsSuccessResponseInner deserializedAccessListServiceAccountsSuccessResponseInner + = new AccessListServiceAccountsSuccessResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedAccessListServiceAccountsSuccessResponseInner.kind = reader.getString(); + } else if ("metadata".equals(fieldName)) { + deserializedAccessListServiceAccountsSuccessResponseInner.metadata + = ConfluentListMetadata.fromJson(reader); + } else if ("data".equals(fieldName)) { + List data + = reader.readArray(reader1 -> ServiceAccountRecord.fromJson(reader1)); + deserializedAccessListServiceAccountsSuccessResponseInner.data = data; + } else { + reader.skipChildren(); + } + } + + return deserializedAccessListServiceAccountsSuccessResponseInner; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListUsersSuccessResponseInner.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListUsersSuccessResponseInner.java index e70baf4ff3d8..5970011956bb 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListUsersSuccessResponseInner.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessListUsersSuccessResponseInner.java @@ -5,32 +5,34 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.models.ConfluentListMetadata; import com.azure.resourcemanager.confluent.models.UserRecord; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * List users success response. */ @Fluent -public final class AccessListUsersSuccessResponseInner { +public final class AccessListUsersSuccessResponseInner + implements JsonSerializable { /* * Type of response */ - @JsonProperty(value = "kind") private String kind; /* * Metadata of the list */ - @JsonProperty(value = "metadata") private ConfluentListMetadata metadata; /* * Data of the users list */ - @JsonProperty(value = "data") private List data; /** @@ -112,4 +114,48 @@ public void validate() { data().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeJsonField("metadata", this.metadata); + jsonWriter.writeArrayField("data", this.data, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessListUsersSuccessResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessListUsersSuccessResponseInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessListUsersSuccessResponseInner. + */ + public static AccessListUsersSuccessResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessListUsersSuccessResponseInner deserializedAccessListUsersSuccessResponseInner + = new AccessListUsersSuccessResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedAccessListUsersSuccessResponseInner.kind = reader.getString(); + } else if ("metadata".equals(fieldName)) { + deserializedAccessListUsersSuccessResponseInner.metadata = ConfluentListMetadata.fromJson(reader); + } else if ("data".equals(fieldName)) { + List data = reader.readArray(reader1 -> UserRecord.fromJson(reader1)); + deserializedAccessListUsersSuccessResponseInner.data = data; + } else { + reader.skipChildren(); + } + } + + return deserializedAccessListUsersSuccessResponseInner; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessRoleBindingNameListSuccessResponseInner.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessRoleBindingNameListSuccessResponseInner.java index 2df5ff42b04d..50313f50117a 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessRoleBindingNameListSuccessResponseInner.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/AccessRoleBindingNameListSuccessResponseInner.java @@ -5,31 +5,33 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.models.ConfluentListMetadata; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Details of the role binding names returned on successful response. */ @Fluent -public final class AccessRoleBindingNameListSuccessResponseInner { +public final class AccessRoleBindingNameListSuccessResponseInner + implements JsonSerializable { /* * Type of response */ - @JsonProperty(value = "kind") private String kind; /* * Metadata of the list */ - @JsonProperty(value = "metadata") private ConfluentListMetadata metadata; /* * List of role binding names */ - @JsonProperty(value = "data") private List data; /** @@ -108,4 +110,49 @@ public void validate() { metadata().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeJsonField("metadata", this.metadata); + jsonWriter.writeArrayField("data", this.data, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessRoleBindingNameListSuccessResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessRoleBindingNameListSuccessResponseInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessRoleBindingNameListSuccessResponseInner. + */ + public static AccessRoleBindingNameListSuccessResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessRoleBindingNameListSuccessResponseInner deserializedAccessRoleBindingNameListSuccessResponseInner + = new AccessRoleBindingNameListSuccessResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedAccessRoleBindingNameListSuccessResponseInner.kind = reader.getString(); + } else if ("metadata".equals(fieldName)) { + deserializedAccessRoleBindingNameListSuccessResponseInner.metadata + = ConfluentListMetadata.fromJson(reader); + } else if ("data".equals(fieldName)) { + List data = reader.readArray(reader1 -> reader1.getString()); + deserializedAccessRoleBindingNameListSuccessResponseInner.data = data; + } else { + reader.skipChildren(); + } + } + + return deserializedAccessRoleBindingNameListSuccessResponseInner; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ApiKeyProperties.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ApiKeyProperties.java index de26f7cf7a09..15bc72a29918 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ApiKeyProperties.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ApiKeyProperties.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.models.ApiKeySpecEntity; import com.azure.resourcemanager.confluent.models.SCMetadataEntity; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * API Key Properties. */ @Fluent -public final class ApiKeyProperties { +public final class ApiKeyProperties implements JsonSerializable { /* * Metadata of the record */ - @JsonProperty(value = "metadata") private SCMetadataEntity metadata; /* * Specification of the API Key */ - @JsonProperty(value = "spec") private ApiKeySpecEntity spec; /** @@ -85,4 +87,43 @@ public void validate() { spec().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("metadata", this.metadata); + jsonWriter.writeJsonField("spec", this.spec); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiKeyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiKeyProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ApiKeyProperties. + */ + public static ApiKeyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiKeyProperties deserializedApiKeyProperties = new ApiKeyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metadata".equals(fieldName)) { + deserializedApiKeyProperties.metadata = SCMetadataEntity.fromJson(reader); + } else if ("spec".equals(fieldName)) { + deserializedApiKeyProperties.spec = ApiKeySpecEntity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApiKeyProperties; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ApiKeyRecordInner.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ApiKeyRecordInner.java index 60be809eb525..09e65525162e 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ApiKeyRecordInner.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ApiKeyRecordInner.java @@ -5,31 +5,32 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.models.ApiKeySpecEntity; import com.azure.resourcemanager.confluent.models.SCMetadataEntity; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Details API key. */ @Fluent -public final class ApiKeyRecordInner { +public final class ApiKeyRecordInner implements JsonSerializable { /* * Type of api key */ - @JsonProperty(value = "kind") private String kind; /* * Id of the api key */ - @JsonProperty(value = "id") private String id; /* * API Key Properties */ - @JsonProperty(value = "properties") private ApiKeyProperties innerProperties; /** @@ -143,4 +144,46 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiKeyRecordInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiKeyRecordInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ApiKeyRecordInner. + */ + public static ApiKeyRecordInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiKeyRecordInner deserializedApiKeyRecordInner = new ApiKeyRecordInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedApiKeyRecordInner.kind = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedApiKeyRecordInner.id = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedApiKeyRecordInner.innerProperties = ApiKeyProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApiKeyRecordInner; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ClusterProperties.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ClusterProperties.java index 0e00dcebe513..1a24be556c4e 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ClusterProperties.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ClusterProperties.java @@ -5,32 +5,33 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.models.ClusterStatusEntity; import com.azure.resourcemanager.confluent.models.SCClusterSpecEntity; import com.azure.resourcemanager.confluent.models.SCMetadataEntity; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Cluster Properties. */ @Fluent -public final class ClusterProperties { +public final class ClusterProperties implements JsonSerializable { /* * Metadata of the record */ - @JsonProperty(value = "metadata") private SCMetadataEntity metadata; /* * Specification of the cluster */ - @JsonProperty(value = "spec") private SCClusterSpecEntity spec; /* * Specification of the cluster status */ - @JsonProperty(value = "status") private ClusterStatusEntity status; /** @@ -115,4 +116,46 @@ public void validate() { status().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("metadata", this.metadata); + jsonWriter.writeJsonField("spec", this.spec); + jsonWriter.writeJsonField("status", this.status); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterProperties. + */ + public static ClusterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterProperties deserializedClusterProperties = new ClusterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metadata".equals(fieldName)) { + deserializedClusterProperties.metadata = SCMetadataEntity.fromJson(reader); + } else if ("spec".equals(fieldName)) { + deserializedClusterProperties.spec = SCClusterSpecEntity.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedClusterProperties.status = ClusterStatusEntity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterProperties; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ConfluentAgreementProperties.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ConfluentAgreementProperties.java index df9b4d25592d..fc6ebda004ea 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ConfluentAgreementProperties.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ConfluentAgreementProperties.java @@ -5,60 +5,58 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * Terms properties for Marketplace and Confluent. */ @Fluent -public final class ConfluentAgreementProperties { +public final class ConfluentAgreementProperties implements JsonSerializable { /* * Publisher identifier string. */ - @JsonProperty(value = "publisher") private String publisher; /* * Product identifier string. */ - @JsonProperty(value = "product") private String product; /* * Plan identifier string. */ - @JsonProperty(value = "plan") private String plan; /* * Link to HTML with Microsoft and Publisher terms. */ - @JsonProperty(value = "licenseTextLink") private String licenseTextLink; /* * Link to the privacy policy of the publisher. */ - @JsonProperty(value = "privacyPolicyLink") private String privacyPolicyLink; /* * Date and time in UTC of when the terms were accepted. This is empty if Accepted is false. */ - @JsonProperty(value = "retrieveDatetime") private OffsetDateTime retrieveDatetime; /* * Terms signature. */ - @JsonProperty(value = "signature") private String signature; /* * If any version of the terms have been accepted, otherwise false. */ - @JsonProperty(value = "accepted") private Boolean accepted; /** @@ -236,4 +234,65 @@ public ConfluentAgreementProperties withAccepted(Boolean accepted) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("publisher", this.publisher); + jsonWriter.writeStringField("product", this.product); + jsonWriter.writeStringField("plan", this.plan); + jsonWriter.writeStringField("licenseTextLink", this.licenseTextLink); + jsonWriter.writeStringField("privacyPolicyLink", this.privacyPolicyLink); + jsonWriter.writeStringField("retrieveDatetime", + this.retrieveDatetime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.retrieveDatetime)); + jsonWriter.writeStringField("signature", this.signature); + jsonWriter.writeBooleanField("accepted", this.accepted); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfluentAgreementProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfluentAgreementProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConfluentAgreementProperties. + */ + public static ConfluentAgreementProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfluentAgreementProperties deserializedConfluentAgreementProperties = new ConfluentAgreementProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publisher".equals(fieldName)) { + deserializedConfluentAgreementProperties.publisher = reader.getString(); + } else if ("product".equals(fieldName)) { + deserializedConfluentAgreementProperties.product = reader.getString(); + } else if ("plan".equals(fieldName)) { + deserializedConfluentAgreementProperties.plan = reader.getString(); + } else if ("licenseTextLink".equals(fieldName)) { + deserializedConfluentAgreementProperties.licenseTextLink = reader.getString(); + } else if ("privacyPolicyLink".equals(fieldName)) { + deserializedConfluentAgreementProperties.privacyPolicyLink = reader.getString(); + } else if ("retrieveDatetime".equals(fieldName)) { + deserializedConfluentAgreementProperties.retrieveDatetime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("signature".equals(fieldName)) { + deserializedConfluentAgreementProperties.signature = reader.getString(); + } else if ("accepted".equals(fieldName)) { + deserializedConfluentAgreementProperties.accepted = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedConfluentAgreementProperties; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ConfluentAgreementResourceInner.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ConfluentAgreementResourceInner.java index 8595ace04d28..86846fcaee3f 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ConfluentAgreementResourceInner.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ConfluentAgreementResourceInner.java @@ -7,7 +7,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; /** @@ -18,15 +21,28 @@ public final class ConfluentAgreementResourceInner extends ProxyResource { /* * Metadata pertaining to creation and last modification of the resource */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; /* * Represents the properties of the resource. */ - @JsonProperty(value = "properties") private ConfluentAgreementProperties innerProperties; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of ConfluentAgreementResourceInner class. */ @@ -51,6 +67,36 @@ private ConfluentAgreementProperties innerProperties() { return this.innerProperties; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the publisher property: Publisher identifier string. * @@ -247,4 +293,51 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfluentAgreementResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfluentAgreementResourceInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConfluentAgreementResourceInner. + */ + public static ConfluentAgreementResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfluentAgreementResourceInner deserializedConfluentAgreementResourceInner + = new ConfluentAgreementResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedConfluentAgreementResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedConfluentAgreementResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedConfluentAgreementResourceInner.type = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedConfluentAgreementResourceInner.systemData = SystemData.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedConfluentAgreementResourceInner.innerProperties + = ConfluentAgreementProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConfluentAgreementResourceInner; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/EnvironmentProperties.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/EnvironmentProperties.java index a9eab745ada8..a33f0ec55f93 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/EnvironmentProperties.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/EnvironmentProperties.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.models.SCMetadataEntity; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Environment resource property. */ @Fluent -public final class EnvironmentProperties { +public final class EnvironmentProperties implements JsonSerializable { /* * Metadata of the record */ - @JsonProperty(value = "metadata") private SCMetadataEntity metadata; /** @@ -55,4 +58,40 @@ public void validate() { metadata().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("metadata", this.metadata); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnvironmentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnvironmentProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EnvironmentProperties. + */ + public static EnvironmentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnvironmentProperties deserializedEnvironmentProperties = new EnvironmentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metadata".equals(fieldName)) { + deserializedEnvironmentProperties.metadata = SCMetadataEntity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEnvironmentProperties; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/InvitationRecordInner.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/InvitationRecordInner.java index 1b1bfcd2ba37..c83a059a2df1 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/InvitationRecordInner.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/InvitationRecordInner.java @@ -5,60 +5,56 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.models.MetadataEntity; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Record of the invitation. */ @Fluent -public final class InvitationRecordInner { +public final class InvitationRecordInner implements JsonSerializable { /* * Type of account */ - @JsonProperty(value = "kind") private String kind; /* * Id of the invitation */ - @JsonProperty(value = "id") private String id; /* * Metadata of the record */ - @JsonProperty(value = "metadata") private MetadataEntity metadata; /* * Email of the user */ - @JsonProperty(value = "email") private String email; /* * Auth type of the user */ - @JsonProperty(value = "auth_type") private String authType; /* * Status of the invitation */ - @JsonProperty(value = "status") private String status; /* * Accepted date time of the invitation */ - @JsonProperty(value = "accepted_at") private String acceptedAt; /* * Expiration date time of the invitation */ - @JsonProperty(value = "expires_at") private String expiresAt; /** @@ -237,4 +233,61 @@ public void validate() { metadata().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("metadata", this.metadata); + jsonWriter.writeStringField("email", this.email); + jsonWriter.writeStringField("auth_type", this.authType); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeStringField("accepted_at", this.acceptedAt); + jsonWriter.writeStringField("expires_at", this.expiresAt); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InvitationRecordInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InvitationRecordInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the InvitationRecordInner. + */ + public static InvitationRecordInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InvitationRecordInner deserializedInvitationRecordInner = new InvitationRecordInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedInvitationRecordInner.kind = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedInvitationRecordInner.id = reader.getString(); + } else if ("metadata".equals(fieldName)) { + deserializedInvitationRecordInner.metadata = MetadataEntity.fromJson(reader); + } else if ("email".equals(fieldName)) { + deserializedInvitationRecordInner.email = reader.getString(); + } else if ("auth_type".equals(fieldName)) { + deserializedInvitationRecordInner.authType = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedInvitationRecordInner.status = reader.getString(); + } else if ("accepted_at".equals(fieldName)) { + deserializedInvitationRecordInner.acceptedAt = reader.getString(); + } else if ("expires_at".equals(fieldName)) { + deserializedInvitationRecordInner.expiresAt = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInvitationRecordInner; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ListRegionsSuccessResponseInner.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ListRegionsSuccessResponseInner.java index 07372836b95b..9bfb058449f4 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ListRegionsSuccessResponseInner.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ListRegionsSuccessResponseInner.java @@ -5,19 +5,22 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.models.RegionRecord; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Result of POST request to list regions supported by confluent. */ @Fluent -public final class ListRegionsSuccessResponseInner { +public final class ListRegionsSuccessResponseInner implements JsonSerializable { /* * List of regions supported by confluent */ - @JsonProperty(value = "data") private List data; /** @@ -56,4 +59,42 @@ public void validate() { data().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("data", this.data, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListRegionsSuccessResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListRegionsSuccessResponseInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListRegionsSuccessResponseInner. + */ + public static ListRegionsSuccessResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListRegionsSuccessResponseInner deserializedListRegionsSuccessResponseInner + = new ListRegionsSuccessResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("data".equals(fieldName)) { + List data = reader.readArray(reader1 -> RegionRecord.fromJson(reader1)); + deserializedListRegionsSuccessResponseInner.data = data; + } else { + reader.skipChildren(); + } + } + + return deserializedListRegionsSuccessResponseInner; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/OperationResultInner.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/OperationResultInner.java index da43b9043773..122472bb5906 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/OperationResultInner.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/OperationResultInner.java @@ -5,30 +5,31 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.models.OperationDisplay; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * An Confluent REST API operation. */ @Fluent -public final class OperationResultInner { +public final class OperationResultInner implements JsonSerializable { /* * Operation name: {provider}/{resource}/{operation} */ - @JsonProperty(value = "name") private String name; /* * The object that represents the operation. */ - @JsonProperty(value = "display") private OperationDisplay display; /* * Indicates whether the operation is a data action */ - @JsonProperty(value = "isDataAction") private Boolean isDataAction; /** @@ -107,4 +108,46 @@ public void validate() { display().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("display", this.display); + jsonWriter.writeBooleanField("isDataAction", this.isDataAction); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationResultInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationResultInner. + */ + public static OperationResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationResultInner deserializedOperationResultInner = new OperationResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationResultInner.name = reader.getString(); + } else if ("display".equals(fieldName)) { + deserializedOperationResultInner.display = OperationDisplay.fromJson(reader); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationResultInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationResultInner; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/OrganizationResourceInner.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/OrganizationResourceInner.java index 231e1534c0b9..65e4fbfb30e8 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/OrganizationResourceInner.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/OrganizationResourceInner.java @@ -8,11 +8,14 @@ import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.models.LinkOrganization; import com.azure.resourcemanager.confluent.models.OfferDetail; import com.azure.resourcemanager.confluent.models.ProvisionState; import com.azure.resourcemanager.confluent.models.UserDetail; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.Map; @@ -24,15 +27,28 @@ public final class OrganizationResourceInner extends Resource { /* * Metadata pertaining to creation and last modification of the resource */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; /* * Organization resource properties */ - @JsonProperty(value = "properties", required = true) private OrganizationResourceProperties innerProperties = new OrganizationResourceProperties(); + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of OrganizationResourceInner class. */ @@ -57,6 +73,36 @@ private OrganizationResourceProperties innerProperties() { return this.innerProperties; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * {@inheritDoc} */ @@ -85,9 +131,7 @@ public OffsetDateTime createdTime() { } /** - * Get the provisioningState property: ProvisioningState - * - * Provision states for confluent RP. + * Get the provisioningState property: Provision states for confluent RP. * * @return the provisioningState value. */ @@ -189,12 +233,66 @@ public OrganizationResourceInner withLinkOrganization(LinkOrganization linkOrgan */ public void validate() { if (innerProperties() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property innerProperties in model OrganizationResourceInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model OrganizationResourceInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(OrganizationResourceInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrganizationResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrganizationResourceInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OrganizationResourceInner. + */ + public static OrganizationResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrganizationResourceInner deserializedOrganizationResourceInner = new OrganizationResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedOrganizationResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOrganizationResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOrganizationResourceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedOrganizationResourceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedOrganizationResourceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedOrganizationResourceInner.innerProperties + = OrganizationResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedOrganizationResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationResourceInner; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/OrganizationResourceProperties.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/OrganizationResourceProperties.java index 53f5631a2afb..9424fd817f4a 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/OrganizationResourceProperties.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/OrganizationResourceProperties.java @@ -5,61 +5,57 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.models.LinkOrganization; import com.azure.resourcemanager.confluent.models.OfferDetail; import com.azure.resourcemanager.confluent.models.ProvisionState; import com.azure.resourcemanager.confluent.models.UserDetail; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; /** * Organization resource property. */ @Fluent -public final class OrganizationResourceProperties { +public final class OrganizationResourceProperties implements JsonSerializable { /* * The creation time of the resource. */ - @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime createdTime; /* - * ProvisioningState - * * Provision states for confluent RP */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisionState provisioningState; /* * Id of the Confluent organization. */ - @JsonProperty(value = "organizationId", access = JsonProperty.Access.WRITE_ONLY) private String organizationId; /* * SSO url for the Confluent organization. */ - @JsonProperty(value = "ssoUrl", access = JsonProperty.Access.WRITE_ONLY) private String ssoUrl; /* * Confluent offer detail */ - @JsonProperty(value = "offerDetail", required = true) private OfferDetail offerDetail; /* * Subscriber detail */ - @JsonProperty(value = "userDetail", required = true) private UserDetail userDetail; /* * Link an existing Confluent organization */ - @JsonProperty(value = "linkOrganization") private LinkOrganization linkOrganization; /** @@ -78,9 +74,7 @@ public OffsetDateTime createdTime() { } /** - * Get the provisioningState property: ProvisioningState - * - * Provision states for confluent RP. + * Get the provisioningState property: Provision states for confluent RP. * * @return the provisioningState value. */ @@ -173,14 +167,16 @@ public OrganizationResourceProperties withLinkOrganization(LinkOrganization link */ public void validate() { if (offerDetail() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property offerDetail in model OrganizationResourceProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property offerDetail in model OrganizationResourceProperties")); } else { offerDetail().validate(); } if (userDetail() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property userDetail in model OrganizationResourceProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property userDetail in model OrganizationResourceProperties")); } else { userDetail().validate(); } @@ -190,4 +186,58 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(OrganizationResourceProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("offerDetail", this.offerDetail); + jsonWriter.writeJsonField("userDetail", this.userDetail); + jsonWriter.writeJsonField("linkOrganization", this.linkOrganization); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrganizationResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrganizationResourceProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OrganizationResourceProperties. + */ + public static OrganizationResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrganizationResourceProperties deserializedOrganizationResourceProperties + = new OrganizationResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("offerDetail".equals(fieldName)) { + deserializedOrganizationResourceProperties.offerDetail = OfferDetail.fromJson(reader); + } else if ("userDetail".equals(fieldName)) { + deserializedOrganizationResourceProperties.userDetail = UserDetail.fromJson(reader); + } else if ("createdTime".equals(fieldName)) { + deserializedOrganizationResourceProperties.createdTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("provisioningState".equals(fieldName)) { + deserializedOrganizationResourceProperties.provisioningState + = ProvisionState.fromString(reader.getString()); + } else if ("organizationId".equals(fieldName)) { + deserializedOrganizationResourceProperties.organizationId = reader.getString(); + } else if ("ssoUrl".equals(fieldName)) { + deserializedOrganizationResourceProperties.ssoUrl = reader.getString(); + } else if ("linkOrganization".equals(fieldName)) { + deserializedOrganizationResourceProperties.linkOrganization = LinkOrganization.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationResourceProperties; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/RegionProperties.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/RegionProperties.java index 29a777d62833..b98036dd8c35 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/RegionProperties.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/RegionProperties.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.models.RegionSpecEntity; import com.azure.resourcemanager.confluent.models.SCMetadataEntity; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Region Properties. */ @Fluent -public final class RegionProperties { +public final class RegionProperties implements JsonSerializable { /* * Metadata of the record */ - @JsonProperty(value = "metadata") private SCMetadataEntity metadata; /* * Specification of the region */ - @JsonProperty(value = "spec") private RegionSpecEntity spec; /** @@ -85,4 +87,43 @@ public void validate() { spec().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("metadata", this.metadata); + jsonWriter.writeJsonField("spec", this.spec); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegionProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RegionProperties. + */ + public static RegionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegionProperties deserializedRegionProperties = new RegionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metadata".equals(fieldName)) { + deserializedRegionProperties.metadata = SCMetadataEntity.fromJson(reader); + } else if ("spec".equals(fieldName)) { + deserializedRegionProperties.spec = RegionSpecEntity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRegionProperties; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/SCClusterRecordInner.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/SCClusterRecordInner.java index 64a66966c358..30c455d1d3dc 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/SCClusterRecordInner.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/SCClusterRecordInner.java @@ -5,38 +5,38 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.models.ClusterStatusEntity; import com.azure.resourcemanager.confluent.models.SCClusterSpecEntity; import com.azure.resourcemanager.confluent.models.SCMetadataEntity; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Details of cluster record. */ @Fluent -public final class SCClusterRecordInner { +public final class SCClusterRecordInner implements JsonSerializable { /* * Type of cluster */ - @JsonProperty(value = "kind") private String kind; /* * Id of the cluster */ - @JsonProperty(value = "id") private String id; /* * Cluster Properties */ - @JsonProperty(value = "properties") private ClusterProperties innerProperties; /* * Display name of the cluster */ - @JsonProperty(value = "name") private String name; /** @@ -193,4 +193,49 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SCClusterRecordInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SCClusterRecordInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SCClusterRecordInner. + */ + public static SCClusterRecordInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SCClusterRecordInner deserializedSCClusterRecordInner = new SCClusterRecordInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedSCClusterRecordInner.kind = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedSCClusterRecordInner.id = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSCClusterRecordInner.innerProperties = ClusterProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedSCClusterRecordInner.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSCClusterRecordInner; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/SCEnvironmentRecordInner.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/SCEnvironmentRecordInner.java index 3677b3958a0f..3f15513c568d 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/SCEnvironmentRecordInner.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/SCEnvironmentRecordInner.java @@ -5,36 +5,36 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.models.SCMetadataEntity; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Details about environment name, metadata and environment id of an environment. */ @Fluent -public final class SCEnvironmentRecordInner { +public final class SCEnvironmentRecordInner implements JsonSerializable { /* * Type of environment */ - @JsonProperty(value = "kind") private String kind; /* * Id of the environment */ - @JsonProperty(value = "id") private String id; /* * Environment properties */ - @JsonProperty(value = "properties") private EnvironmentProperties innerProperties; /* * Display name of the environment */ - @JsonProperty(value = "name") private String name; /** @@ -145,4 +145,49 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SCEnvironmentRecordInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SCEnvironmentRecordInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SCEnvironmentRecordInner. + */ + public static SCEnvironmentRecordInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SCEnvironmentRecordInner deserializedSCEnvironmentRecordInner = new SCEnvironmentRecordInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedSCEnvironmentRecordInner.kind = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedSCEnvironmentRecordInner.id = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSCEnvironmentRecordInner.innerProperties = EnvironmentProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedSCEnvironmentRecordInner.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSCEnvironmentRecordInner; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/SchemaRegistryClusterProperties.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/SchemaRegistryClusterProperties.java index fec259686dba..aa40cd361396 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/SchemaRegistryClusterProperties.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/SchemaRegistryClusterProperties.java @@ -5,32 +5,33 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.models.SCMetadataEntity; import com.azure.resourcemanager.confluent.models.SchemaRegistryClusterSpecEntity; import com.azure.resourcemanager.confluent.models.SchemaRegistryClusterStatusEntity; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Schema Registry Cluster Properties. */ @Fluent -public final class SchemaRegistryClusterProperties { +public final class SchemaRegistryClusterProperties implements JsonSerializable { /* * Metadata of the record */ - @JsonProperty(value = "metadata") private SCMetadataEntity metadata; /* * Specification of the schema registry cluster */ - @JsonProperty(value = "spec") private SchemaRegistryClusterSpecEntity spec; /* * Specification of the cluster status */ - @JsonProperty(value = "status") private SchemaRegistryClusterStatusEntity status; /** @@ -115,4 +116,48 @@ public void validate() { status().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("metadata", this.metadata); + jsonWriter.writeJsonField("spec", this.spec); + jsonWriter.writeJsonField("status", this.status); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SchemaRegistryClusterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SchemaRegistryClusterProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SchemaRegistryClusterProperties. + */ + public static SchemaRegistryClusterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SchemaRegistryClusterProperties deserializedSchemaRegistryClusterProperties + = new SchemaRegistryClusterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metadata".equals(fieldName)) { + deserializedSchemaRegistryClusterProperties.metadata = SCMetadataEntity.fromJson(reader); + } else if ("spec".equals(fieldName)) { + deserializedSchemaRegistryClusterProperties.spec = SchemaRegistryClusterSpecEntity.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedSchemaRegistryClusterProperties.status + = SchemaRegistryClusterStatusEntity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSchemaRegistryClusterProperties; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/SchemaRegistryClusterRecordInner.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/SchemaRegistryClusterRecordInner.java index 46cac907678f..73dd63baf824 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/SchemaRegistryClusterRecordInner.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/SchemaRegistryClusterRecordInner.java @@ -5,32 +5,33 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.models.SCMetadataEntity; import com.azure.resourcemanager.confluent.models.SchemaRegistryClusterSpecEntity; import com.azure.resourcemanager.confluent.models.SchemaRegistryClusterStatusEntity; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Details of schema registry cluster record. */ @Fluent -public final class SchemaRegistryClusterRecordInner { +public final class SchemaRegistryClusterRecordInner implements JsonSerializable { /* * Kind of the cluster */ - @JsonProperty(value = "kind") private String kind; /* * Id of the cluster */ - @JsonProperty(value = "id") private String id; /* * Schema Registry Cluster Properties */ - @JsonProperty(value = "properties") private SchemaRegistryClusterProperties innerProperties; /** @@ -167,4 +168,48 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SchemaRegistryClusterRecordInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SchemaRegistryClusterRecordInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SchemaRegistryClusterRecordInner. + */ + public static SchemaRegistryClusterRecordInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SchemaRegistryClusterRecordInner deserializedSchemaRegistryClusterRecordInner + = new SchemaRegistryClusterRecordInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedSchemaRegistryClusterRecordInner.kind = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedSchemaRegistryClusterRecordInner.id = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSchemaRegistryClusterRecordInner.innerProperties + = SchemaRegistryClusterProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSchemaRegistryClusterRecordInner; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ValidationResponseInner.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ValidationResponseInner.java index b57fc92349e5..b40fd00008a2 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ValidationResponseInner.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ValidationResponseInner.java @@ -5,8 +5,11 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** @@ -15,12 +18,10 @@ * Validation response from the provider. */ @Fluent -public final class ValidationResponseInner { +public final class ValidationResponseInner implements JsonSerializable { /* * Info from the response */ - @JsonProperty(value = "info") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map info; /** @@ -56,4 +57,41 @@ public ValidationResponseInner withInfo(Map info) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("info", this.info, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationResponseInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidationResponseInner. + */ + public static ValidationResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationResponseInner deserializedValidationResponseInner = new ValidationResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("info".equals(fieldName)) { + Map info = reader.readMap(reader1 -> reader1.getString()); + deserializedValidationResponseInner.info = info; + } else { + reader.skipChildren(); + } + } + + return deserializedValidationResponseInner; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/ConfluentManagementClientImpl.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/ConfluentManagementClientImpl.java index ff4caa17466a..ef0ffbf9ae0c 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/ConfluentManagementClientImpl.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/ConfluentManagementClientImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.confluent.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; @@ -323,7 +324,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/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/MarketplaceAgreementsClientImpl.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/MarketplaceAgreementsClientImpl.java index 77c17d8c8d37..5bc6accf56b8 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/MarketplaceAgreementsClientImpl.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/MarketplaceAgreementsClientImpl.java @@ -302,9 +302,7 @@ public ConfluentAgreementResourceInner create() { /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @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. @@ -329,9 +327,7 @@ private Mono> listNextSinglePageA /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @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. diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/OrganizationOperationsClientImpl.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/OrganizationOperationsClientImpl.java index 0728ee9e73ef..85e4dafd4fec 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/OrganizationOperationsClientImpl.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/OrganizationOperationsClientImpl.java @@ -179,9 +179,7 @@ public PagedIterable list(Context context) { /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @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. @@ -207,9 +205,7 @@ private Mono> listNextSinglePageAsync(String /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @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. diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/OrganizationsClientImpl.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/OrganizationsClientImpl.java index 5857f58d2f18..0b6d0d38ffe0 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/OrganizationsClientImpl.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/OrganizationsClientImpl.java @@ -2834,9 +2834,7 @@ public SCClusterRecordInner getClusterById(String resourceGroupName, String orga /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @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. @@ -2864,9 +2862,7 @@ private Mono> listBySubscriptionNextSin /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @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. @@ -2894,9 +2890,7 @@ private Mono> listBySubscriptionNextSin /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @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. @@ -2924,9 +2918,7 @@ private Mono> listByResourceGroupNextSi /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @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. @@ -2954,9 +2946,7 @@ private Mono> listByResourceGroupNextSi /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @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. @@ -2983,9 +2973,7 @@ private Mono> listEnvironmentsNextSingle /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @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. @@ -3013,9 +3001,7 @@ private Mono> listEnvironmentsNextSingle /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @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. @@ -3042,9 +3028,7 @@ private Mono> listClustersNextSinglePageAsyn /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @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. @@ -3072,9 +3056,7 @@ private Mono> listClustersNextSinglePageAsyn /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @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. @@ -3103,9 +3085,7 @@ private Mono> listClustersNextSinglePageAsyn /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @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. diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/ResourceManagerUtils.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/ResourceManagerUtils.java index 6490c75bb35f..a72a7f46b580 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/ResourceManagerUtils.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/ResourceManagerUtils.java @@ -41,7 +41,6 @@ static String getValueFromIdByName(String id, String name) { } } return null; - } static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { @@ -75,7 +74,6 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } } return null; - } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/AccessCreateRoleBindingRequestModel.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/AccessCreateRoleBindingRequestModel.java index 5ae350a95eef..c73b5af4fdc1 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/AccessCreateRoleBindingRequestModel.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/AccessCreateRoleBindingRequestModel.java @@ -5,29 +5,31 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Create role binding request model. */ @Fluent -public final class AccessCreateRoleBindingRequestModel { +public final class AccessCreateRoleBindingRequestModel + implements JsonSerializable { /* * The principal User or Group to bind the role to */ - @JsonProperty(value = "principal") private String principal; /* * The name of the role to bind to the principal */ - @JsonProperty(value = "role_name") private String roleName; /* * A CRN that specifies the scope and resource patterns necessary for the role to bind */ - @JsonProperty(value = "crn_pattern") private String crnPattern; /** @@ -77,8 +79,7 @@ public AccessCreateRoleBindingRequestModel withRoleName(String roleName) { } /** - * Get the crnPattern property: A CRN that specifies the scope and resource patterns necessary for the role to - * bind. + * Get the crnPattern property: A CRN that specifies the scope and resource patterns necessary for the role to bind. * * @return the crnPattern value. */ @@ -87,8 +88,7 @@ public String crnPattern() { } /** - * Set the crnPattern property: A CRN that specifies the scope and resource patterns necessary for the role to - * bind. + * Set the crnPattern property: A CRN that specifies the scope and resource patterns necessary for the role to bind. * * @param crnPattern the crnPattern value to set. * @return the AccessCreateRoleBindingRequestModel object itself. @@ -105,4 +105,47 @@ public AccessCreateRoleBindingRequestModel withCrnPattern(String crnPattern) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("principal", this.principal); + jsonWriter.writeStringField("role_name", this.roleName); + jsonWriter.writeStringField("crn_pattern", this.crnPattern); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessCreateRoleBindingRequestModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessCreateRoleBindingRequestModel if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessCreateRoleBindingRequestModel. + */ + public static AccessCreateRoleBindingRequestModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessCreateRoleBindingRequestModel deserializedAccessCreateRoleBindingRequestModel + = new AccessCreateRoleBindingRequestModel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principal".equals(fieldName)) { + deserializedAccessCreateRoleBindingRequestModel.principal = reader.getString(); + } else if ("role_name".equals(fieldName)) { + deserializedAccessCreateRoleBindingRequestModel.roleName = reader.getString(); + } else if ("crn_pattern".equals(fieldName)) { + deserializedAccessCreateRoleBindingRequestModel.crnPattern = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessCreateRoleBindingRequestModel; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/AccessInviteUserAccountModel.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/AccessInviteUserAccountModel.java index 709a5a44a0f0..a777a70cf2d8 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/AccessInviteUserAccountModel.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/AccessInviteUserAccountModel.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Invite User Account model. */ @Fluent -public final class AccessInviteUserAccountModel { +public final class AccessInviteUserAccountModel implements JsonSerializable { /* * Id of the organization */ - @JsonProperty(value = "organizationId") private String organizationId; /* * Email of the logged in user */ - @JsonProperty(value = "email") private String email; /* * Upn of the logged in user */ - @JsonProperty(value = "upn") private String upn; /* * Details of the user who is being invited */ - @JsonProperty(value = "invitedUserDetails") private AccessInvitedUserDetails invitedUserDetails; /** @@ -132,4 +132,50 @@ public void validate() { invitedUserDetails().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("organizationId", this.organizationId); + jsonWriter.writeStringField("email", this.email); + jsonWriter.writeStringField("upn", this.upn); + jsonWriter.writeJsonField("invitedUserDetails", this.invitedUserDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessInviteUserAccountModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessInviteUserAccountModel if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessInviteUserAccountModel. + */ + public static AccessInviteUserAccountModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessInviteUserAccountModel deserializedAccessInviteUserAccountModel = new AccessInviteUserAccountModel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("organizationId".equals(fieldName)) { + deserializedAccessInviteUserAccountModel.organizationId = reader.getString(); + } else if ("email".equals(fieldName)) { + deserializedAccessInviteUserAccountModel.email = reader.getString(); + } else if ("upn".equals(fieldName)) { + deserializedAccessInviteUserAccountModel.upn = reader.getString(); + } else if ("invitedUserDetails".equals(fieldName)) { + deserializedAccessInviteUserAccountModel.invitedUserDetails + = AccessInvitedUserDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessInviteUserAccountModel; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/AccessInvitedUserDetails.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/AccessInvitedUserDetails.java index f05d239a5602..e78beab5eccd 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/AccessInvitedUserDetails.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/AccessInvitedUserDetails.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Details of the user being invited. */ @Fluent -public final class AccessInvitedUserDetails { +public final class AccessInvitedUserDetails implements JsonSerializable { /* * UPN/Email of the user who is being invited */ - @JsonProperty(value = "invitedEmail") private String invitedEmail; /* * Auth type of the user */ - @JsonProperty(value = "auth_type") private String authType; /** @@ -77,4 +79,43 @@ public AccessInvitedUserDetails withAuthType(String authType) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("invitedEmail", this.invitedEmail); + jsonWriter.writeStringField("auth_type", this.authType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessInvitedUserDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessInvitedUserDetails if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessInvitedUserDetails. + */ + public static AccessInvitedUserDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessInvitedUserDetails deserializedAccessInvitedUserDetails = new AccessInvitedUserDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("invitedEmail".equals(fieldName)) { + deserializedAccessInvitedUserDetails.invitedEmail = reader.getString(); + } else if ("auth_type".equals(fieldName)) { + deserializedAccessInvitedUserDetails.authType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessInvitedUserDetails; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ApiKeyOwnerEntity.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ApiKeyOwnerEntity.java index 5de30d35f8a0..f6354f90ef10 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ApiKeyOwnerEntity.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ApiKeyOwnerEntity.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * API Key Owner details which can be a user or service account. */ @Fluent -public final class ApiKeyOwnerEntity { +public final class ApiKeyOwnerEntity implements JsonSerializable { /* * API Key owner id */ - @JsonProperty(value = "id") private String id; /* * API URL for accessing or modifying the referred object */ - @JsonProperty(value = "related") private String related; /* * CRN reference to the referred resource */ - @JsonProperty(value = "resourceName") private String resourceName; /* * Type of the owner service or user account */ - @JsonProperty(value = "kind") private String kind; /** @@ -129,4 +129,49 @@ public ApiKeyOwnerEntity withKind(String kind) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("related", this.related); + jsonWriter.writeStringField("resourceName", this.resourceName); + jsonWriter.writeStringField("kind", this.kind); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiKeyOwnerEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiKeyOwnerEntity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ApiKeyOwnerEntity. + */ + public static ApiKeyOwnerEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiKeyOwnerEntity deserializedApiKeyOwnerEntity = new ApiKeyOwnerEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApiKeyOwnerEntity.id = reader.getString(); + } else if ("related".equals(fieldName)) { + deserializedApiKeyOwnerEntity.related = reader.getString(); + } else if ("resourceName".equals(fieldName)) { + deserializedApiKeyOwnerEntity.resourceName = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedApiKeyOwnerEntity.kind = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApiKeyOwnerEntity; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ApiKeyResourceEntity.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ApiKeyResourceEntity.java index 780e53b3a4cf..b617822ea299 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ApiKeyResourceEntity.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ApiKeyResourceEntity.java @@ -5,41 +5,40 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * API Key Resource details which can be kafka cluster or schema registry cluster. */ @Fluent -public final class ApiKeyResourceEntity { +public final class ApiKeyResourceEntity implements JsonSerializable { /* * Id of the resource */ - @JsonProperty(value = "id") private String id; /* * The environment of the api key */ - @JsonProperty(value = "environment") private String environment; /* * API URL for accessing or modifying the api key resource object */ - @JsonProperty(value = "related") private String related; /* * CRN reference to the referred resource */ - @JsonProperty(value = "resourceName") private String resourceName; /* * Type of the owner which can be service or user account */ - @JsonProperty(value = "kind") private String kind; /** @@ -155,4 +154,52 @@ public ApiKeyResourceEntity withKind(String kind) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("environment", this.environment); + jsonWriter.writeStringField("related", this.related); + jsonWriter.writeStringField("resourceName", this.resourceName); + jsonWriter.writeStringField("kind", this.kind); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiKeyResourceEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiKeyResourceEntity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApiKeyResourceEntity. + */ + public static ApiKeyResourceEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiKeyResourceEntity deserializedApiKeyResourceEntity = new ApiKeyResourceEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApiKeyResourceEntity.id = reader.getString(); + } else if ("environment".equals(fieldName)) { + deserializedApiKeyResourceEntity.environment = reader.getString(); + } else if ("related".equals(fieldName)) { + deserializedApiKeyResourceEntity.related = reader.getString(); + } else if ("resourceName".equals(fieldName)) { + deserializedApiKeyResourceEntity.resourceName = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedApiKeyResourceEntity.kind = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApiKeyResourceEntity; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ApiKeySpecEntity.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ApiKeySpecEntity.java index 6134eaf67263..eeb240772790 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ApiKeySpecEntity.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ApiKeySpecEntity.java @@ -5,41 +5,40 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Spec of the API Key record. */ @Fluent -public final class ApiKeySpecEntity { +public final class ApiKeySpecEntity implements JsonSerializable { /* * The description of the API Key */ - @JsonProperty(value = "description") private String description; /* * The name of the API Key */ - @JsonProperty(value = "name") private String name; /* * API Key Secret */ - @JsonProperty(value = "secret") private String secret; /* * Specification of the cluster */ - @JsonProperty(value = "resource") private ApiKeyResourceEntity resource; /* * Specification of the cluster */ - @JsonProperty(value = "owner") private ApiKeyOwnerEntity owner; /** @@ -161,4 +160,52 @@ public void validate() { owner().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("secret", this.secret); + jsonWriter.writeJsonField("resource", this.resource); + jsonWriter.writeJsonField("owner", this.owner); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiKeySpecEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiKeySpecEntity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ApiKeySpecEntity. + */ + public static ApiKeySpecEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiKeySpecEntity deserializedApiKeySpecEntity = new ApiKeySpecEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedApiKeySpecEntity.description = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedApiKeySpecEntity.name = reader.getString(); + } else if ("secret".equals(fieldName)) { + deserializedApiKeySpecEntity.secret = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedApiKeySpecEntity.resource = ApiKeyResourceEntity.fromJson(reader); + } else if ("owner".equals(fieldName)) { + deserializedApiKeySpecEntity.owner = ApiKeyOwnerEntity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApiKeySpecEntity; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterByokEntity.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterByokEntity.java index f684b608269a..3b0701060d23 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterByokEntity.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterByokEntity.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The network associated with this object. */ @Fluent -public final class ClusterByokEntity { +public final class ClusterByokEntity implements JsonSerializable { /* * ID of the referred resource */ - @JsonProperty(value = "id") private String id; /* * API URL for accessing or modifying the referred object */ - @JsonProperty(value = "related") private String related; /* * CRN reference to the referred resource */ - @JsonProperty(value = "resource_name") private String resourceName; /** @@ -103,4 +104,46 @@ public ClusterByokEntity withResourceName(String resourceName) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("related", this.related); + jsonWriter.writeStringField("resource_name", this.resourceName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterByokEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterByokEntity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterByokEntity. + */ + public static ClusterByokEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterByokEntity deserializedClusterByokEntity = new ClusterByokEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedClusterByokEntity.id = reader.getString(); + } else if ("related".equals(fieldName)) { + deserializedClusterByokEntity.related = reader.getString(); + } else if ("resource_name".equals(fieldName)) { + deserializedClusterByokEntity.resourceName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterByokEntity; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterConfigEntity.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterConfigEntity.java index 6b853e3254a9..faefcb50bcd0 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterConfigEntity.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterConfigEntity.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The configuration of the Kafka cluster. */ @Fluent -public final class ClusterConfigEntity { +public final class ClusterConfigEntity implements JsonSerializable { /* * The lifecycle phase of the cluster */ - @JsonProperty(value = "kind") private String kind; /** @@ -51,4 +54,40 @@ public ClusterConfigEntity withKind(String kind) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterConfigEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterConfigEntity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterConfigEntity. + */ + public static ClusterConfigEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterConfigEntity deserializedClusterConfigEntity = new ClusterConfigEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedClusterConfigEntity.kind = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterConfigEntity; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterEnvironmentEntity.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterEnvironmentEntity.java index a3f2f0505efd..a8218d2e3dd3 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterEnvironmentEntity.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterEnvironmentEntity.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The environment to which cluster belongs. */ @Fluent -public final class ClusterEnvironmentEntity { +public final class ClusterEnvironmentEntity implements JsonSerializable { /* * ID of the referred resource */ - @JsonProperty(value = "id") private String id; /* * Environment of the referred resource */ - @JsonProperty(value = "environment") private String environment; /* * API URL for accessing or modifying the referred object */ - @JsonProperty(value = "related") private String related; /* * CRN reference to the referred resource */ - @JsonProperty(value = "resource_name") private String resourceName; /** @@ -129,4 +129,49 @@ public ClusterEnvironmentEntity withResourceName(String resourceName) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("environment", this.environment); + jsonWriter.writeStringField("related", this.related); + jsonWriter.writeStringField("resource_name", this.resourceName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterEnvironmentEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterEnvironmentEntity if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterEnvironmentEntity. + */ + public static ClusterEnvironmentEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterEnvironmentEntity deserializedClusterEnvironmentEntity = new ClusterEnvironmentEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedClusterEnvironmentEntity.id = reader.getString(); + } else if ("environment".equals(fieldName)) { + deserializedClusterEnvironmentEntity.environment = reader.getString(); + } else if ("related".equals(fieldName)) { + deserializedClusterEnvironmentEntity.related = reader.getString(); + } else if ("resource_name".equals(fieldName)) { + deserializedClusterEnvironmentEntity.resourceName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterEnvironmentEntity; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterNetworkEntity.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterNetworkEntity.java index 9bc0379b6902..901cb13e36bc 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterNetworkEntity.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterNetworkEntity.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The network associated with this object. */ @Fluent -public final class ClusterNetworkEntity { +public final class ClusterNetworkEntity implements JsonSerializable { /* * ID of the referred resource */ - @JsonProperty(value = "id") private String id; /* * Environment of the referred resource */ - @JsonProperty(value = "environment") private String environment; /* * API URL for accessing or modifying the referred object */ - @JsonProperty(value = "related") private String related; /* * CRN reference to the referred resource */ - @JsonProperty(value = "resource_name") private String resourceName; /** @@ -129,4 +129,49 @@ public ClusterNetworkEntity withResourceName(String resourceName) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("environment", this.environment); + jsonWriter.writeStringField("related", this.related); + jsonWriter.writeStringField("resource_name", this.resourceName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterNetworkEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterNetworkEntity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterNetworkEntity. + */ + public static ClusterNetworkEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterNetworkEntity deserializedClusterNetworkEntity = new ClusterNetworkEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedClusterNetworkEntity.id = reader.getString(); + } else if ("environment".equals(fieldName)) { + deserializedClusterNetworkEntity.environment = reader.getString(); + } else if ("related".equals(fieldName)) { + deserializedClusterNetworkEntity.related = reader.getString(); + } else if ("resource_name".equals(fieldName)) { + deserializedClusterNetworkEntity.resourceName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterNetworkEntity; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterRecord.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterRecord.java index 5e8128ec0e50..66f200a37716 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterRecord.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterRecord.java @@ -5,47 +5,45 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Details of cluster record. */ @Fluent -public final class ClusterRecord { +public final class ClusterRecord implements JsonSerializable { /* * Type of cluster */ - @JsonProperty(value = "kind") private String kind; /* * Id of the cluster */ - @JsonProperty(value = "id") private String id; /* * Metadata of the record */ - @JsonProperty(value = "metadata") private MetadataEntity metadata; /* * Display name of the cluster */ - @JsonProperty(value = "display_name") private String displayName; /* * Specification of the cluster */ - @JsonProperty(value = "spec") private ClusterSpecEntity spec; /* * Specification of the cluster */ - @JsonProperty(value = "status") private ClusterStatusEntity status; /** @@ -190,4 +188,55 @@ public void validate() { status().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("metadata", this.metadata); + jsonWriter.writeStringField("display_name", this.displayName); + jsonWriter.writeJsonField("spec", this.spec); + jsonWriter.writeJsonField("status", this.status); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterRecord from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterRecord if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterRecord. + */ + public static ClusterRecord fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterRecord deserializedClusterRecord = new ClusterRecord(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedClusterRecord.kind = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedClusterRecord.id = reader.getString(); + } else if ("metadata".equals(fieldName)) { + deserializedClusterRecord.metadata = MetadataEntity.fromJson(reader); + } else if ("display_name".equals(fieldName)) { + deserializedClusterRecord.displayName = reader.getString(); + } else if ("spec".equals(fieldName)) { + deserializedClusterRecord.spec = ClusterSpecEntity.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedClusterRecord.status = ClusterStatusEntity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterRecord; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterSpecEntity.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterSpecEntity.java index 5bcc7f89afdc..8f2ab313eb16 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterSpecEntity.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterSpecEntity.java @@ -5,83 +5,75 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Spec of the cluster record. */ @Fluent -public final class ClusterSpecEntity { +public final class ClusterSpecEntity implements JsonSerializable { /* * The name of the cluster */ - @JsonProperty(value = "display_name") private String displayName; /* * The availability zone configuration of the cluster */ - @JsonProperty(value = "availability") private String availability; /* * The cloud service provider */ - @JsonProperty(value = "cloud") private String cloud; /* * type of zone availability */ - @JsonProperty(value = "zone") private String zone; /* * The cloud service provider region */ - @JsonProperty(value = "region") private String region; /* * The bootstrap endpoint used by Kafka clients to connect to the cluster */ - @JsonProperty(value = "kafka_bootstrap_endpoint") private String kafkaBootstrapEndpoint; /* * The cluster HTTP request URL. */ - @JsonProperty(value = "http_endpoint") private String httpEndpoint; /* * The Kafka API cluster endpoint */ - @JsonProperty(value = "api_endpoint") private String apiEndpoint; /* * Specification of the cluster */ - @JsonProperty(value = "config") private ClusterConfigEntity config; /* * Specification of the cluster */ - @JsonProperty(value = "environment") private ClusterEnvironmentEntity environment; /* * Specification of the cluster */ - @JsonProperty(value = "network") private ClusterNetworkEntity network; /* * Specification of the cluster */ - @JsonProperty(value = "byok") private ClusterByokEntity byok; /** @@ -349,4 +341,73 @@ public void validate() { byok().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("display_name", this.displayName); + jsonWriter.writeStringField("availability", this.availability); + jsonWriter.writeStringField("cloud", this.cloud); + jsonWriter.writeStringField("zone", this.zone); + jsonWriter.writeStringField("region", this.region); + jsonWriter.writeStringField("kafka_bootstrap_endpoint", this.kafkaBootstrapEndpoint); + jsonWriter.writeStringField("http_endpoint", this.httpEndpoint); + jsonWriter.writeStringField("api_endpoint", this.apiEndpoint); + jsonWriter.writeJsonField("config", this.config); + jsonWriter.writeJsonField("environment", this.environment); + jsonWriter.writeJsonField("network", this.network); + jsonWriter.writeJsonField("byok", this.byok); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterSpecEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterSpecEntity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterSpecEntity. + */ + public static ClusterSpecEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterSpecEntity deserializedClusterSpecEntity = new ClusterSpecEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("display_name".equals(fieldName)) { + deserializedClusterSpecEntity.displayName = reader.getString(); + } else if ("availability".equals(fieldName)) { + deserializedClusterSpecEntity.availability = reader.getString(); + } else if ("cloud".equals(fieldName)) { + deserializedClusterSpecEntity.cloud = reader.getString(); + } else if ("zone".equals(fieldName)) { + deserializedClusterSpecEntity.zone = reader.getString(); + } else if ("region".equals(fieldName)) { + deserializedClusterSpecEntity.region = reader.getString(); + } else if ("kafka_bootstrap_endpoint".equals(fieldName)) { + deserializedClusterSpecEntity.kafkaBootstrapEndpoint = reader.getString(); + } else if ("http_endpoint".equals(fieldName)) { + deserializedClusterSpecEntity.httpEndpoint = reader.getString(); + } else if ("api_endpoint".equals(fieldName)) { + deserializedClusterSpecEntity.apiEndpoint = reader.getString(); + } else if ("config".equals(fieldName)) { + deserializedClusterSpecEntity.config = ClusterConfigEntity.fromJson(reader); + } else if ("environment".equals(fieldName)) { + deserializedClusterSpecEntity.environment = ClusterEnvironmentEntity.fromJson(reader); + } else if ("network".equals(fieldName)) { + deserializedClusterSpecEntity.network = ClusterNetworkEntity.fromJson(reader); + } else if ("byok".equals(fieldName)) { + deserializedClusterSpecEntity.byok = ClusterByokEntity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterSpecEntity; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterStatusEntity.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterStatusEntity.java index 71cd03cb2b31..0efcbef333fc 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterStatusEntity.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ClusterStatusEntity.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Status of the cluster record. */ @Fluent -public final class ClusterStatusEntity { +public final class ClusterStatusEntity implements JsonSerializable { /* * The lifecycle phase of the cluster */ - @JsonProperty(value = "phase") private String phase; /* * The number of Confluent Kafka Units */ - @JsonProperty(value = "cku") private Integer cku; /** @@ -77,4 +79,43 @@ public ClusterStatusEntity withCku(Integer cku) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("phase", this.phase); + jsonWriter.writeNumberField("cku", this.cku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterStatusEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterStatusEntity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterStatusEntity. + */ + public static ClusterStatusEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterStatusEntity deserializedClusterStatusEntity = new ClusterStatusEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("phase".equals(fieldName)) { + deserializedClusterStatusEntity.phase = reader.getString(); + } else if ("cku".equals(fieldName)) { + deserializedClusterStatusEntity.cku = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterStatusEntity; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ConfluentAgreementResourceListResponse.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ConfluentAgreementResourceListResponse.java index 59a6f62d414a..336abffe133b 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ConfluentAgreementResourceListResponse.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ConfluentAgreementResourceListResponse.java @@ -5,25 +5,28 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.fluent.models.ConfluentAgreementResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Response of a list operation. */ @Fluent -public final class ConfluentAgreementResourceListResponse { +public final class ConfluentAgreementResourceListResponse + implements JsonSerializable { /* * Results of a list operation. */ - @JsonProperty(value = "value") private List value; /* * Link to the next set of results, if any. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +85,46 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfluentAgreementResourceListResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfluentAgreementResourceListResponse if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConfluentAgreementResourceListResponse. + */ + public static ConfluentAgreementResourceListResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfluentAgreementResourceListResponse deserializedConfluentAgreementResourceListResponse + = new ConfluentAgreementResourceListResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ConfluentAgreementResourceInner.fromJson(reader1)); + deserializedConfluentAgreementResourceListResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedConfluentAgreementResourceListResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConfluentAgreementResourceListResponse; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ConfluentListMetadata.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ConfluentListMetadata.java index 8732332e7af8..d49500d34e55 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ConfluentListMetadata.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ConfluentListMetadata.java @@ -5,41 +5,40 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Metadata of the list. */ @Fluent -public final class ConfluentListMetadata { +public final class ConfluentListMetadata implements JsonSerializable { /* * First page of the list */ - @JsonProperty(value = "first") private String first; /* * Last page of the list */ - @JsonProperty(value = "last") private String last; /* * Previous page of the list */ - @JsonProperty(value = "prev") private String prev; /* * Next page of the list */ - @JsonProperty(value = "next") private String next; /* * Total size of the list */ - @JsonProperty(value = "total_size") private Integer totalSize; /** @@ -155,4 +154,52 @@ public ConfluentListMetadata withTotalSize(Integer totalSize) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("first", this.first); + jsonWriter.writeStringField("last", this.last); + jsonWriter.writeStringField("prev", this.prev); + jsonWriter.writeStringField("next", this.next); + jsonWriter.writeNumberField("total_size", this.totalSize); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfluentListMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfluentListMetadata if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConfluentListMetadata. + */ + public static ConfluentListMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfluentListMetadata deserializedConfluentListMetadata = new ConfluentListMetadata(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("first".equals(fieldName)) { + deserializedConfluentListMetadata.first = reader.getString(); + } else if ("last".equals(fieldName)) { + deserializedConfluentListMetadata.last = reader.getString(); + } else if ("prev".equals(fieldName)) { + deserializedConfluentListMetadata.prev = reader.getString(); + } else if ("next".equals(fieldName)) { + deserializedConfluentListMetadata.next = reader.getString(); + } else if ("total_size".equals(fieldName)) { + deserializedConfluentListMetadata.totalSize = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedConfluentListMetadata; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/CreateApiKeyModel.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/CreateApiKeyModel.java index 03f84c55879c..953fd3e25546 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/CreateApiKeyModel.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/CreateApiKeyModel.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Create API Key model. */ @Fluent -public final class CreateApiKeyModel { +public final class CreateApiKeyModel implements JsonSerializable { /* * Name of the API Key */ - @JsonProperty(value = "name") private String name; /* * Description of the API Key */ - @JsonProperty(value = "description") private String description; /** @@ -77,4 +79,43 @@ public CreateApiKeyModel withDescription(String description) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreateApiKeyModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreateApiKeyModel if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CreateApiKeyModel. + */ + public static CreateApiKeyModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CreateApiKeyModel deserializedCreateApiKeyModel = new CreateApiKeyModel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCreateApiKeyModel.name = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedCreateApiKeyModel.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCreateApiKeyModel; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/EnvironmentRecord.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/EnvironmentRecord.java index 61ea9ff4a004..b9107c3ae79a 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/EnvironmentRecord.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/EnvironmentRecord.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Details about environment name, metadata and environment id of an environment. */ @Fluent -public final class EnvironmentRecord { +public final class EnvironmentRecord implements JsonSerializable { /* * Type of environment */ - @JsonProperty(value = "kind") private String kind; /* * Id of the environment */ - @JsonProperty(value = "id") private String id; /* * Metadata of the record */ - @JsonProperty(value = "metadata") private MetadataEntity metadata; /* * Display name of the user */ - @JsonProperty(value = "display_name") private String displayName; /** @@ -132,4 +132,49 @@ public void validate() { metadata().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("metadata", this.metadata); + jsonWriter.writeStringField("display_name", this.displayName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnvironmentRecord from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnvironmentRecord if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EnvironmentRecord. + */ + public static EnvironmentRecord fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnvironmentRecord deserializedEnvironmentRecord = new EnvironmentRecord(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedEnvironmentRecord.kind = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedEnvironmentRecord.id = reader.getString(); + } else if ("metadata".equals(fieldName)) { + deserializedEnvironmentRecord.metadata = MetadataEntity.fromJson(reader); + } else if ("display_name".equals(fieldName)) { + deserializedEnvironmentRecord.displayName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEnvironmentRecord; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/GetEnvironmentsResponse.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/GetEnvironmentsResponse.java index 77dc0f69e041..ba47f837fb54 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/GetEnvironmentsResponse.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/GetEnvironmentsResponse.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.fluent.models.SCEnvironmentRecordInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Result of GET request to list Confluent operations. */ @Fluent -public final class GetEnvironmentsResponse { +public final class GetEnvironmentsResponse implements JsonSerializable { /* * List of environments in a confluent organization */ - @JsonProperty(value = "value") private List value; /* * URL to get the next set of environment records if there are any. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetEnvironmentsResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetEnvironmentsResponse if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the GetEnvironmentsResponse. + */ + public static GetEnvironmentsResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetEnvironmentsResponse deserializedGetEnvironmentsResponse = new GetEnvironmentsResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SCEnvironmentRecordInner.fromJson(reader1)); + deserializedGetEnvironmentsResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedGetEnvironmentsResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGetEnvironmentsResponse; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/LinkOrganization.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/LinkOrganization.java index 643c27febd7b..7517588624a6 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/LinkOrganization.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/LinkOrganization.java @@ -6,17 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Link an existing Confluent organization. */ @Fluent -public final class LinkOrganization { +public final class LinkOrganization implements JsonSerializable { /* * User auth token */ - @JsonProperty(value = "token") private String token; /** @@ -52,10 +55,47 @@ public LinkOrganization withToken(String token) { */ public void validate() { if (token() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property token in model LinkOrganization")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property token in model LinkOrganization")); } } private static final ClientLogger LOGGER = new ClientLogger(LinkOrganization.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("token", this.token); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LinkOrganization from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LinkOrganization if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LinkOrganization. + */ + public static LinkOrganization fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LinkOrganization deserializedLinkOrganization = new LinkOrganization(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("token".equals(fieldName)) { + deserializedLinkOrganization.token = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLinkOrganization; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ListAccessRequestModel.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ListAccessRequestModel.java index 0225409c1057..3c22f93ea53b 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ListAccessRequestModel.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ListAccessRequestModel.java @@ -5,20 +5,21 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** * List Access Request Model. */ @Fluent -public final class ListAccessRequestModel { +public final class ListAccessRequestModel implements JsonSerializable { /* * Search filters for the request */ - @JsonProperty(value = "searchFilters") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map searchFilters; /** @@ -54,4 +55,41 @@ public ListAccessRequestModel withSearchFilters(Map searchFilter */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("searchFilters", this.searchFilters, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListAccessRequestModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListAccessRequestModel if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListAccessRequestModel. + */ + public static ListAccessRequestModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListAccessRequestModel deserializedListAccessRequestModel = new ListAccessRequestModel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("searchFilters".equals(fieldName)) { + Map searchFilters = reader.readMap(reader1 -> reader1.getString()); + deserializedListAccessRequestModel.searchFilters = searchFilters; + } else { + reader.skipChildren(); + } + } + + return deserializedListAccessRequestModel; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ListClustersSuccessResponse.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ListClustersSuccessResponse.java index 115fdb9150bc..d66b595d1653 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ListClustersSuccessResponse.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ListClustersSuccessResponse.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.fluent.models.SCClusterRecordInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Result of GET request to list clusters in the environment of a confluent organization. */ @Fluent -public final class ListClustersSuccessResponse { +public final class ListClustersSuccessResponse implements JsonSerializable { /* * List of clusters in an environment of a confluent organization */ - @JsonProperty(value = "value") private List value; /* * URL to get the next set of cluster records if there are any. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListClustersSuccessResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListClustersSuccessResponse if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListClustersSuccessResponse. + */ + public static ListClustersSuccessResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListClustersSuccessResponse deserializedListClustersSuccessResponse = new ListClustersSuccessResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SCClusterRecordInner.fromJson(reader1)); + deserializedListClustersSuccessResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListClustersSuccessResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListClustersSuccessResponse; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ListSchemaRegistryClustersResponse.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ListSchemaRegistryClustersResponse.java index 4169d3530a38..74301ba7be66 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ListSchemaRegistryClustersResponse.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ListSchemaRegistryClustersResponse.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.fluent.models.SchemaRegistryClusterRecordInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Result of GET request to list schema registry clusters in the environment of a confluent organization. */ @Fluent -public final class ListSchemaRegistryClustersResponse { +public final class ListSchemaRegistryClustersResponse implements JsonSerializable { /* * List of schema registry clusters in an environment of a confluent organization */ - @JsonProperty(value = "value") private List value; /* * URL to get the next set of schema registry cluster records if there are any. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +84,46 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListSchemaRegistryClustersResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListSchemaRegistryClustersResponse if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListSchemaRegistryClustersResponse. + */ + public static ListSchemaRegistryClustersResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListSchemaRegistryClustersResponse deserializedListSchemaRegistryClustersResponse + = new ListSchemaRegistryClustersResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SchemaRegistryClusterRecordInner.fromJson(reader1)); + deserializedListSchemaRegistryClustersResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListSchemaRegistryClustersResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListSchemaRegistryClustersResponse; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/MetadataEntity.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/MetadataEntity.java index 6362ceb85a22..51434dda6698 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/MetadataEntity.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/MetadataEntity.java @@ -5,41 +5,40 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Metadata of the data record. */ @Fluent -public final class MetadataEntity { +public final class MetadataEntity implements JsonSerializable { /* * Self lookup url */ - @JsonProperty(value = "self") private String self; /* * Resource name of the record */ - @JsonProperty(value = "resource_name") private String resourceName; /* * Created Date Time */ - @JsonProperty(value = "created_at") private String createdAt; /* * Updated Date time */ - @JsonProperty(value = "updated_at") private String updatedAt; /* * Deleted Date time */ - @JsonProperty(value = "deleted_at") private String deletedAt; /** @@ -155,4 +154,52 @@ public MetadataEntity withDeletedAt(String deletedAt) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("self", this.self); + jsonWriter.writeStringField("resource_name", this.resourceName); + jsonWriter.writeStringField("created_at", this.createdAt); + jsonWriter.writeStringField("updated_at", this.updatedAt); + jsonWriter.writeStringField("deleted_at", this.deletedAt); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetadataEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetadataEntity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MetadataEntity. + */ + public static MetadataEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetadataEntity deserializedMetadataEntity = new MetadataEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("self".equals(fieldName)) { + deserializedMetadataEntity.self = reader.getString(); + } else if ("resource_name".equals(fieldName)) { + deserializedMetadataEntity.resourceName = reader.getString(); + } else if ("created_at".equals(fieldName)) { + deserializedMetadataEntity.createdAt = reader.getString(); + } else if ("updated_at".equals(fieldName)) { + deserializedMetadataEntity.updatedAt = reader.getString(); + } else if ("deleted_at".equals(fieldName)) { + deserializedMetadataEntity.deletedAt = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMetadataEntity; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OfferDetail.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OfferDetail.java index e29de12abf94..c74dd4d891ac 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OfferDetail.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OfferDetail.java @@ -6,68 +6,61 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Confluent Offer detail. */ @Fluent -public final class OfferDetail { +public final class OfferDetail implements JsonSerializable { /* * Publisher Id */ - @JsonProperty(value = "publisherId", required = true) private String publisherId; /* * Offer Id */ - @JsonProperty(value = "id", required = true) private String id; /* * Offer Plan Id */ - @JsonProperty(value = "planId", required = true) private String planId; /* * Offer Plan Name */ - @JsonProperty(value = "planName", required = true) private String planName; /* * Offer Plan Term unit */ - @JsonProperty(value = "termUnit", required = true) private String termUnit; /* * Offer Plan Term Id */ - @JsonProperty(value = "termId") private String termId; /* * Private Offer Id */ - @JsonProperty(value = "privateOfferId") private String privateOfferId; /* * Array of Private Offer Ids */ - @JsonProperty(value = "privateOfferIds") private List privateOfferIds; /* - * SaaSOfferStatus - * * SaaS Offer Status */ - @JsonProperty(value = "status") private SaaSOfferStatus status; /** @@ -237,9 +230,7 @@ public OfferDetail withPrivateOfferIds(List privateOfferIds) { } /** - * Get the status property: SaaSOfferStatus - * - * SaaS Offer Status. + * Get the status property: SaaS Offer Status. * * @return the status value. */ @@ -248,9 +239,7 @@ public SaaSOfferStatus status() { } /** - * Set the status property: SaaSOfferStatus - * - * SaaS Offer Status. + * Set the status property: SaaS Offer Status. * * @param status the status value to set. * @return the OfferDetail object itself. @@ -267,26 +256,89 @@ public OfferDetail withStatus(SaaSOfferStatus status) { */ public void validate() { if (publisherId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property publisherId in model OfferDetail")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property publisherId in model OfferDetail")); } if (id() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property id in model OfferDetail")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model OfferDetail")); } if (planId() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property planId in model OfferDetail")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property planId in model OfferDetail")); } if (planName() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property planName in model OfferDetail")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property planName in model OfferDetail")); } if (termUnit() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property termUnit in model OfferDetail")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property termUnit in model OfferDetail")); } } private static final ClientLogger LOGGER = new ClientLogger(OfferDetail.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("publisherId", this.publisherId); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("planId", this.planId); + jsonWriter.writeStringField("planName", this.planName); + jsonWriter.writeStringField("termUnit", this.termUnit); + jsonWriter.writeStringField("termId", this.termId); + jsonWriter.writeStringField("privateOfferId", this.privateOfferId); + jsonWriter.writeArrayField("privateOfferIds", this.privateOfferIds, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OfferDetail from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OfferDetail if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OfferDetail. + */ + public static OfferDetail fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OfferDetail deserializedOfferDetail = new OfferDetail(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publisherId".equals(fieldName)) { + deserializedOfferDetail.publisherId = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedOfferDetail.id = reader.getString(); + } else if ("planId".equals(fieldName)) { + deserializedOfferDetail.planId = reader.getString(); + } else if ("planName".equals(fieldName)) { + deserializedOfferDetail.planName = reader.getString(); + } else if ("termUnit".equals(fieldName)) { + deserializedOfferDetail.termUnit = reader.getString(); + } else if ("termId".equals(fieldName)) { + deserializedOfferDetail.termId = reader.getString(); + } else if ("privateOfferId".equals(fieldName)) { + deserializedOfferDetail.privateOfferId = reader.getString(); + } else if ("privateOfferIds".equals(fieldName)) { + List privateOfferIds = reader.readArray(reader1 -> reader1.getString()); + deserializedOfferDetail.privateOfferIds = privateOfferIds; + } else if ("status".equals(fieldName)) { + deserializedOfferDetail.status = SaaSOfferStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOfferDetail; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OperationDisplay.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OperationDisplay.java index fc49ba0ea986..65a9e14701ef 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OperationDisplay.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OperationDisplay.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The object that represents the operation. */ @Fluent -public final class OperationDisplay { +public final class OperationDisplay implements JsonSerializable { /* * Service provider: Microsoft.Confluent */ - @JsonProperty(value = "provider") private String provider; /* * Type on which the operation is performed, e.g., 'clusters'. */ - @JsonProperty(value = "resource") private String resource; /* * Operation type, e.g., read, write, delete, etc. */ - @JsonProperty(value = "operation") private String operation; /* * Description of the operation, e.g., 'Write confluent'. */ - @JsonProperty(value = "description") private String description; /** @@ -129,4 +129,49 @@ public OperationDisplay withDescription(String description) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provider", this.provider); + jsonWriter.writeStringField("resource", this.resource); + jsonWriter.writeStringField("operation", this.operation); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OperationListResult.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OperationListResult.java index 480aa7435236..e7b0c711acf7 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OperationListResult.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OperationListResult.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.fluent.models.OperationResultInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Result of GET request to list Confluent operations. */ @Fluent -public final class OperationListResult { +public final class OperationListResult implements JsonSerializable { /* * List of Confluent operations supported by the Microsoft.Confluent provider. */ - @JsonProperty(value = "value") private List value; /* * URL to get the next set of operation list results if there are any. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> OperationResultInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OrganizationResource.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OrganizationResource.java index f59edff6ff9f..8d63e1c9b97a 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OrganizationResource.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OrganizationResource.java @@ -66,9 +66,7 @@ public interface OrganizationResource { OffsetDateTime createdTime(); /** - * Gets the provisioningState property: ProvisioningState - * - * Provision states for confluent RP. + * Gets the provisioningState property: Provision states for confluent RP. * * @return the provisioningState value. */ diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OrganizationResourceListResult.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OrganizationResourceListResult.java index 9a8358aae8d4..d7d0cccb147b 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OrganizationResourceListResult.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OrganizationResourceListResult.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.fluent.models.OrganizationResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response of a list operation. */ @Fluent -public final class OrganizationResourceListResult { +public final class OrganizationResourceListResult implements JsonSerializable { /* * Result of a list operation. */ - @JsonProperty(value = "value") private List value; /* * Link to the next set of results, if any. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +84,46 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrganizationResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrganizationResourceListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OrganizationResourceListResult. + */ + public static OrganizationResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrganizationResourceListResult deserializedOrganizationResourceListResult + = new OrganizationResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> OrganizationResourceInner.fromJson(reader1)); + deserializedOrganizationResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOrganizationResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationResourceListResult; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OrganizationResourceUpdate.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OrganizationResourceUpdate.java index c2b9e3910eec..7d3ffba8c516 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OrganizationResourceUpdate.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OrganizationResourceUpdate.java @@ -5,20 +5,21 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** * Organization Resource update. */ @Fluent -public final class OrganizationResourceUpdate { +public final class OrganizationResourceUpdate implements JsonSerializable { /* * ARM resource tags */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** @@ -54,4 +55,41 @@ public OrganizationResourceUpdate withTags(Map tags) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrganizationResourceUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrganizationResourceUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OrganizationResourceUpdate. + */ + public static OrganizationResourceUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrganizationResourceUpdate deserializedOrganizationResourceUpdate = new OrganizationResourceUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedOrganizationResourceUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationResourceUpdate; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ProvisionState.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ProvisionState.java index b52f47d739d2..1d556fdc5f92 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ProvisionState.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ProvisionState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -74,7 +73,6 @@ public ProvisionState() { * @param name a name to look for. * @return the corresponding ProvisionState. */ - @JsonCreator public static ProvisionState fromString(String name) { return fromString(name, ProvisionState.class); } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/RegionRecord.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/RegionRecord.java index 6464be608062..5e8a493aa64f 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/RegionRecord.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/RegionRecord.java @@ -5,30 +5,31 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.confluent.fluent.models.RegionProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Details of region record. */ @Fluent -public final class RegionRecord { +public final class RegionRecord implements JsonSerializable { /* * Kind of the cluster */ - @JsonProperty(value = "kind") private String kind; /* * Id of the cluster */ - @JsonProperty(value = "id") private String id; /* * Region Properties */ - @JsonProperty(value = "properties") private RegionProperties innerProperties; /** @@ -142,4 +143,46 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegionRecord from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegionRecord if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RegionRecord. + */ + public static RegionRecord fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegionRecord deserializedRegionRecord = new RegionRecord(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedRegionRecord.kind = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedRegionRecord.id = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRegionRecord.innerProperties = RegionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRegionRecord; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/RegionSpecEntity.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/RegionSpecEntity.java index 0572837a4335..88a0cb210d5a 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/RegionSpecEntity.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/RegionSpecEntity.java @@ -5,36 +5,36 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Region spec details. */ @Fluent -public final class RegionSpecEntity { +public final class RegionSpecEntity implements JsonSerializable { /* * Display Name of the region */ - @JsonProperty(value = "name") private String name; /* * Cloud provider name */ - @JsonProperty(value = "cloud") private String cloud; /* * Region name */ - @JsonProperty(value = "regionName") private String regionName; /* * The packages property. */ - @JsonProperty(value = "packages") private List packages; /** @@ -130,4 +130,50 @@ public RegionSpecEntity withPackages(List packages) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("cloud", this.cloud); + jsonWriter.writeStringField("regionName", this.regionName); + jsonWriter.writeArrayField("packages", this.packages, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegionSpecEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegionSpecEntity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RegionSpecEntity. + */ + public static RegionSpecEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegionSpecEntity deserializedRegionSpecEntity = new RegionSpecEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedRegionSpecEntity.name = reader.getString(); + } else if ("cloud".equals(fieldName)) { + deserializedRegionSpecEntity.cloud = reader.getString(); + } else if ("regionName".equals(fieldName)) { + deserializedRegionSpecEntity.regionName = reader.getString(); + } else if ("packages".equals(fieldName)) { + List packages = reader.readArray(reader1 -> reader1.getString()); + deserializedRegionSpecEntity.packages = packages; + } else { + reader.skipChildren(); + } + } + + return deserializedRegionSpecEntity; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/RoleBindingRecord.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/RoleBindingRecord.java index 4fe3ef81162d..4756fca55321 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/RoleBindingRecord.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/RoleBindingRecord.java @@ -5,47 +5,45 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Details on principal, role name and crn pattern of a role binding. */ @Fluent -public final class RoleBindingRecord { +public final class RoleBindingRecord implements JsonSerializable { /* * The type of the resource. */ - @JsonProperty(value = "kind") private String kind; /* * Id of the role binding */ - @JsonProperty(value = "id") private String id; /* * Metadata of the record */ - @JsonProperty(value = "metadata") private MetadataEntity metadata; /* * The principal User or Group to bind the role to */ - @JsonProperty(value = "principal") private String principal; /* * The name of the role to bind to the principal */ - @JsonProperty(value = "role_name") private String roleName; /* * A CRN that specifies the scope and resource patterns necessary for the role to bind */ - @JsonProperty(value = "crn_pattern") private String crnPattern; /** @@ -155,8 +153,7 @@ public RoleBindingRecord withRoleName(String roleName) { } /** - * Get the crnPattern property: A CRN that specifies the scope and resource patterns necessary for the role to - * bind. + * Get the crnPattern property: A CRN that specifies the scope and resource patterns necessary for the role to bind. * * @return the crnPattern value. */ @@ -165,8 +162,7 @@ public String crnPattern() { } /** - * Set the crnPattern property: A CRN that specifies the scope and resource patterns necessary for the role to - * bind. + * Set the crnPattern property: A CRN that specifies the scope and resource patterns necessary for the role to bind. * * @param crnPattern the crnPattern value to set. * @return the RoleBindingRecord object itself. @@ -186,4 +182,55 @@ public void validate() { metadata().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("metadata", this.metadata); + jsonWriter.writeStringField("principal", this.principal); + jsonWriter.writeStringField("role_name", this.roleName); + jsonWriter.writeStringField("crn_pattern", this.crnPattern); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoleBindingRecord from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoleBindingRecord if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RoleBindingRecord. + */ + public static RoleBindingRecord fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoleBindingRecord deserializedRoleBindingRecord = new RoleBindingRecord(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedRoleBindingRecord.kind = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedRoleBindingRecord.id = reader.getString(); + } else if ("metadata".equals(fieldName)) { + deserializedRoleBindingRecord.metadata = MetadataEntity.fromJson(reader); + } else if ("principal".equals(fieldName)) { + deserializedRoleBindingRecord.principal = reader.getString(); + } else if ("role_name".equals(fieldName)) { + deserializedRoleBindingRecord.roleName = reader.getString(); + } else if ("crn_pattern".equals(fieldName)) { + deserializedRoleBindingRecord.crnPattern = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRoleBindingRecord; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SCClusterByokEntity.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SCClusterByokEntity.java index 32a6536074b7..9285585f5e75 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SCClusterByokEntity.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SCClusterByokEntity.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The network associated with this object. */ @Fluent -public final class SCClusterByokEntity { +public final class SCClusterByokEntity implements JsonSerializable { /* * ID of the referred resource */ - @JsonProperty(value = "id") private String id; /* * API URL for accessing or modifying the referred object */ - @JsonProperty(value = "related") private String related; /* * CRN reference to the referred resource */ - @JsonProperty(value = "resourceName") private String resourceName; /** @@ -103,4 +104,46 @@ public SCClusterByokEntity withResourceName(String resourceName) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("related", this.related); + jsonWriter.writeStringField("resourceName", this.resourceName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SCClusterByokEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SCClusterByokEntity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SCClusterByokEntity. + */ + public static SCClusterByokEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SCClusterByokEntity deserializedSCClusterByokEntity = new SCClusterByokEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSCClusterByokEntity.id = reader.getString(); + } else if ("related".equals(fieldName)) { + deserializedSCClusterByokEntity.related = reader.getString(); + } else if ("resourceName".equals(fieldName)) { + deserializedSCClusterByokEntity.resourceName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSCClusterByokEntity; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SCClusterNetworkEnvironmentEntity.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SCClusterNetworkEnvironmentEntity.java index 855f37875964..4a4d88948b12 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SCClusterNetworkEnvironmentEntity.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SCClusterNetworkEnvironmentEntity.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The environment or the network to which cluster belongs. */ @Fluent -public final class SCClusterNetworkEnvironmentEntity { +public final class SCClusterNetworkEnvironmentEntity implements JsonSerializable { /* * ID of the referred resource */ - @JsonProperty(value = "id") private String id; /* * Environment of the referred resource */ - @JsonProperty(value = "environment") private String environment; /* * API URL for accessing or modifying the referred object */ - @JsonProperty(value = "related") private String related; /* * CRN reference to the referred resource */ - @JsonProperty(value = "resourceName") private String resourceName; /** @@ -129,4 +129,50 @@ public SCClusterNetworkEnvironmentEntity withResourceName(String resourceName) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("environment", this.environment); + jsonWriter.writeStringField("related", this.related); + jsonWriter.writeStringField("resourceName", this.resourceName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SCClusterNetworkEnvironmentEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SCClusterNetworkEnvironmentEntity if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SCClusterNetworkEnvironmentEntity. + */ + public static SCClusterNetworkEnvironmentEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SCClusterNetworkEnvironmentEntity deserializedSCClusterNetworkEnvironmentEntity + = new SCClusterNetworkEnvironmentEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSCClusterNetworkEnvironmentEntity.id = reader.getString(); + } else if ("environment".equals(fieldName)) { + deserializedSCClusterNetworkEnvironmentEntity.environment = reader.getString(); + } else if ("related".equals(fieldName)) { + deserializedSCClusterNetworkEnvironmentEntity.related = reader.getString(); + } else if ("resourceName".equals(fieldName)) { + deserializedSCClusterNetworkEnvironmentEntity.resourceName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSCClusterNetworkEnvironmentEntity; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SCClusterSpecEntity.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SCClusterSpecEntity.java index 670a15e22545..8c789f7418ae 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SCClusterSpecEntity.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SCClusterSpecEntity.java @@ -5,83 +5,75 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Spec of the cluster record. */ @Fluent -public final class SCClusterSpecEntity { +public final class SCClusterSpecEntity implements JsonSerializable { /* * The name of the cluster */ - @JsonProperty(value = "name") private String name; /* * The availability zone configuration of the cluster */ - @JsonProperty(value = "availability") private String availability; /* * The cloud service provider */ - @JsonProperty(value = "cloud") private String cloud; /* * type of zone availability */ - @JsonProperty(value = "zone") private String zone; /* * The cloud service provider region */ - @JsonProperty(value = "region") private String region; /* * The bootstrap endpoint used by Kafka clients to connect to the cluster */ - @JsonProperty(value = "kafkaBootstrapEndpoint") private String kafkaBootstrapEndpoint; /* * The cluster HTTP request URL. */ - @JsonProperty(value = "httpEndpoint") private String httpEndpoint; /* * The Kafka API cluster endpoint */ - @JsonProperty(value = "apiEndpoint") private String apiEndpoint; /* * Specification of the cluster configuration */ - @JsonProperty(value = "config") private ClusterConfigEntity config; /* * Specification of the cluster environment */ - @JsonProperty(value = "environment") private SCClusterNetworkEnvironmentEntity environment; /* * Specification of the cluster network */ - @JsonProperty(value = "network") private SCClusterNetworkEnvironmentEntity network; /* * Specification of the cluster byok */ - @JsonProperty(value = "byok") private SCClusterByokEntity byok; /** @@ -349,4 +341,73 @@ public void validate() { byok().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("availability", this.availability); + jsonWriter.writeStringField("cloud", this.cloud); + jsonWriter.writeStringField("zone", this.zone); + jsonWriter.writeStringField("region", this.region); + jsonWriter.writeStringField("kafkaBootstrapEndpoint", this.kafkaBootstrapEndpoint); + jsonWriter.writeStringField("httpEndpoint", this.httpEndpoint); + jsonWriter.writeStringField("apiEndpoint", this.apiEndpoint); + jsonWriter.writeJsonField("config", this.config); + jsonWriter.writeJsonField("environment", this.environment); + jsonWriter.writeJsonField("network", this.network); + jsonWriter.writeJsonField("byok", this.byok); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SCClusterSpecEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SCClusterSpecEntity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SCClusterSpecEntity. + */ + public static SCClusterSpecEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SCClusterSpecEntity deserializedSCClusterSpecEntity = new SCClusterSpecEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSCClusterSpecEntity.name = reader.getString(); + } else if ("availability".equals(fieldName)) { + deserializedSCClusterSpecEntity.availability = reader.getString(); + } else if ("cloud".equals(fieldName)) { + deserializedSCClusterSpecEntity.cloud = reader.getString(); + } else if ("zone".equals(fieldName)) { + deserializedSCClusterSpecEntity.zone = reader.getString(); + } else if ("region".equals(fieldName)) { + deserializedSCClusterSpecEntity.region = reader.getString(); + } else if ("kafkaBootstrapEndpoint".equals(fieldName)) { + deserializedSCClusterSpecEntity.kafkaBootstrapEndpoint = reader.getString(); + } else if ("httpEndpoint".equals(fieldName)) { + deserializedSCClusterSpecEntity.httpEndpoint = reader.getString(); + } else if ("apiEndpoint".equals(fieldName)) { + deserializedSCClusterSpecEntity.apiEndpoint = reader.getString(); + } else if ("config".equals(fieldName)) { + deserializedSCClusterSpecEntity.config = ClusterConfigEntity.fromJson(reader); + } else if ("environment".equals(fieldName)) { + deserializedSCClusterSpecEntity.environment = SCClusterNetworkEnvironmentEntity.fromJson(reader); + } else if ("network".equals(fieldName)) { + deserializedSCClusterSpecEntity.network = SCClusterNetworkEnvironmentEntity.fromJson(reader); + } else if ("byok".equals(fieldName)) { + deserializedSCClusterSpecEntity.byok = SCClusterByokEntity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSCClusterSpecEntity; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SCMetadataEntity.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SCMetadataEntity.java index 3fe85ea220a8..1c7e76ed762a 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SCMetadataEntity.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SCMetadataEntity.java @@ -5,41 +5,40 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Metadata of the data record. */ @Fluent -public final class SCMetadataEntity { +public final class SCMetadataEntity implements JsonSerializable { /* * Self lookup url */ - @JsonProperty(value = "self") private String self; /* * Resource name of the record */ - @JsonProperty(value = "resourceName") private String resourceName; /* * Created Date Time */ - @JsonProperty(value = "createdTimestamp") private String createdTimestamp; /* * Updated Date time */ - @JsonProperty(value = "updatedTimestamp") private String updatedTimestamp; /* * Deleted Date time */ - @JsonProperty(value = "deletedTimestamp") private String deletedTimestamp; /** @@ -155,4 +154,52 @@ public SCMetadataEntity withDeletedTimestamp(String deletedTimestamp) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("self", this.self); + jsonWriter.writeStringField("resourceName", this.resourceName); + jsonWriter.writeStringField("createdTimestamp", this.createdTimestamp); + jsonWriter.writeStringField("updatedTimestamp", this.updatedTimestamp); + jsonWriter.writeStringField("deletedTimestamp", this.deletedTimestamp); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SCMetadataEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SCMetadataEntity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SCMetadataEntity. + */ + public static SCMetadataEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SCMetadataEntity deserializedSCMetadataEntity = new SCMetadataEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("self".equals(fieldName)) { + deserializedSCMetadataEntity.self = reader.getString(); + } else if ("resourceName".equals(fieldName)) { + deserializedSCMetadataEntity.resourceName = reader.getString(); + } else if ("createdTimestamp".equals(fieldName)) { + deserializedSCMetadataEntity.createdTimestamp = reader.getString(); + } else if ("updatedTimestamp".equals(fieldName)) { + deserializedSCMetadataEntity.updatedTimestamp = reader.getString(); + } else if ("deletedTimestamp".equals(fieldName)) { + deserializedSCMetadataEntity.deletedTimestamp = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSCMetadataEntity; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SaaSOfferStatus.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SaaSOfferStatus.java index c1e9a47df6f8..b3701c161b8b 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SaaSOfferStatus.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SaaSOfferStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -79,7 +78,6 @@ public SaaSOfferStatus() { * @param name a name to look for. * @return the corresponding SaaSOfferStatus. */ - @JsonCreator public static SaaSOfferStatus fromString(String name) { return fromString(name, SaaSOfferStatus.class); } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SchemaRegistryClusterEnvironmentRegionEntity.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SchemaRegistryClusterEnvironmentRegionEntity.java index cde7276bbcc3..d6ed3569ea68 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SchemaRegistryClusterEnvironmentRegionEntity.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SchemaRegistryClusterEnvironmentRegionEntity.java @@ -5,29 +5,31 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The environment associated with this object. */ @Fluent -public final class SchemaRegistryClusterEnvironmentRegionEntity { +public final class SchemaRegistryClusterEnvironmentRegionEntity + implements JsonSerializable { /* * ID of the referred resource */ - @JsonProperty(value = "id") private String id; /* * API URL for accessing or modifying the referred object */ - @JsonProperty(value = "related") private String related; /* * CRN reference to the referred resource */ - @JsonProperty(value = "resourceName") private String resourceName; /** @@ -103,4 +105,47 @@ public SchemaRegistryClusterEnvironmentRegionEntity withResourceName(String reso */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("related", this.related); + jsonWriter.writeStringField("resourceName", this.resourceName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SchemaRegistryClusterEnvironmentRegionEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SchemaRegistryClusterEnvironmentRegionEntity if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SchemaRegistryClusterEnvironmentRegionEntity. + */ + public static SchemaRegistryClusterEnvironmentRegionEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SchemaRegistryClusterEnvironmentRegionEntity deserializedSchemaRegistryClusterEnvironmentRegionEntity + = new SchemaRegistryClusterEnvironmentRegionEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSchemaRegistryClusterEnvironmentRegionEntity.id = reader.getString(); + } else if ("related".equals(fieldName)) { + deserializedSchemaRegistryClusterEnvironmentRegionEntity.related = reader.getString(); + } else if ("resourceName".equals(fieldName)) { + deserializedSchemaRegistryClusterEnvironmentRegionEntity.resourceName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSchemaRegistryClusterEnvironmentRegionEntity; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SchemaRegistryClusterSpecEntity.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SchemaRegistryClusterSpecEntity.java index d5344cfd11e9..cfe311f61186 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SchemaRegistryClusterSpecEntity.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SchemaRegistryClusterSpecEntity.java @@ -5,47 +5,45 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Details of schema registry cluster spec. */ @Fluent -public final class SchemaRegistryClusterSpecEntity { +public final class SchemaRegistryClusterSpecEntity implements JsonSerializable { /* * Name of the schema registry cluster */ - @JsonProperty(value = "name") private String name; /* * Http endpoint of the cluster */ - @JsonProperty(value = "httpEndpoint") private String httpEndpoint; /* * Type of the cluster package Advanced, essentials */ - @JsonProperty(value = "package") private String packageProperty; /* * Region details of the schema registry cluster */ - @JsonProperty(value = "region") private SchemaRegistryClusterEnvironmentRegionEntity region; /* * Environment details of the schema registry cluster */ - @JsonProperty(value = "environment") private SchemaRegistryClusterEnvironmentRegionEntity environment; /* * The cloud service provider */ - @JsonProperty(value = "cloud") private String cloud; /** @@ -187,4 +185,58 @@ public void validate() { environment().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("httpEndpoint", this.httpEndpoint); + jsonWriter.writeStringField("package", this.packageProperty); + jsonWriter.writeJsonField("region", this.region); + jsonWriter.writeJsonField("environment", this.environment); + jsonWriter.writeStringField("cloud", this.cloud); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SchemaRegistryClusterSpecEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SchemaRegistryClusterSpecEntity if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SchemaRegistryClusterSpecEntity. + */ + public static SchemaRegistryClusterSpecEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SchemaRegistryClusterSpecEntity deserializedSchemaRegistryClusterSpecEntity + = new SchemaRegistryClusterSpecEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSchemaRegistryClusterSpecEntity.name = reader.getString(); + } else if ("httpEndpoint".equals(fieldName)) { + deserializedSchemaRegistryClusterSpecEntity.httpEndpoint = reader.getString(); + } else if ("package".equals(fieldName)) { + deserializedSchemaRegistryClusterSpecEntity.packageProperty = reader.getString(); + } else if ("region".equals(fieldName)) { + deserializedSchemaRegistryClusterSpecEntity.region + = SchemaRegistryClusterEnvironmentRegionEntity.fromJson(reader); + } else if ("environment".equals(fieldName)) { + deserializedSchemaRegistryClusterSpecEntity.environment + = SchemaRegistryClusterEnvironmentRegionEntity.fromJson(reader); + } else if ("cloud".equals(fieldName)) { + deserializedSchemaRegistryClusterSpecEntity.cloud = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSchemaRegistryClusterSpecEntity; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SchemaRegistryClusterStatusEntity.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SchemaRegistryClusterStatusEntity.java index bb38ca321ba0..f1c1b80010c1 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SchemaRegistryClusterStatusEntity.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/SchemaRegistryClusterStatusEntity.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Status of the schema registry cluster record. */ @Fluent -public final class SchemaRegistryClusterStatusEntity { +public final class SchemaRegistryClusterStatusEntity implements JsonSerializable { /* * The lifecycle phase of the cluster */ - @JsonProperty(value = "phase") private String phase; /** @@ -51,4 +54,41 @@ public SchemaRegistryClusterStatusEntity withPhase(String phase) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("phase", this.phase); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SchemaRegistryClusterStatusEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SchemaRegistryClusterStatusEntity if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SchemaRegistryClusterStatusEntity. + */ + public static SchemaRegistryClusterStatusEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SchemaRegistryClusterStatusEntity deserializedSchemaRegistryClusterStatusEntity + = new SchemaRegistryClusterStatusEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("phase".equals(fieldName)) { + deserializedSchemaRegistryClusterStatusEntity.phase = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSchemaRegistryClusterStatusEntity; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ServiceAccountRecord.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ServiceAccountRecord.java index bd5e7b5cb5c2..79cdfc8fef1d 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ServiceAccountRecord.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/ServiceAccountRecord.java @@ -5,41 +5,40 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Record of the service account. */ @Fluent -public final class ServiceAccountRecord { +public final class ServiceAccountRecord implements JsonSerializable { /* * Type of account */ - @JsonProperty(value = "kind") private String kind; /* * Id of the service account */ - @JsonProperty(value = "id") private String id; /* * Metadata of the record */ - @JsonProperty(value = "metadata") private MetadataEntity metadata; /* * Name of the service account */ - @JsonProperty(value = "display_name") private String displayName; /* * Description of the service account */ - @JsonProperty(value = "description") private String description; /** @@ -158,4 +157,52 @@ public void validate() { metadata().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("metadata", this.metadata); + jsonWriter.writeStringField("display_name", this.displayName); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceAccountRecord from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceAccountRecord if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceAccountRecord. + */ + public static ServiceAccountRecord fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceAccountRecord deserializedServiceAccountRecord = new ServiceAccountRecord(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedServiceAccountRecord.kind = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedServiceAccountRecord.id = reader.getString(); + } else if ("metadata".equals(fieldName)) { + deserializedServiceAccountRecord.metadata = MetadataEntity.fromJson(reader); + } else if ("display_name".equals(fieldName)) { + deserializedServiceAccountRecord.displayName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedServiceAccountRecord.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceAccountRecord; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/UserDetail.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/UserDetail.java index aaa4b4f3cb30..bfba59273b8f 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/UserDetail.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/UserDetail.java @@ -6,41 +6,40 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Subscriber detail. */ @Fluent -public final class UserDetail { +public final class UserDetail implements JsonSerializable { /* * First name */ - @JsonProperty(value = "firstName") private String firstName; /* * Last name */ - @JsonProperty(value = "lastName") private String lastName; /* * Email address */ - @JsonProperty(value = "emailAddress", required = true) private String emailAddress; /* * User principal name */ - @JsonProperty(value = "userPrincipalName") private String userPrincipalName; /* * AAD email address */ - @JsonProperty(value = "aadEmail") private String aadEmail; /** @@ -156,10 +155,59 @@ public UserDetail withAadEmail(String aadEmail) { */ public void validate() { if (emailAddress() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property emailAddress in model UserDetail")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property emailAddress in model UserDetail")); } } private static final ClientLogger LOGGER = new ClientLogger(UserDetail.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("emailAddress", this.emailAddress); + jsonWriter.writeStringField("firstName", this.firstName); + jsonWriter.writeStringField("lastName", this.lastName); + jsonWriter.writeStringField("userPrincipalName", this.userPrincipalName); + jsonWriter.writeStringField("aadEmail", this.aadEmail); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserDetail from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserDetail if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UserDetail. + */ + public static UserDetail fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserDetail deserializedUserDetail = new UserDetail(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("emailAddress".equals(fieldName)) { + deserializedUserDetail.emailAddress = reader.getString(); + } else if ("firstName".equals(fieldName)) { + deserializedUserDetail.firstName = reader.getString(); + } else if ("lastName".equals(fieldName)) { + deserializedUserDetail.lastName = reader.getString(); + } else if ("userPrincipalName".equals(fieldName)) { + deserializedUserDetail.userPrincipalName = reader.getString(); + } else if ("aadEmail".equals(fieldName)) { + deserializedUserDetail.aadEmail = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserDetail; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/UserRecord.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/UserRecord.java index faab0371e50a..a67061ecae16 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/UserRecord.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/UserRecord.java @@ -5,47 +5,45 @@ package com.azure.resourcemanager.confluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Record of the user. */ @Fluent -public final class UserRecord { +public final class UserRecord implements JsonSerializable { /* * Type of account */ - @JsonProperty(value = "kind") private String kind; /* * Id of the user */ - @JsonProperty(value = "id") private String id; /* * Metadata of the record */ - @JsonProperty(value = "metadata") private MetadataEntity metadata; /* * Email of the user */ - @JsonProperty(value = "email") private String email; /* * Name of the user */ - @JsonProperty(value = "full_name") private String fullName; /* * Auth type of the user */ - @JsonProperty(value = "auth_type") private String authType; /** @@ -184,4 +182,55 @@ public void validate() { metadata().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("metadata", this.metadata); + jsonWriter.writeStringField("email", this.email); + jsonWriter.writeStringField("full_name", this.fullName); + jsonWriter.writeStringField("auth_type", this.authType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserRecord from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserRecord if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the UserRecord. + */ + public static UserRecord fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserRecord deserializedUserRecord = new UserRecord(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedUserRecord.kind = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedUserRecord.id = reader.getString(); + } else if ("metadata".equals(fieldName)) { + deserializedUserRecord.metadata = MetadataEntity.fromJson(reader); + } else if ("email".equals(fieldName)) { + deserializedUserRecord.email = reader.getString(); + } else if ("full_name".equals(fieldName)) { + deserializedUserRecord.fullName = reader.getString(); + } else if ("auth_type".equals(fieldName)) { + deserializedUserRecord.authType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserRecord; + }); + } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/module-info.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/module-info.java index 074b073bf483..cd98e2d6cfd1 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/module-info.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/module-info.java @@ -10,6 +10,6 @@ exports com.azure.resourcemanager.confluent.fluent.models; exports com.azure.resourcemanager.confluent.models; - opens com.azure.resourcemanager.confluent.fluent.models to com.azure.core, com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.confluent.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.confluent.fluent.models to com.azure.core; + opens com.azure.resourcemanager.confluent.models to com.azure.core; } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-confluent/proxy-config.json b/sdk/confluent/azure-resourcemanager-confluent/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-confluent/proxy-config.json index d8adab1b09c7..3e4e90690b77 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-confluent/proxy-config.json +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-confluent/proxy-config.json @@ -1 +1 @@ -[ [ "com.azure.resourcemanager.confluent.implementation.MarketplaceAgreementsClientImpl$MarketplaceAgreementsService" ], [ "com.azure.resourcemanager.confluent.implementation.OrganizationOperationsClientImpl$OrganizationOperationsService" ], [ "com.azure.resourcemanager.confluent.implementation.OrganizationsClientImpl$OrganizationsService" ], [ "com.azure.resourcemanager.confluent.implementation.ValidationsClientImpl$ValidationsService" ], [ "com.azure.resourcemanager.confluent.implementation.AccessClientImpl$AccessService" ] ] \ No newline at end of file +[["com.azure.resourcemanager.confluent.implementation.AccessClientImpl$AccessService"],["com.azure.resourcemanager.confluent.implementation.MarketplaceAgreementsClientImpl$MarketplaceAgreementsService"],["com.azure.resourcemanager.confluent.implementation.OrganizationOperationsClientImpl$OrganizationOperationsService"],["com.azure.resourcemanager.confluent.implementation.OrganizationsClientImpl$OrganizationsService"],["com.azure.resourcemanager.confluent.implementation.ValidationsClientImpl$ValidationsService"]] \ No newline at end of file diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-confluent/reflect-config.json b/sdk/confluent/azure-resourcemanager-confluent/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-confluent/reflect-config.json index 5147677cd0f5..0637a088a01e 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-confluent/reflect-config.json +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-confluent/reflect-config.json @@ -1,336 +1 @@ -[ { - "name" : "com.azure.resourcemanager.confluent.models.ConfluentAgreementResourceListResponse", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.ConfluentAgreementResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.ConfluentAgreementProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.OperationListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.OperationResultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.OperationDisplay", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.OrganizationResourceListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.OrganizationResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.OrganizationResourceProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.OfferDetail", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.UserDetail", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.LinkOrganization", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.OrganizationResourceUpdate", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.ValidationResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.ListAccessRequestModel", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.AccessListUsersSuccessResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.ConfluentListMetadata", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.UserRecord", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.MetadataEntity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.AccessListServiceAccountsSuccessResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.ServiceAccountRecord", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.AccessListInvitationsSuccessResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.InvitationRecordInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.AccessInviteUserAccountModel", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.AccessInvitedUserDetails", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.AccessListEnvironmentsSuccessResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.EnvironmentRecord", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.AccessListClusterSuccessResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.ClusterRecord", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.ClusterSpecEntity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.ClusterConfigEntity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.ClusterEnvironmentEntity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.ClusterNetworkEntity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.ClusterByokEntity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.ClusterStatusEntity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.AccessListRoleBindingsSuccessResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.RoleBindingRecord", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.AccessCreateRoleBindingRequestModel", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.AccessRoleBindingNameListSuccessResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.GetEnvironmentsResponse", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.SCEnvironmentRecordInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.EnvironmentProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.SCMetadataEntity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.ListClustersSuccessResponse", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.SCClusterRecordInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.ClusterProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.SCClusterSpecEntity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.SCClusterNetworkEnvironmentEntity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.SCClusterByokEntity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.ListSchemaRegistryClustersResponse", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.SchemaRegistryClusterRecordInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.SchemaRegistryClusterProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.SchemaRegistryClusterSpecEntity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.SchemaRegistryClusterEnvironmentRegionEntity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.SchemaRegistryClusterStatusEntity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.ListRegionsSuccessResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.RegionRecord", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.RegionProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.RegionSpecEntity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.CreateApiKeyModel", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.ApiKeyRecordInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.fluent.models.ApiKeyProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.ApiKeySpecEntity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.ApiKeyResourceEntity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.ApiKeyOwnerEntity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.ProvisionState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.confluent.models.SaaSOfferStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -} ] \ No newline at end of file +[] \ No newline at end of file diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessCreateRoleBindingSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessCreateRoleBindingSamples.java index bfa10615dcbf..124a79b04912 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessCreateRoleBindingSamples.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessCreateRoleBindingSamples.java @@ -21,10 +21,12 @@ public final class AccessCreateRoleBindingSamples { * @param manager Entry point to ConfluentManager. */ public static void accessCreateRoleBinding(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.access().createRoleBindingWithResponse("myResourceGroup", "myOrganization", - new AccessCreateRoleBindingRequestModel().withPrincipal("User:u-111aaa").withRoleName("CloudClusterAdmin") - .withCrnPattern( - "crn://confluent.cloud/organization=1111aaaa-11aa-11aa-11aa-111111aaaaaa/environment=env-aaa1111/cloud-cluster=lkc-1111aaa"), - com.azure.core.util.Context.NONE); + manager.access() + .createRoleBindingWithResponse("myResourceGroup", "myOrganization", + new AccessCreateRoleBindingRequestModel().withPrincipal("User:u-111aaa") + .withRoleName("CloudClusterAdmin") + .withCrnPattern( + "crn://confluent.cloud/organization=1111aaaa-11aa-11aa-11aa-111111aaaaaa/environment=env-aaa1111/cloud-cluster=lkc-1111aaa"), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessDeleteRoleBindingSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessDeleteRoleBindingSamples.java index 74795c258418..97c723ddc5e2 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessDeleteRoleBindingSamples.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessDeleteRoleBindingSamples.java @@ -19,7 +19,8 @@ public final class AccessDeleteRoleBindingSamples { * @param manager Entry point to ConfluentManager. */ public static void accessDeleteRoleBinding(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.access().deleteRoleBindingWithResponse("myResourceGroup", "myOrganization", "dlz-f3a90de", - com.azure.core.util.Context.NONE); + manager.access() + .deleteRoleBindingWithResponse("myResourceGroup", "myOrganization", "dlz-f3a90de", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessInviteUserSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessInviteUserSamples.java index 4753851e4755..91f23f9fbf41 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessInviteUserSamples.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessInviteUserSamples.java @@ -21,9 +21,11 @@ public final class AccessInviteUserSamples { * @param manager Entry point to ConfluentManager. */ public static void accessInviteUser(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.access().inviteUserWithResponse("myResourceGroup", "myOrganization", - new AccessInviteUserAccountModel().withInvitedUserDetails( - new AccessInvitedUserDetails().withInvitedEmail("user2@onmicrosoft.com").withAuthType("AUTH_TYPE_SSO")), - com.azure.core.util.Context.NONE); + manager.access() + .inviteUserWithResponse("myResourceGroup", "myOrganization", + new AccessInviteUserAccountModel() + .withInvitedUserDetails(new AccessInvitedUserDetails().withInvitedEmail("user2@onmicrosoft.com") + .withAuthType("AUTH_TYPE_SSO")), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessListInvitationsSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessListInvitationsSamples.java index 1aab342a80cb..65df73bd6fd2 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessListInvitationsSamples.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessListInvitationsSamples.java @@ -23,10 +23,11 @@ public final class AccessListInvitationsSamples { * @param manager Entry point to ConfluentManager. */ public static void accessInvitationsList(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.access().listInvitationsWithResponse("myResourceGroup", "myOrganization", - new ListAccessRequestModel().withSearchFilters( - mapOf("pageSize", "10", "pageToken", "fakeTokenPlaceholder", "status", "INVITE_STATUS_SENT")), - com.azure.core.util.Context.NONE); + manager.access() + .listInvitationsWithResponse("myResourceGroup", "myOrganization", + new ListAccessRequestModel().withSearchFilters( + mapOf("pageSize", "10", "pageToken", "fakeTokenPlaceholder", "status", "INVITE_STATUS_SENT")), + com.azure.core.util.Context.NONE); } // Use "Map.of" if available diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessListRoleBindingNameListSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessListRoleBindingNameListSamples.java index 71c9f3406811..b235496e934a 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessListRoleBindingNameListSamples.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessListRoleBindingNameListSamples.java @@ -22,11 +22,12 @@ public final class AccessListRoleBindingNameListSamples { * @param manager Entry point to ConfluentManager. */ public static void accessRoleBindingNameList(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.access().listRoleBindingNameListWithResponse("myResourceGroup", "myOrganization", - new ListAccessRequestModel().withSearchFilters(mapOf("crn_pattern", - "crn://confluent.cloud/organization=1aa7de07-298e-479c-8f2f-16ac91fd8e76", "namespace", - "public,dataplane,networking,identity,datagovernance,connect,streamcatalog,pipelines,ksql")), - com.azure.core.util.Context.NONE); + manager.access() + .listRoleBindingNameListWithResponse("myResourceGroup", "myOrganization", + new ListAccessRequestModel().withSearchFilters(mapOf("crn_pattern", + "crn://confluent.cloud/organization=1aa7de07-298e-479c-8f2f-16ac91fd8e76", "namespace", + "public,dataplane,networking,identity,datagovernance,connect,streamcatalog,pipelines,ksql")), + com.azure.core.util.Context.NONE); } // Use "Map.of" if available diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessListUsersSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessListUsersSamples.java index af9dda39484c..a40203e1678f 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessListUsersSamples.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/AccessListUsersSamples.java @@ -22,9 +22,9 @@ public final class AccessListUsersSamples { * @param manager Entry point to ConfluentManager. */ public static void accessUsersList(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.access().listUsersWithResponse("myResourceGroup", "myOrganization", new ListAccessRequestModel() - .withSearchFilters(mapOf("pageSize", "10", "pageToken", "fakeTokenPlaceholder")), - com.azure.core.util.Context.NONE); + manager.access() + .listUsersWithResponse("myResourceGroup", "myOrganization", new ListAccessRequestModel().withSearchFilters( + mapOf("pageSize", "10", "pageToken", "fakeTokenPlaceholder")), com.azure.core.util.Context.NONE); } // Use "Map.of" if available diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationCreateApiKeySamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationCreateApiKeySamples.java index 4f0cdcfeb38f..428b75e277f7 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationCreateApiKeySamples.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationCreateApiKeySamples.java @@ -20,9 +20,10 @@ public final class OrganizationCreateApiKeySamples { * @param manager Entry point to ConfluentManager. */ public static void organizationCreateAPIKey(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().createApiKeyWithResponse( - "myResourceGroup", "myOrganization", "env-12132", "clusterId-123", new CreateApiKeyModel() - .withName("CI kafka access key").withDescription("This API key provides kafka access to cluster x"), - com.azure.core.util.Context.NONE); + manager.organizations() + .createApiKeyWithResponse("myResourceGroup", "myOrganization", "env-12132", "clusterId-123", + new CreateApiKeyModel().withName("CI kafka access key") + .withDescription("This API key provides kafka access to cluster x"), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationCreateSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationCreateSamples.java index 99e4bf3b260f..1e5159a5b5b9 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationCreateSamples.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationCreateSamples.java @@ -25,16 +25,25 @@ public final class OrganizationCreateSamples { * @param manager Entry point to ConfluentManager. */ public static void organizationCreate(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().define("myOrganization").withRegion("West US") + manager.organizations() + .define("myOrganization") + .withRegion("West US") .withExistingResourceGroup("myResourceGroup") - .withOfferDetail( - new OfferDetail().withPublisherId("string").withId("string").withPlanId("string").withPlanName("string") - .withTermUnit("string").withPrivateOfferId("string").withPrivateOfferIds(Arrays.asList("string"))) - .withUserDetail(new UserDetail().withFirstName("string").withLastName("string") - .withEmailAddress("contoso@microsoft.com").withUserPrincipalName("contoso@microsoft.com") + .withOfferDetail(new OfferDetail().withPublisherId("string") + .withId("string") + .withPlanId("string") + .withPlanName("string") + .withTermUnit("string") + .withPrivateOfferId("string") + .withPrivateOfferIds(Arrays.asList("string"))) + .withUserDetail(new UserDetail().withFirstName("string") + .withLastName("string") + .withEmailAddress("contoso@microsoft.com") + .withUserPrincipalName("contoso@microsoft.com") .withAadEmail("contoso@microsoft.com")) .withTags(mapOf("Environment", "Dev")) - .withLinkOrganization(new LinkOrganization().withToken("fakeTokenPlaceholder")).create(); + .withLinkOrganization(new LinkOrganization().withToken("fakeTokenPlaceholder")) + .create(); } // Use "Map.of" if available diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationDeleteClusterApiKeySamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationDeleteClusterApiKeySamples.java index 8c2177861320..1f74af37e523 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationDeleteClusterApiKeySamples.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationDeleteClusterApiKeySamples.java @@ -18,7 +18,8 @@ public final class OrganizationDeleteClusterApiKeySamples { * @param manager Entry point to ConfluentManager. */ public static void organizationDeleteClusterAPIKey(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().deleteClusterApiKeyWithResponse("myResourceGroup", "myOrganization", "ZFZ6SZZZWGYBEIFB", - com.azure.core.util.Context.NONE); + manager.organizations() + .deleteClusterApiKeyWithResponse("myResourceGroup", "myOrganization", "ZFZ6SZZZWGYBEIFB", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetByResourceGroupSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetByResourceGroupSamples.java index fe40b7424636..3dcfffb7ee9d 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetByResourceGroupSamples.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetByResourceGroupSamples.java @@ -18,7 +18,7 @@ public final class OrganizationGetByResourceGroupSamples { * @param manager Entry point to ConfluentManager. */ public static void organizationGet(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().getByResourceGroupWithResponse("myResourceGroup", "myOrganization", - com.azure.core.util.Context.NONE); + manager.organizations() + .getByResourceGroupWithResponse("myResourceGroup", "myOrganization", com.azure.core.util.Context.NONE); } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetClusterApiKeySamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetClusterApiKeySamples.java index 3ff9ffe62d60..dfda35ff7080 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetClusterApiKeySamples.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetClusterApiKeySamples.java @@ -18,7 +18,8 @@ public final class OrganizationGetClusterApiKeySamples { * @param manager Entry point to ConfluentManager. */ public static void organizationGetClusterAPIKey(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().getClusterApiKeyWithResponse("myResourceGroup", "myOrganization", "apiKeyId-123", - com.azure.core.util.Context.NONE); + manager.organizations() + .getClusterApiKeyWithResponse("myResourceGroup", "myOrganization", "apiKeyId-123", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetClusterByIdSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetClusterByIdSamples.java index 580a75e7f1b0..8419b2b2ec5c 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetClusterByIdSamples.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetClusterByIdSamples.java @@ -18,7 +18,8 @@ public final class OrganizationGetClusterByIdSamples { * @param manager Entry point to ConfluentManager. */ public static void organizationGetClusterById(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().getClusterByIdWithResponse("myResourceGroup", "myOrganization", "env-12132", - "dlz-f3a90de", com.azure.core.util.Context.NONE); + manager.organizations() + .getClusterByIdWithResponse("myResourceGroup", "myOrganization", "env-12132", "dlz-f3a90de", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetEnvironmentByIdSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetEnvironmentByIdSamples.java index b72cccd3d409..866d375c81fb 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetEnvironmentByIdSamples.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetEnvironmentByIdSamples.java @@ -18,7 +18,8 @@ public final class OrganizationGetEnvironmentByIdSamples { * @param manager Entry point to ConfluentManager. */ public static void organizationGetEnvironmentById(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().getEnvironmentByIdWithResponse("myResourceGroup", "myOrganization", "dlz-f3a90de", - com.azure.core.util.Context.NONE); + manager.organizations() + .getEnvironmentByIdWithResponse("myResourceGroup", "myOrganization", "dlz-f3a90de", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetSchemaRegistryClusterByIdSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetSchemaRegistryClusterByIdSamples.java index da584b03de01..a6bd52f510ed 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetSchemaRegistryClusterByIdSamples.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetSchemaRegistryClusterByIdSamples.java @@ -19,7 +19,8 @@ public final class OrganizationGetSchemaRegistryClusterByIdSamples { */ public static void organizationGetSchemaRegistryClusterById(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().getSchemaRegistryClusterByIdWithResponse("myResourceGroup", "myOrganization", - "env-stgcczjp2j3", "lsrc-stgczkq22z", com.azure.core.util.Context.NONE); + manager.organizations() + .getSchemaRegistryClusterByIdWithResponse("myResourceGroup", "myOrganization", "env-stgcczjp2j3", + "lsrc-stgczkq22z", com.azure.core.util.Context.NONE); } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListClustersSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListClustersSamples.java index 54bdc5d07449..b5be4a2a001e 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListClustersSamples.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListClustersSamples.java @@ -19,7 +19,7 @@ public final class OrganizationListClustersSamples { * @param manager Entry point to ConfluentManager. */ public static void organizationListClusters(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().listClusters("myResourceGroup", "myOrganization", "env-12132", 10, null, - com.azure.core.util.Context.NONE); + manager.organizations() + .listClusters("myResourceGroup", "myOrganization", "env-12132", 10, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListEnvironmentsSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListEnvironmentsSamples.java index 365a68c15f7a..4e8c52787bfc 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListEnvironmentsSamples.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListEnvironmentsSamples.java @@ -18,7 +18,7 @@ public final class OrganizationListEnvironmentsSamples { * @param manager Entry point to ConfluentManager. */ public static void organizationListEnvironments(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().listEnvironments("myResourceGroup", "myOrganization", 10, null, - com.azure.core.util.Context.NONE); + manager.organizations() + .listEnvironments("myResourceGroup", "myOrganization", 10, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListRegionsSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListRegionsSamples.java index 3e9aa7e61237..5eb13d1e8ecc 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListRegionsSamples.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListRegionsSamples.java @@ -23,10 +23,11 @@ public final class OrganizationListRegionsSamples { * @param manager Entry point to ConfluentManager. */ public static void organizationListRegions(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().listRegionsWithResponse("myResourceGroup", "myOrganization", - new ListAccessRequestModel() - .withSearchFilters(mapOf("cloud", "azure", "packages", "ADVANCED,ESSENTIALS", "region", "eastus")), - com.azure.core.util.Context.NONE); + manager.organizations() + .listRegionsWithResponse("myResourceGroup", "myOrganization", + new ListAccessRequestModel() + .withSearchFilters(mapOf("cloud", "azure", "packages", "ADVANCED,ESSENTIALS", "region", "eastus")), + com.azure.core.util.Context.NONE); } // Use "Map.of" if available diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListSchemaRegistryClustersSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListSchemaRegistryClustersSamples.java index b2824c81d1db..d68b89d9732f 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListSchemaRegistryClustersSamples.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListSchemaRegistryClustersSamples.java @@ -19,7 +19,8 @@ public final class OrganizationListSchemaRegistryClustersSamples { */ public static void organizationListSchemaRegistryClusters(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.organizations().listSchemaRegistryClusters("myResourceGroup", "myOrganization", "env-stgcczjp2j3", null, - null, com.azure.core.util.Context.NONE); + manager.organizations() + .listSchemaRegistryClusters("myResourceGroup", "myOrganization", "env-stgcczjp2j3", null, null, + com.azure.core.util.Context.NONE); } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/ValidationsValidateOrganizationSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/ValidationsValidateOrganizationSamples.java index b612fab64e0a..3a0f7aea8a7d 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/ValidationsValidateOrganizationSamples.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/ValidationsValidateOrganizationSamples.java @@ -25,15 +25,23 @@ public final class ValidationsValidateOrganizationSamples { * @param manager Entry point to ConfluentManager. */ public static void validationsValidateOrganizations(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.validations().validateOrganizationWithResponse("myResourceGroup", "myOrganization", - new OrganizationResourceInner().withLocation("West US").withTags(mapOf("Environment", "Dev")) - .withOfferDetail(new OfferDetail().withPublisherId("string").withId("string").withPlanId("string") - .withPlanName("string").withTermUnit("string").withPrivateOfferId("string") - .withPrivateOfferIds(Arrays.asList("string"))) - .withUserDetail(new UserDetail().withFirstName("string").withLastName("string") - .withEmailAddress("abc@microsoft.com").withUserPrincipalName("abc@microsoft.com") - .withAadEmail("abc@microsoft.com")), - com.azure.core.util.Context.NONE); + manager.validations() + .validateOrganizationWithResponse("myResourceGroup", "myOrganization", + new OrganizationResourceInner().withLocation("West US") + .withTags(mapOf("Environment", "Dev")) + .withOfferDetail(new OfferDetail().withPublisherId("string") + .withId("string") + .withPlanId("string") + .withPlanName("string") + .withTermUnit("string") + .withPrivateOfferId("string") + .withPrivateOfferIds(Arrays.asList("string"))) + .withUserDetail(new UserDetail().withFirstName("string") + .withLastName("string") + .withEmailAddress("abc@microsoft.com") + .withUserPrincipalName("abc@microsoft.com") + .withAadEmail("abc@microsoft.com")), + com.azure.core.util.Context.NONE); } // Use "Map.of" if available diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/ValidationsValidateOrganizationV2Samples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/ValidationsValidateOrganizationV2Samples.java index d2ccb817e66e..062a485e1a7f 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/ValidationsValidateOrganizationV2Samples.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/ValidationsValidateOrganizationV2Samples.java @@ -25,15 +25,23 @@ public final class ValidationsValidateOrganizationV2Samples { * @param manager Entry point to ConfluentManager. */ public static void validationsValidateOrganizations(com.azure.resourcemanager.confluent.ConfluentManager manager) { - manager.validations().validateOrganizationV2WithResponse("myResourceGroup", "myOrganization", - new OrganizationResourceInner().withLocation("West US").withTags(mapOf("Environment", "Dev")) - .withOfferDetail(new OfferDetail().withPublisherId("string").withId("string").withPlanId("string") - .withPlanName("string").withTermUnit("string").withPrivateOfferId("string") - .withPrivateOfferIds(Arrays.asList("string"))) - .withUserDetail(new UserDetail().withFirstName("string").withLastName("string") - .withEmailAddress("abc@microsoft.com").withUserPrincipalName("abc@microsoft.com") - .withAadEmail("abc@microsoft.com")), - com.azure.core.util.Context.NONE); + manager.validations() + .validateOrganizationV2WithResponse("myResourceGroup", "myOrganization", + new OrganizationResourceInner().withLocation("West US") + .withTags(mapOf("Environment", "Dev")) + .withOfferDetail(new OfferDetail().withPublisherId("string") + .withId("string") + .withPlanId("string") + .withPlanName("string") + .withTermUnit("string") + .withPrivateOfferId("string") + .withPrivateOfferIds(Arrays.asList("string"))) + .withUserDetail(new UserDetail().withFirstName("string") + .withLastName("string") + .withEmailAddress("abc@microsoft.com") + .withUserPrincipalName("abc@microsoft.com") + .withAadEmail("abc@microsoft.com")), + com.azure.core.util.Context.NONE); } // Use "Map.of" if available diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessCreateRoleBindingWithResponseMockTests.java b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessCreateRoleBindingWithResponseMockTests.java index 661f2542abd9..fb260b6e1ebc 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessCreateRoleBindingWithResponseMockTests.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessCreateRoleBindingWithResponseMockTests.java @@ -6,45 +6,26 @@ 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.confluent.ConfluentManager; import com.azure.resourcemanager.confluent.models.AccessCreateRoleBindingRequestModel; import com.azure.resourcemanager.confluent.models.RoleBindingRecord; -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 AccessCreateRoleBindingWithResponseMockTests { @Test public void testCreateRoleBindingWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"kind\":\"njlx\",\"id\":\"rhwpus\",\"metadata\":{\"self\":\"aqehg\",\"resource_name\":\"ohzjqatucoigeb\",\"created_at\":\"cnwfepbnwgfmxjg\",\"updated_at\":\"bjb\",\"deleted_at\":\"lfgtdysnaquflqbc\"},\"principal\":\"hamzjrwdkqze\",\"role_name\":\"jleziunjx\",\"crn_pattern\":\"zantkwceg\"}"; - 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))); ConfluentManager manager = ConfluentManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessDeleteRoleBindingWithResponseMockTests.java b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessDeleteRoleBindingWithResponseMockTests.java index ed827570d902..8e82de75396e 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessDeleteRoleBindingWithResponseMockTests.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessDeleteRoleBindingWithResponseMockTests.java @@ -6,41 +6,22 @@ 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.confluent.ConfluentManager; -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 AccessDeleteRoleBindingWithResponseMockTests { @Test public void testDeleteRoleBindingWithResponse() 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))); ConfluentManager manager = ConfluentManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessInviteUserWithResponseMockTests.java b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessInviteUserWithResponseMockTests.java index 4e9ce9cbe1fd..7c4ae99ca93f 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessInviteUserWithResponseMockTests.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessInviteUserWithResponseMockTests.java @@ -6,46 +6,27 @@ 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.confluent.ConfluentManager; import com.azure.resourcemanager.confluent.models.AccessInviteUserAccountModel; import com.azure.resourcemanager.confluent.models.AccessInvitedUserDetails; import com.azure.resourcemanager.confluent.models.InvitationRecord; -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 AccessInviteUserWithResponseMockTests { @Test public void testInviteUserWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"kind\":\"jlzqnhc\",\"id\":\"ql\",\"metadata\":{\"self\":\"oibgsxg\",\"resource_name\":\"fyq\",\"created_at\":\"mpqoxw\",\"updated_at\":\"fdbxiqxeiiqbim\",\"deleted_at\":\"mwwinhehfqpofv\"},\"email\":\"cblembnkbwv\",\"auth_type\":\"xk\",\"status\":\"vqihebwtswbzuwf\",\"accepted_at\":\"urageg\",\"expires_at\":\"vcjfelisdjubggb\"}"; - 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))); ConfluentManager manager = ConfluentManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListClustersWithResponseMockTests.java b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListClustersWithResponseMockTests.java index dfa2a4cc0eb8..003ff95c8c38 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListClustersWithResponseMockTests.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListClustersWithResponseMockTests.java @@ -6,47 +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.confluent.ConfluentManager; import com.azure.resourcemanager.confluent.models.AccessListClusterSuccessResponse; import com.azure.resourcemanager.confluent.models.ListAccessRequestModel; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; 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 AccessListClustersWithResponseMockTests { @Test public void testListClustersWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"kind\":\"iqg\",\"metadata\":{\"first\":\"okzrus\",\"last\":\"vhczznvfby\",\"prev\":\"sxjwwixz\",\"next\":\"mwmxqhndvnoamld\",\"total_size\":1759834581},\"data\":[{\"kind\":\"djh\",\"id\":\"lzok\",\"metadata\":{\"self\":\"xpelnjetagltsx\",\"resource_name\":\"tft\",\"created_at\":\"pnpbswveflocc\",\"updated_at\":\"mozi\",\"deleted_at\":\"ipgawtxx\"},\"display_name\":\"y\",\"spec\":{\"display_name\":\"cjxgrytf\",\"availability\":\"cy\",\"cloud\":\"lrmcaykg\",\"zone\":\"oxuztrksx\",\"region\":\"ndfcpfn\",\"kafka_bootstrap_endpoint\":\"thjtwk\",\"http_endpoint\":\"osrxuzvoa\",\"api_endpoint\":\"tcqiosmg\",\"config\":{\"kind\":\"hgxqdlyrt\"},\"environment\":{\"id\":\"ap\",\"environment\":\"tz\",\"related\":\"tbhjmznnbsoqe\",\"resource_name\":\"larvlagunbtg\"},\"network\":{\"id\":\"wlnbm\",\"environment\":\"reeudzqavb\",\"related\":\"qmjxlyyzglgouwtl\",\"resource_name\":\"jyuojqtobaxkjeyt\"},\"byok\":{\"id\":\"bfjkw\",\"related\":\"snkq\",\"resource_name\":\"syrq\"}},\"status\":{\"phase\":\"qhd\",\"cku\":2136418443}},{\"kind\":\"ulkpakd\",\"id\":\"fmjnnawtqa\",\"metadata\":{\"self\":\"uckpggqoweyir\",\"resource_name\":\"lisn\",\"created_at\":\"fl\",\"updated_at\":\"mpizru\",\"deleted_at\":\"pqxpx\"},\"display_name\":\"fcngjsa\",\"spec\":{\"display_name\":\"ixtmkzjvkviirhgf\",\"availability\":\"wsdpgratzvzb\",\"cloud\":\"byvi\",\"zone\":\"ctbrxkjzwrgxffm\",\"region\":\"kwfbkgo\",\"kafka_bootstrap_endpoint\":\"wopdbydpiz\",\"http_endpoint\":\"clnapxbiygnugjkn\",\"api_endpoint\":\"mfcttux\",\"config\":{\"kind\":\"i\"},\"environment\":{\"id\":\"qoiquvrehmrnjhv\",\"environment\":\"jztczytqj\",\"related\":\"h\",\"resource_name\":\"unfprnjletlxs\"},\"network\":{\"id\":\"ddoui\",\"environment\":\"mowaziynknlqwzdv\",\"related\":\"w\",\"resource_name\":\"qszdtmaajquhuxyl\"},\"byok\":{\"id\":\"m\",\"related\":\"g\",\"resource_name\":\"mzyospspshck\"}},\"status\":{\"phase\":\"jpmspbpssdfppy\",\"cku\":1546979917}},{\"kind\":\"eyujtvczkcnyxrx\",\"id\":\"njdxvglnkvxl\",\"metadata\":{\"self\":\"glqivbgkcv\",\"resource_name\":\"pzvuqdflvo\",\"created_at\":\"yp\",\"updated_at\":\"ubcpzgpxti\",\"deleted_at\":\"j\"},\"display_name\":\"idibgqjxgpn\",\"spec\":{\"display_name\":\"ov\",\"availability\":\"pikqmh\",\"cloud\":\"owjrmzvuporqz\",\"zone\":\"uydzvk\",\"region\":\"xcnqmxqpswokmvkh\",\"kafka_bootstrap_endpoint\":\"gdhbe\",\"http_endpoint\":\"qkzszuwiwtglxxh\",\"api_endpoint\":\"fpgpicrmnzhrgm\",\"config\":{\"kind\":\"sxvpqcbfrmbodths\"},\"environment\":{\"id\":\"vriibakclacjfr\",\"environment\":\"ousxauzlwvsgmw\",\"related\":\"qf\",\"resource_name\":\"zvuxm\"},\"network\":{\"id\":\"svth\",\"environment\":\"pz\",\"related\":\"kovmribiatt\",\"resource_name\":\"lu\"},\"byok\":{\"id\":\"tangcfhnykzcu\",\"related\":\"wvxwlmzqwmvt\",\"resource_name\":\"jmxmcuqud\"}},\"status\":{\"phase\":\"clxyn\",\"cku\":267466114}}]}"; - 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))); ConfluentManager manager = ConfluentManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListEnvironmentsWithResponseMockTests.java b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListEnvironmentsWithResponseMockTests.java index 75def16f612b..4e2adcecf456 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListEnvironmentsWithResponseMockTests.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListEnvironmentsWithResponseMockTests.java @@ -6,47 +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.confluent.ConfluentManager; import com.azure.resourcemanager.confluent.models.AccessListEnvironmentsSuccessResponse; import com.azure.resourcemanager.confluent.models.ListAccessRequestModel; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; 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 AccessListEnvironmentsWithResponseMockTests { @Test public void testListEnvironmentsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"kind\":\"tkvnlvxbcuiiznkt\",\"metadata\":{\"first\":\"nsnvpd\",\"last\":\"mik\",\"prev\":\"tbzbkiwbuqnyophz\",\"next\":\"l\",\"total_size\":348954725},\"data\":[{\"kind\":\"bcunezzceze\",\"id\":\"w\",\"metadata\":{\"self\":\"lwxjwetn\",\"resource_name\":\"ihclafzv\",\"created_at\":\"lpt\",\"updated_at\":\"qqwzt\",\"deleted_at\":\"w\"},\"display_name\":\"chcxwaxfewzj\"},{\"kind\":\"exfdeqvhpsylk\",\"id\":\"hkbffmbm\",\"metadata\":{\"self\":\"rgywwp\",\"resource_name\":\"xs\",\"created_at\":\"tf\",\"updated_at\":\"gicgaaoepttaq\",\"deleted_at\":\"dewemxswv\"},\"display_name\":\"unzzjgehk\"},{\"kind\":\"imrt\",\"id\":\"okffqyinljqepqwh\",\"metadata\":{\"self\":\"onsts\",\"resource_name\":\"yxgvelfcld\",\"created_at\":\"cb\",\"updated_at\":\"ds\",\"deleted_at\":\"wcobie\"},\"display_name\":\"tmninw\"}]}"; - 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))); ConfluentManager manager = ConfluentManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListInvitationsWithResponseMockTests.java b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListInvitationsWithResponseMockTests.java index 214099a8124d..154d79c92272 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListInvitationsWithResponseMockTests.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListInvitationsWithResponseMockTests.java @@ -6,47 +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.confluent.ConfluentManager; import com.azure.resourcemanager.confluent.models.AccessListInvitationsSuccessResponse; import com.azure.resourcemanager.confluent.models.ListAccessRequestModel; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; 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 AccessListInvitationsWithResponseMockTests { @Test public void testListInvitationsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"kind\":\"jwogqqnobpudc\",\"metadata\":{\"first\":\"tqwpwya\",\"last\":\"zasqbucljgkyexao\",\"prev\":\"yaipidsda\",\"next\":\"tx\",\"total_size\":634071043},\"data\":[{\"kind\":\"qwazlnqnmcjngzq\",\"id\":\"xtbjwgnyfusfzsv\",\"metadata\":{\"self\":\"kzhajqglcfhm\",\"resource_name\":\"qryxyn\",\"created_at\":\"zrdpsovwxznptgoe\",\"updated_at\":\"bbabp\",\"deleted_at\":\"vf\"},\"email\":\"kvntjlrigjkskyri\",\"auth_type\":\"vzidsxwaab\",\"status\":\"ifrygzn\",\"accepted_at\":\"axri\",\"expires_at\":\"zob\"},{\"kind\":\"pxl\",\"id\":\"lnelxieixynl\",\"metadata\":{\"self\":\"cwcrojphs\",\"resource_name\":\"cawjutifdwfmvi\",\"created_at\":\"rqjb\",\"updated_at\":\"zhraglkafh\",\"deleted_at\":\"qjujeickpzvcp\"},\"email\":\"mxelnwcltyjed\",\"auth_type\":\"xm\",\"status\":\"mkqscaz\",\"accepted_at\":\"wxtzxpuamwab\",\"expires_at\":\"rvxcush\"}]}"; - 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))); ConfluentManager manager = ConfluentManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListRoleBindingNameListWithResponseMockTests.java b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListRoleBindingNameListWithResponseMockTests.java index 636af187793f..10a5e6508daa 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListRoleBindingNameListWithResponseMockTests.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListRoleBindingNameListWithResponseMockTests.java @@ -6,47 +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.confluent.ConfluentManager; import com.azure.resourcemanager.confluent.models.AccessRoleBindingNameListSuccessResponse; import com.azure.resourcemanager.confluent.models.ListAccessRequestModel; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; 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 AccessListRoleBindingNameListWithResponseMockTests { @Test public void testListRoleBindingNameListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"kind\":\"tuwkffdj\",\"metadata\":{\"first\":\"ysidfvclgl\",\"last\":\"fuijtkbus\",\"prev\":\"gsfikayiansha\",\"next\":\"jtjiqx\",\"total_size\":1119516110},\"data\":[\"ttvwkpqh\"]}"; - 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))); ConfluentManager manager = ConfluentManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListRoleBindingsWithResponseMockTests.java b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListRoleBindingsWithResponseMockTests.java index 5eebecbe04d1..f4f015afb6bd 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListRoleBindingsWithResponseMockTests.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListRoleBindingsWithResponseMockTests.java @@ -6,47 +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.confluent.ConfluentManager; import com.azure.resourcemanager.confluent.models.AccessListRoleBindingsSuccessResponse; import com.azure.resourcemanager.confluent.models.ListAccessRequestModel; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; 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 AccessListRoleBindingsWithResponseMockTests { @Test public void testListRoleBindingsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"kind\":\"qylkmqpzoyhlf\",\"metadata\":{\"first\":\"wgcloxoebqinji\",\"last\":\"wjfuj\",\"prev\":\"afcba\",\"next\":\"pzpofoiyjw\",\"total_size\":1217605698},\"data\":[{\"kind\":\"kkholvdndvia\",\"id\":\"gphuartvtiu\",\"metadata\":{\"self\":\"fchnmnah\",\"resource_name\":\"xhk\",\"created_at\":\"qirwrweoox\",\"updated_at\":\"i\",\"deleted_at\":\"xwrsnew\"},\"principal\":\"zqvbubqm\",\"role_name\":\"hsycxhxzgaz\",\"crn_pattern\":\"abo\"},{\"kind\":\"vmfqhppubo\",\"id\":\"epdfgkmtdherng\",\"metadata\":{\"self\":\"juahokqto\",\"resource_name\":\"auxofshfph\",\"created_at\":\"nulaiywzejywhsl\",\"updated_at\":\"ojpllndnpdwrpqaf\",\"deleted_at\":\"ug\"},\"principal\":\"n\",\"role_name\":\"yetefyp\",\"crn_pattern\":\"octfjgtixrjvzuyt\"},{\"kind\":\"mlmuowol\",\"id\":\"uir\",\"metadata\":{\"self\":\"ons\",\"resource_name\":\"nw\",\"created_at\":\"gajinnixjawrtmj\",\"updated_at\":\"myccx\",\"deleted_at\":\"hcoxov\"},\"principal\":\"khenlus\",\"role_name\":\"rd\",\"crn_pattern\":\"xtxrdcqtjvidt\"}]}"; - 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))); ConfluentManager manager = ConfluentManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListServiceAccountsWithResponseMockTests.java b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListServiceAccountsWithResponseMockTests.java index 4d86eb0784cd..e7e2cc29a758 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListServiceAccountsWithResponseMockTests.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListServiceAccountsWithResponseMockTests.java @@ -6,47 +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.confluent.ConfluentManager; import com.azure.resourcemanager.confluent.models.AccessListServiceAccountsSuccessResponse; import com.azure.resourcemanager.confluent.models.ListAccessRequestModel; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; 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 AccessListServiceAccountsWithResponseMockTests { @Test public void testListServiceAccountsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"kind\":\"rlpyznuciqdsmexi\",\"metadata\":{\"first\":\"fuxtyasiibmiybnn\",\"last\":\"tgnljhnmgixhcmav\",\"prev\":\"foudor\",\"next\":\"gyyprotwy\",\"total_size\":677853893},\"data\":[{\"kind\":\"xhugcm\",\"id\":\"avlg\",\"metadata\":{\"self\":\"mftpmdtz\",\"resource_name\":\"ltfvnz\",\"created_at\":\"jtotpvopvpbd\",\"updated_at\":\"qgqqihedsvqwthmk\",\"deleted_at\":\"bcysih\"},\"display_name\":\"qcwdhoh\",\"description\":\"tmcdzsufcohd\"},{\"kind\":\"zlmcmuapcvhdb\",\"id\":\"wqqxeysko\",\"metadata\":{\"self\":\"inkfkbgbz\",\"resource_name\":\"wxeqocljmygvkzqk\",\"created_at\":\"eokbze\",\"updated_at\":\"zrxcczurt\",\"deleted_at\":\"ipqxbkwvzgnzv\"},\"display_name\":\"bzdixzmq\",\"description\":\"odawopqhewjptmcg\"},{\"kind\":\"ostzelndlatu\",\"id\":\"zlbiojlvfhrbbpn\",\"metadata\":{\"self\":\"cwwyyur\",\"resource_name\":\"chpp\",\"created_at\":\"rsnm\",\"updated_at\":\"ayzejnhlbkpbz\",\"deleted_at\":\"piljhahzvech\"},\"display_name\":\"bnwieholew\",\"description\":\"iuubwefqsf\"}]}"; - 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))); ConfluentManager manager = ConfluentManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListUsersWithResponseMockTests.java b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListUsersWithResponseMockTests.java index a61b34c2dd2b..a5d0112f2337 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListUsersWithResponseMockTests.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/AccessListUsersWithResponseMockTests.java @@ -6,47 +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.confluent.ConfluentManager; import com.azure.resourcemanager.confluent.models.AccessListUsersSuccessResponse; import com.azure.resourcemanager.confluent.models.ListAccessRequestModel; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; 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 AccessListUsersWithResponseMockTests { @Test public void testListUsersWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"kind\":\"jtlo\",\"metadata\":{\"first\":\"uojrngiflr\",\"last\":\"asccbiui\",\"prev\":\"dlyjdf\",\"next\":\"mkyoqufdvruzsl\",\"total_size\":15628056},\"data\":[{\"kind\":\"tfnmdx\",\"id\":\"ngfdgugeyzihgrky\",\"metadata\":{\"self\":\"absnmfpp\",\"resource_name\":\"jee\",\"created_at\":\"hyhsgzfczbg\",\"updated_at\":\"fgbegl\",\"deleted_at\":\"leohibetnluankr\"},\"email\":\"xeeebtijvacvbmqz\",\"full_name\":\"q\",\"auth_type\":\"aj\"}]}"; - 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))); ConfluentManager manager = ConfluentManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/MarketplaceAgreementsCreateWithResponseMockTests.java b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/MarketplaceAgreementsCreateWithResponseMockTests.java index 8119f740ecb9..014e308cc408 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/MarketplaceAgreementsCreateWithResponseMockTests.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/MarketplaceAgreementsCreateWithResponseMockTests.java @@ -6,45 +6,26 @@ 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.confluent.ConfluentManager; import com.azure.resourcemanager.confluent.fluent.models.ConfluentAgreementResourceInner; import com.azure.resourcemanager.confluent.models.ConfluentAgreementResource; -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 MarketplaceAgreementsCreateWithResponseMockTests { @Test public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"properties\":{\"publisher\":\"kmr\",\"product\":\"mvvhmxtdrjfuta\",\"plan\":\"ebjvewzcjzn\",\"licenseTextLink\":\"cpmguaadraufact\",\"privacyPolicyLink\":\"hzovaj\",\"retrieveDatetime\":\"2021-02-15T15:09:11Z\",\"signature\":\"xxpshneeku\",\"accepted\":false},\"id\":\"slqubkwdl\",\"name\":\"nrdsutujbazpjuoh\",\"type\":\"inyflnorwmduvwp\"}"; - 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))); ConfluentManager manager = ConfluentManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/MarketplaceAgreementsListMockTests.java b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/MarketplaceAgreementsListMockTests.java index 547981b348e0..09c04f253516 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/MarketplaceAgreementsListMockTests.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/MarketplaceAgreementsListMockTests.java @@ -6,45 +6,26 @@ 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.confluent.ConfluentManager; import com.azure.resourcemanager.confluent.models.ConfluentAgreementResource; -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 MarketplaceAgreementsListMockTests { @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\":{\"publisher\":\"bth\",\"product\":\"tgk\",\"plan\":\"tvdxeclzedqb\",\"licenseTextLink\":\"hzlhplodqkdlww\",\"privacyPolicyLink\":\"bum\",\"retrieveDatetime\":\"2021-01-09T13:22:40Z\",\"signature\":\"rqjfsmlm\",\"accepted\":true},\"id\":\"hwgfwsrt\",\"name\":\"wcoezbrhub\",\"type\":\"kh\"}]}"; - 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))); ConfluentManager manager = ConfluentManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationOperationsListMockTests.java b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationOperationsListMockTests.java index 2132ea7fca56..b1795de0fafa 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationOperationsListMockTests.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationOperationsListMockTests.java @@ -6,45 +6,26 @@ 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.confluent.ConfluentManager; import com.azure.resourcemanager.confluent.models.OperationResult; -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 OrganizationOperationsListMockTests { @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\":\"vxwmygd\",\"display\":{\"provider\":\"pqchiszep\",\"resource\":\"bjcrxgibbdaxco\",\"operation\":\"ozauorsukokwb\",\"description\":\"lhlv\"},\"isDataAction\":false}]}"; - 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))); ConfluentManager manager = ConfluentManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsDeleteClusterApiKeyWithResponseMockTests.java b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsDeleteClusterApiKeyWithResponseMockTests.java index 147003f8a8e4..fa981f802308 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsDeleteClusterApiKeyWithResponseMockTests.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsDeleteClusterApiKeyWithResponseMockTests.java @@ -6,41 +6,22 @@ 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.confluent.ConfluentManager; -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 OrganizationsDeleteClusterApiKeyWithResponseMockTests { @Test public void testDeleteClusterApiKeyWithResponse() 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))); ConfluentManager manager = ConfluentManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsDeleteMockTests.java b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsDeleteMockTests.java index 79f12c823996..baa513bc04d5 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsDeleteMockTests.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsDeleteMockTests.java @@ -6,41 +6,22 @@ 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.confluent.ConfluentManager; -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 OrganizationsDeleteMockTests { @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))); ConfluentManager manager = ConfluentManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsGetClusterByIdWithResponseMockTests.java b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsGetClusterByIdWithResponseMockTests.java index 4dce4d1e4a47..9877e08270a4 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsGetClusterByIdWithResponseMockTests.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsGetClusterByIdWithResponseMockTests.java @@ -6,44 +6,25 @@ 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.confluent.ConfluentManager; import com.azure.resourcemanager.confluent.models.SCClusterRecord; -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 OrganizationsGetClusterByIdWithResponseMockTests { @Test public void testGetClusterByIdWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"kind\":\"bxv\",\"id\":\"htnsi\",\"properties\":{\"metadata\":{\"self\":\"z\",\"resourceName\":\"es\",\"createdTimestamp\":\"dlpagzrcxfail\",\"updatedTimestamp\":\"xwmdboxd\",\"deletedTimestamp\":\"sftufqobrjlna\"},\"spec\":{\"name\":\"ckknhxkizvy\",\"availability\":\"rzvul\",\"cloud\":\"aaeranokqgukk\",\"zone\":\"nvbroylaxx\",\"region\":\"cdisd\",\"kafkaBootstrapEndpoint\":\"fj\",\"httpEndpoint\":\"svgjrwhryvy\",\"apiEndpoint\":\"t\",\"config\":{\"kind\":\"xgccknfnw\"},\"environment\":{\"id\":\"mvpdvjdhttzaef\",\"environment\":\"x\",\"related\":\"ch\",\"resourceName\":\"hk\"},\"network\":{\"id\":\"jdqnsdfzpbgt\",\"environment\":\"ylkdghrje\",\"related\":\"tl\",\"resourceName\":\"ez\"},\"byok\":{\"id\":\"okvbwnhhtqlgehg\",\"related\":\"ipifhpfeoajvg\",\"resourceName\":\"txjcsheafidlt\"}},\"status\":{\"phase\":\"resmkssjhoiftxfk\",\"cku\":182361785}},\"name\":\"prhptillu\"}"; - 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))); ConfluentManager manager = ConfluentManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsGetEnvironmentByIdWithResponseMockTests.java b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsGetEnvironmentByIdWithResponseMockTests.java index a8755156955f..d536ef9deebd 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsGetEnvironmentByIdWithResponseMockTests.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsGetEnvironmentByIdWithResponseMockTests.java @@ -6,44 +6,25 @@ 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.confluent.ConfluentManager; import com.azure.resourcemanager.confluent.models.SCEnvironmentRecord; -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 OrganizationsGetEnvironmentByIdWithResponseMockTests { @Test public void testGetEnvironmentByIdWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"kind\":\"lds\",\"id\":\"stjbkkdmfl\",\"properties\":{\"metadata\":{\"self\":\"mjlxrrilozapeewc\",\"resourceName\":\"xlktwkuzi\",\"createdTimestamp\":\"slevufuztc\",\"updatedTimestamp\":\"yhjtqedcgzu\",\"deletedTimestamp\":\"mmrqz\"}},\"name\":\"rjvpglydzgkrvqee\"}"; - 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))); ConfluentManager manager = ConfluentManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsGetSchemaRegistryClusterByIdWithResponseMockTests.java b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsGetSchemaRegistryClusterByIdWithResponseMockTests.java index 89094543fa4b..d5f83aecf713 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsGetSchemaRegistryClusterByIdWithResponseMockTests.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsGetSchemaRegistryClusterByIdWithResponseMockTests.java @@ -6,44 +6,25 @@ 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.confluent.ConfluentManager; import com.azure.resourcemanager.confluent.models.SchemaRegistryClusterRecord; -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 OrganizationsGetSchemaRegistryClusterByIdWithResponseMockTests { @Test public void testGetSchemaRegistryClusterByIdWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"kind\":\"vjskgfmoc\",\"id\":\"hpqgatjeaahhvj\",\"properties\":{\"metadata\":{\"self\":\"kzyb\",\"resourceName\":\"jid\",\"createdTimestamp\":\"syxkyxvxevblb\",\"updatedTimestamp\":\"dnlj\",\"deletedTimestamp\":\"geuaulx\"},\"spec\":{\"name\":\"mjbnk\",\"httpEndpoint\":\"xynenl\",\"package\":\"xeizzg\",\"region\":{\"id\":\"nsrmffeycx\",\"related\":\"tpiymerteea\",\"resourceName\":\"xqiekkkzddrtk\"},\"environment\":{\"id\":\"jbmxvavre\",\"related\":\"eesvecu\",\"resourceName\":\"pxtxsuwp\"},\"cloud\":\"ujwsawddjibabxvi\"},\"status\":{\"phase\":\"v\"}}}"; - 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))); ConfluentManager manager = ConfluentManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsListClustersMockTests.java b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsListClustersMockTests.java index 574c288fd55f..c5f623212c65 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsListClustersMockTests.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsListClustersMockTests.java @@ -6,45 +6,26 @@ 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.confluent.ConfluentManager; import com.azure.resourcemanager.confluent.models.SCClusterRecord; -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 OrganizationsListClustersMockTests { @Test public void testListClusters() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[{\"kind\":\"dflgzuri\",\"id\":\"aecxndtic\",\"properties\":{\"metadata\":{\"self\":\"zmlqtmldgxo\",\"resourceName\":\"irclnpk\",\"createdTimestamp\":\"ayzri\",\"updatedTimestamp\":\"hya\",\"deletedTimestamp\":\"vjlboxqvk\"},\"spec\":{\"name\":\"xhom\",\"availability\":\"nhdwdigumbnra\",\"cloud\":\"zzp\",\"zone\":\"a\",\"region\":\"sdzhezww\",\"kafkaBootstrapEndpoint\":\"iqyuvvfo\",\"httpEndpoint\":\"p\",\"apiEndpoint\":\"qyikvy\",\"config\":{\"kind\":\"yavluwmncstt\"},\"environment\":{\"id\":\"y\",\"environment\":\"poekrsgsgb\",\"related\":\"uzqgnjdgkynsc\",\"resourceName\":\"qhzvhxnkomt\"},\"network\":{\"id\":\"otppnv\",\"environment\":\"zxhi\",\"related\":\"rbbcevq\",\"resourceName\":\"tltdhlfkqojpy\"},\"byok\":{\"id\":\"trdcnifmzzs\",\"related\":\"m\",\"resourceName\":\"nysuxmprafwgckh\"}},\"status\":{\"phase\":\"vdff\",\"cku\":848051352}},\"name\":\"qrouda\"}]}"; - 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))); ConfluentManager manager = ConfluentManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsListEnvironmentsMockTests.java b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsListEnvironmentsMockTests.java index 7d1622c1a27b..79c92ac50069 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsListEnvironmentsMockTests.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsListEnvironmentsMockTests.java @@ -6,45 +6,26 @@ 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.confluent.ConfluentManager; import com.azure.resourcemanager.confluent.models.SCEnvironmentRecord; -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 OrganizationsListEnvironmentsMockTests { @Test public void testListEnvironments() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[{\"kind\":\"kdncj\",\"id\":\"onbzoggculapzwy\",\"properties\":{\"metadata\":{\"self\":\"gtqxep\",\"resourceName\":\"lbfu\",\"createdTimestamp\":\"lyjt\",\"updatedTimestamp\":\"of\",\"deletedTimestamp\":\"hvfcibyfmow\"}},\"name\":\"rkjpvdwxfzwii\"}]}"; - 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))); ConfluentManager manager = ConfluentManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsListRegionsWithResponseMockTests.java b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsListRegionsWithResponseMockTests.java index 0e44aa4e702f..bbf7e18ad08a 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsListRegionsWithResponseMockTests.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsListRegionsWithResponseMockTests.java @@ -6,47 +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.confluent.ConfluentManager; import com.azure.resourcemanager.confluent.models.ListAccessRequestModel; import com.azure.resourcemanager.confluent.models.ListRegionsSuccessResponse; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; 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 OrganizationsListRegionsWithResponseMockTests { @Test public void testListRegionsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"data\":[{\"kind\":\"vekqvgqo\",\"id\":\"ifzmpjwyivqi\",\"properties\":{\"metadata\":{\"self\":\"vhrfsphuagrt\",\"resourceName\":\"kteusqczk\",\"createdTimestamp\":\"klxubyja\",\"updatedTimestamp\":\"mmfblcqcuubgqib\",\"deletedTimestamp\":\"a\"},\"spec\":{\"name\":\"tttwgdslqxih\",\"cloud\":\"moo\",\"regionName\":\"qseypxiutcxa\",\"packages\":[\"y\",\"petogebjox\",\"lhvnhlab\",\"q\"]}}},{\"kind\":\"kzjcjbtrgae\",\"id\":\"vibr\",\"properties\":{\"metadata\":{\"self\":\"toqbeitpkxztmoob\",\"resourceName\":\"ft\",\"createdTimestamp\":\"gfcwqmpimaqxzhem\",\"updatedTimestamp\":\"h\",\"deletedTimestamp\":\"uj\"},\"spec\":{\"name\":\"wkozz\",\"cloud\":\"ulkb\",\"regionName\":\"pfajnjwltlwtjj\",\"packages\":[\"talhsnvkcdmxzr\",\"oaimlnw\",\"aaomylweazu\",\"cse\"]}}},{\"kind\":\"wwnpj\",\"id\":\"fz\",\"properties\":{\"metadata\":{\"self\":\"hwahfbousn\",\"resourceName\":\"pgfewetwlyx\",\"createdTimestamp\":\"cxy\",\"updatedTimestamp\":\"hdjhlimmbcx\",\"deletedTimestamp\":\"bcporxvxcjzhqizx\"},\"spec\":{\"name\":\"tgqscjavftjuh\",\"cloud\":\"azkmtgguwp\",\"regionName\":\"r\",\"packages\":[\"ivmmghfcfiwrxgk\",\"euvyinzqodfvpgs\"]}}}]}"; - 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))); ConfluentManager manager = ConfluentManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsListSchemaRegistryClustersMockTests.java b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsListSchemaRegistryClustersMockTests.java index 2482e1289990..1a4db9aaebb9 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsListSchemaRegistryClustersMockTests.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/test/java/com/azure/resourcemanager/confluent/generated/OrganizationsListSchemaRegistryClustersMockTests.java @@ -6,45 +6,26 @@ 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.confluent.ConfluentManager; import com.azure.resourcemanager.confluent.models.SchemaRegistryClusterRecord; -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 OrganizationsListSchemaRegistryClustersMockTests { @Test public void testListSchemaRegistryClusters() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[{\"kind\":\"fdn\",\"id\":\"ydvfvfcjnae\",\"properties\":{\"metadata\":{\"self\":\"vhmgorffukis\",\"resourceName\":\"w\",\"createdTimestamp\":\"hwplefaxvx\",\"updatedTimestamp\":\"cbtgnhnz\",\"deletedTimestamp\":\"qxtjjfzqlqhyca\"},\"spec\":{\"name\":\"ggxdb\",\"httpEndpoint\":\"smieknlra\",\"package\":\"aawiuagydwqfb\",\"region\":{\"id\":\"rfgi\",\"related\":\"tcojocqwo\",\"resourceName\":\"nzjvusfzldm\"},\"environment\":{\"id\":\"xylfsb\",\"related\":\"adpysownbt\",\"resourceName\":\"bugrj\"},\"cloud\":\"to\"},\"status\":{\"phase\":\"isofieypefojyqd\"}}}]}"; - 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))); ConfluentManager manager = ConfluentManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)),