package com.dji.sdk.cloudapi.psdk;

import com.dji.sdk.common.BaseModel;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * Speaker TTS play start request
 * 
 * @author sean
 * @version 1.7
 * @date 2023/10/16
 */
public class SpeakerTtsPlayStartRequest extends BaseModel {

    /**
     * PSDK payload device index (0-3)
     */
    @NotNull
    @Min(0)
    private Integer psdkIndex;

    /**
     * TTS content
     */
    @NotNull
    @Valid
    private TtsContent tts;

    public SpeakerTtsPlayStartRequest() {
    }

    @Override
    public String toString() {
        return "SpeakerTtsPlayStartRequest{" +
                "psdkIndex=" + psdkIndex +
                ", tts=" + tts +
                '}';
    }

    public Integer getPsdkIndex() {
        return psdkIndex;
    }

    public SpeakerTtsPlayStartRequest setPsdkIndex(Integer psdkIndex) {
        this.psdkIndex = psdkIndex;
        return this;
    }

    public TtsContent getTts() {
        return tts;
    }

    public SpeakerTtsPlayStartRequest setTts(TtsContent tts) {
        this.tts = tts;
        return this;
    }

    public static class TtsContent {
        /**
         * TTS name
         */
        @NotNull
        private String name;

        /**
         * TTS text content
         */
        @NotNull
        private String text;

        /**
         * Content MD5 checksum
         */
        @NotNull
        private String md5;

        public TtsContent() {
        }

        @Override
        public String toString() {
            return "TtsContent{" +
                    "name='" + name + '\'' +
                    ", text='" + text + '\'' +
                    ", md5='" + md5 + '\'' +
                    '}';
        }

        public String getName() {
            return name;
        }

        public TtsContent setName(String name) {
            this.name = name;
            return this;
        }

        public String getText() {
            return text;
        }

        public TtsContent setText(String text) {
            this.text = text;
            return this;
        }

        public String getMd5() {
            return md5;
        }

        public TtsContent setMd5(String md5) {
            this.md5 = md5;
            return this;
        }
    }
}
