// Auto-generated by model-generator, source: oneshot_launch_data.conf
package ru.yandex.direct.oneshot.core.model;

import javax.annotation.Generated;
import javax.annotation.Nullable;

import ru.yandex.direct.dbschema.ppcdict.enums.OneshotLaunchDataLaunchStatus;

/**
 * состояние ван-шота */
@Generated(
        value = "ru.yandex.direct.model.generator.Tool",
        comments = "generated from oneshot_launch_data.conf"
)
public enum LaunchStatus {
    READY,

    IN_PROGRESS,

    FAILED,

    PAUSED,

    CANCELED,

    DONE,

    PAUSE_REQUESTED;

    @Nullable
    public static LaunchStatus fromSource(OneshotLaunchDataLaunchStatus value) {
        if (value == null) {
            return null;
        }
        switch(value) {
            case ready:
                    return READY;
            case in_progress:
                    return IN_PROGRESS;
            case failed:
                    return FAILED;
            case paused:
                    return PAUSED;
            case canceled:
                    return CANCELED;
            case done:
                    return DONE;
            case pause_requested:
                    return PAUSE_REQUESTED;
            default: throw new IllegalStateException("No such value: " + value);
        }
    }

    @Nullable
    public static OneshotLaunchDataLaunchStatus toSource(LaunchStatus value) {
        if (value == null) {
            return null;
        }
        switch(value) {
            case READY:
                    return OneshotLaunchDataLaunchStatus.ready;
            case IN_PROGRESS:
                    return OneshotLaunchDataLaunchStatus.in_progress;
            case FAILED:
                    return OneshotLaunchDataLaunchStatus.failed;
            case PAUSED:
                    return OneshotLaunchDataLaunchStatus.paused;
            case CANCELED:
                    return OneshotLaunchDataLaunchStatus.canceled;
            case DONE:
                    return OneshotLaunchDataLaunchStatus.done;
            case PAUSE_REQUESTED:
                    return OneshotLaunchDataLaunchStatus.pause_requested;
            default: throw new IllegalStateException("No such value: " + value);
        }
    }
}
