// Path: src/main/java/com/verifalia/api/common/serialization/DurationDeserializer.java
// public class DurationDeserializer extends JsonDeserializer<Duration> {
//     @Override
//     public Duration deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
//         String durationString = jsonParser.getText();
// 
//         if (durationString == null) {
//             return null;
//         }
// 
//         return parseDuration(durationString);
//     }
// 
//     private Duration parseDuration(@NonNull String inputData) {
//         inputData = inputData.trim();
// 
//         // Parse the eventual days information
// 
//         String[] dayFields = inputData.split("\\.");
// 
//         if (dayFields.length > 2) {
//             throw new IllegalArgumentException();
//         }
// 
//         int days = 0;
//         String timeData = inputData;
// 
//         if (dayFields.length == 2) {
//             days = Integer.parseInt(dayFields[0]);
//             timeData = dayFields[1];
//         }
// 
//         // Parse the time information
// 
//         String[] timeFields = timeData.split(":");
// 
//         if (timeFields.length != 3) {
//             throw new IllegalArgumentException();
//         }
// 
//         return Duration.ofSeconds((days * 24 * 60 * 60) +
//                 (Integer.parseInt(timeFields[0]) * 60 * 60) +
//                 (Integer.parseInt(timeFields[1]) * 60) +
//                 (Integer.parseInt(timeFields[2])));
//     }
// }


import com.verifalia.api.common.serialization.DurationDeserializer;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.codehaus.jackson.map.annotate.JsonDeserialize;
import java.time.Duration;
/*
 * Verifalia - Email list cleaning and real-time email verification service
 * https://verifalia.com/
 * support@verifalia.com
 *
 * Copyright (c) 2005-2020 Cobisi Research
 *
 * Cobisi Research
 * Via Prima Strada, 35
 * 35129, Padova
 * Italy - European Union
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package com.verifalia.api.emailvalidations.models;



/**
 * Progress details for a {@link ValidationOverview}, exposed by way of the {@link ValidationOverview#progress} property.
 */
@Getter
@Setter
@ToString
public class ValidationProgress {

    /**
     * The percentage of completed entries, ranging from 0 to 1.
     */
    private Double percentage;

    /**
     * An eventual estimated required time span needed to complete the whole job.
     */
// Path: src/main/java/com/verifalia/api/common/serialization/DurationDeserializer.java
// public class DurationDeserializer extends JsonDeserializer<Duration> {
//     @Override
//     public Duration deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
//         String durationString = jsonParser.getText();
// 
//         if (durationString == null) {
//             return null;
//         }
// 
//         return parseDuration(durationString);
//     }
// 
//     private Duration parseDuration(@NonNull String inputData) {
//         inputData = inputData.trim();
// 
//         // Parse the eventual days information
// 
//         String[] dayFields = inputData.split("\\.");
// 
//         if (dayFields.length > 2) {
//             throw new IllegalArgumentException();
//         }
// 
//         int days = 0;
//         String timeData = inputData;
// 
//         if (dayFields.length == 2) {
//             days = Integer.parseInt(dayFields[0]);
//             timeData = dayFields[1];
//         }
// 
//         // Parse the time information
// 
//         String[] timeFields = timeData.split(":");
// 
//         if (timeFields.length != 3) {
//             throw new IllegalArgumentException();
//         }
// 
//         return Duration.ofSeconds((days * 24 * 60 * 60) +
//                 (Integer.parseInt(timeFields[0]) * 60 * 60) +
//                 (Integer.parseInt(timeFields[1]) * 60) +
//                 (Integer.parseInt(timeFields[2])));
//     }
// }


// Path: src/main/java/com/verifalia/api/emailvalidations/models/ValidationProgress.java
import com.verifalia.api.common.serialization.DurationDeserializer;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.codehaus.jackson.map.annotate.JsonDeserialize;
import java.time.Duration;

/*
 * Verifalia - Email list cleaning and real-time email verification service
 * https://verifalia.com/
 * support@verifalia.com
 *
 * Copyright (c) 2005-2020 Cobisi Research
 *
 * Cobisi Research
 * Via Prima Strada, 35
 * 35129, Padova
 * Italy - European Union
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package com.verifalia.api.emailvalidations.models;



/**
 * Progress details for a {@link ValidationOverview}, exposed by way of the {@link ValidationOverview#progress} property.
 */
@Getter
@Setter
@ToString
public class ValidationProgress {

    /**
     * The percentage of completed entries, ranging from 0 to 1.
     */
    private Double percentage;

    /**
     * An eventual estimated required time span needed to complete the whole job.
     */
    @JsonDeserialize(using = DurationDeserializer.class)