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 audio play start request
 * 
 * @author sean
 * @version 1.7
 * @date 2023/10/16
 */
public class SpeakerAudioPlayStartRequest extends BaseModel {

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

    /**
     * Audio file information
     */
    @NotNull
    @Valid
    private AudioFile file;

    public SpeakerAudioPlayStartRequest() {
    }

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

    public Integer getPsdkIndex() {
        return psdkIndex;
    }

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

    public AudioFile getFile() {
        return file;
    }

    public SpeakerAudioPlayStartRequest setFile(AudioFile file) {
        this.file = file;
        return this;
    }

    public static class AudioFile {
        /**
         * File name
         */
        @NotNull
        private String name;

        /**
         * File download URL
         */
        @NotNull
        private String url;

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

        /**
         * Audio format (pcm)
         */
        @NotNull
        private String format;

        public AudioFile() {
        }

        @Override
        public String toString() {
            return "AudioFile{" +
                    "name='" + name + '\'' +
                    ", url='" + url + '\'' +
                    ", md5='" + md5 + '\'' +
                    ", format='" + format + '\'' +
                    '}';
        }

        public String getName() {
            return name;
        }

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

        public String getUrl() {
            return url;
        }

        public AudioFile setUrl(String url) {
            this.url = url;
            return this;
        }

        public String getMd5() {
            return md5;
        }

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

        public String getFormat() {
            return format;
        }

        public AudioFile setFormat(String format) {
            this.format = format;
            return this;
        }
    }
}
