public static InMageAzureV2ReplicationDetails fromJson()

in sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/src/main/java/com/azure/resourcemanager/recoveryservicessiterecovery/models/InMageAzureV2ReplicationDetails.java [1934:2124]


    public static InMageAzureV2ReplicationDetails fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            InMageAzureV2ReplicationDetails deserializedInMageAzureV2ReplicationDetails
                = new InMageAzureV2ReplicationDetails();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("instanceType".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.instanceType = reader.getString();
                } else if ("infrastructureVmId".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.infrastructureVmId = reader.getString();
                } else if ("vCenterInfrastructureId".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.vCenterInfrastructureId = reader.getString();
                } else if ("protectionStage".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.protectionStage = reader.getString();
                } else if ("vmId".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.vmId = reader.getString();
                } else if ("vmProtectionState".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.vmProtectionState = reader.getString();
                } else if ("vmProtectionStateDescription".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.vmProtectionStateDescription = reader.getString();
                } else if ("resyncProgressPercentage".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.resyncProgressPercentage
                        = reader.getNullable(JsonReader::getInt);
                } else if ("rpoInSeconds".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.rpoInSeconds = reader.getNullable(JsonReader::getLong);
                } else if ("compressedDataRateInMB".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.compressedDataRateInMB
                        = reader.getNullable(JsonReader::getDouble);
                } else if ("uncompressedDataRateInMB".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.uncompressedDataRateInMB
                        = reader.getNullable(JsonReader::getDouble);
                } else if ("ipAddress".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.ipAddress = reader.getString();
                } else if ("agentVersion".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.agentVersion = reader.getString();
                } else if ("agentExpiryDate".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.agentExpiryDate = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("isAgentUpdateRequired".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.isAgentUpdateRequired = reader.getString();
                } else if ("isRebootAfterUpdateRequired".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.isRebootAfterUpdateRequired = reader.getString();
                } else if ("lastHeartbeat".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.lastHeartbeat = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("processServerId".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.processServerId = reader.getString();
                } else if ("processServerName".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.processServerName = reader.getString();
                } else if ("multiVmGroupId".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.multiVmGroupId = reader.getString();
                } else if ("multiVmGroupName".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.multiVmGroupName = reader.getString();
                } else if ("multiVmSyncStatus".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.multiVmSyncStatus = reader.getString();
                } else if ("protectedDisks".equals(fieldName)) {
                    List<InMageAzureV2ProtectedDiskDetails> protectedDisks
                        = reader.readArray(reader1 -> InMageAzureV2ProtectedDiskDetails.fromJson(reader1));
                    deserializedInMageAzureV2ReplicationDetails.protectedDisks = protectedDisks;
                } else if ("diskResized".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.diskResized = reader.getString();
                } else if ("masterTargetId".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.masterTargetId = reader.getString();
                } else if ("sourceVmCpuCount".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.sourceVmCpuCount
                        = reader.getNullable(JsonReader::getInt);
                } else if ("sourceVmRamSizeInMB".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.sourceVmRamSizeInMB
                        = reader.getNullable(JsonReader::getInt);
                } else if ("osType".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.osType = reader.getString();
                } else if ("vhdName".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.vhdName = reader.getString();
                } else if ("osDiskId".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.osDiskId = reader.getString();
                } else if ("azureVMDiskDetails".equals(fieldName)) {
                    List<AzureVmDiskDetails> azureVMDiskDetails
                        = reader.readArray(reader1 -> AzureVmDiskDetails.fromJson(reader1));
                    deserializedInMageAzureV2ReplicationDetails.azureVMDiskDetails = azureVMDiskDetails;
                } else if ("recoveryAzureVMName".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.recoveryAzureVMName = reader.getString();
                } else if ("recoveryAzureVMSize".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.recoveryAzureVMSize = reader.getString();
                } else if ("recoveryAzureStorageAccount".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.recoveryAzureStorageAccount = reader.getString();
                } else if ("recoveryAzureLogStorageAccountId".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.recoveryAzureLogStorageAccountId = reader.getString();
                } else if ("vmNics".equals(fieldName)) {
                    List<VMNicDetails> vmNics = reader.readArray(reader1 -> VMNicDetails.fromJson(reader1));
                    deserializedInMageAzureV2ReplicationDetails.vmNics = vmNics;
                } else if ("selectedRecoveryAzureNetworkId".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.selectedRecoveryAzureNetworkId = reader.getString();
                } else if ("selectedTfoAzureNetworkId".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.selectedTfoAzureNetworkId = reader.getString();
                } else if ("selectedSourceNicId".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.selectedSourceNicId = reader.getString();
                } else if ("discoveryType".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.discoveryType = reader.getString();
                } else if ("enableRdpOnTargetOption".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.enableRdpOnTargetOption = reader.getString();
                } else if ("datastores".equals(fieldName)) {
                    List<String> datastores = reader.readArray(reader1 -> reader1.getString());
                    deserializedInMageAzureV2ReplicationDetails.datastores = datastores;
                } else if ("targetVmId".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.targetVmId = reader.getString();
                } else if ("recoveryAzureResourceGroupId".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.recoveryAzureResourceGroupId = reader.getString();
                } else if ("recoveryAvailabilitySetId".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.recoveryAvailabilitySetId = reader.getString();
                } else if ("targetAvailabilityZone".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.targetAvailabilityZone = reader.getString();
                } else if ("targetProximityPlacementGroupId".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.targetProximityPlacementGroupId = reader.getString();
                } else if ("useManagedDisks".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.useManagedDisks = reader.getString();
                } else if ("licenseType".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.licenseType = reader.getString();
                } else if ("sqlServerLicenseType".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.sqlServerLicenseType = reader.getString();
                } else if ("validationErrors".equals(fieldName)) {
                    List<HealthError> validationErrors = reader.readArray(reader1 -> HealthError.fromJson(reader1));
                    deserializedInMageAzureV2ReplicationDetails.validationErrors = validationErrors;
                } else if ("lastRpoCalculatedTime".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.lastRpoCalculatedTime = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("lastUpdateReceivedTime".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.lastUpdateReceivedTime = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("replicaId".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.replicaId = reader.getString();
                } else if ("osVersion".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.osVersion = reader.getString();
                } else if ("protectedManagedDisks".equals(fieldName)) {
                    List<InMageAzureV2ManagedDiskDetails> protectedManagedDisks
                        = reader.readArray(reader1 -> InMageAzureV2ManagedDiskDetails.fromJson(reader1));
                    deserializedInMageAzureV2ReplicationDetails.protectedManagedDisks = protectedManagedDisks;
                } else if ("lastRecoveryPointReceived".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.lastRecoveryPointReceived = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("firmwareType".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.firmwareType = reader.getString();
                } else if ("azureVmGeneration".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.azureVmGeneration = reader.getString();
                } else if ("isAdditionalStatsAvailable".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.isAdditionalStatsAvailable
                        = reader.getNullable(JsonReader::getBoolean);
                } else if ("totalDataTransferred".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.totalDataTransferred
                        = reader.getNullable(JsonReader::getLong);
                } else if ("totalProgressHealth".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.totalProgressHealth = reader.getString();
                } else if ("targetVmTags".equals(fieldName)) {
                    Map<String, String> targetVmTags = reader.readMap(reader1 -> reader1.getString());
                    deserializedInMageAzureV2ReplicationDetails.targetVmTags = targetVmTags;
                } else if ("seedManagedDiskTags".equals(fieldName)) {
                    Map<String, String> seedManagedDiskTags = reader.readMap(reader1 -> reader1.getString());
                    deserializedInMageAzureV2ReplicationDetails.seedManagedDiskTags = seedManagedDiskTags;
                } else if ("targetManagedDiskTags".equals(fieldName)) {
                    Map<String, String> targetManagedDiskTags = reader.readMap(reader1 -> reader1.getString());
                    deserializedInMageAzureV2ReplicationDetails.targetManagedDiskTags = targetManagedDiskTags;
                } else if ("targetNicTags".equals(fieldName)) {
                    Map<String, String> targetNicTags = reader.readMap(reader1 -> reader1.getString());
                    deserializedInMageAzureV2ReplicationDetails.targetNicTags = targetNicTags;
                } else if ("switchProviderBlockingErrorDetails".equals(fieldName)) {
                    List<InMageAzureV2SwitchProviderBlockingErrorDetails> switchProviderBlockingErrorDetails = reader
                        .readArray(reader1 -> InMageAzureV2SwitchProviderBlockingErrorDetails.fromJson(reader1));
                    deserializedInMageAzureV2ReplicationDetails.switchProviderBlockingErrorDetails
                        = switchProviderBlockingErrorDetails;
                } else if ("switchProviderDetails".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.switchProviderDetails
                        = InMageAzureV2SwitchProviderDetails.fromJson(reader);
                } else if ("supportedOSVersions".equals(fieldName)) {
                    List<String> supportedOSVersions = reader.readArray(reader1 -> reader1.getString());
                    deserializedInMageAzureV2ReplicationDetails.supportedOSVersions = supportedOSVersions;
                } else if ("allAvailableOSUpgradeConfigurations".equals(fieldName)) {
                    List<OSUpgradeSupportedVersions> allAvailableOSUpgradeConfigurations
                        = reader.readArray(reader1 -> OSUpgradeSupportedVersions.fromJson(reader1));
                    deserializedInMageAzureV2ReplicationDetails.allAvailableOSUpgradeConfigurations
                        = allAvailableOSUpgradeConfigurations;
                } else if ("osName".equals(fieldName)) {
                    deserializedInMageAzureV2ReplicationDetails.osName = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedInMageAzureV2ReplicationDetails;
        });
    }