// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.ai.translation.text.models;

import com.azure.core.annotation.Immutable;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Element containing the translated text. */
@Immutable
public final class TranslatedTextItem {
    /*
     * The detectedLanguage property is only present in the result object when language auto-detection is requested.
     */
    @JsonProperty(value = "detectedLanguage")
    private DetectedLanguage detectedLanguage;

    /*
     * An array of translation results. The size of the array matches the number of target
     * languages specified through the to query parameter.
     */
    @JsonProperty(value = "translations", required = true)
    private List<Translation> translations;

    /*
     * Input text in the default script of the source language. sourceText property is present only when
     * the input is expressed in a script that's not the usual script for the language. For example,
     * if the input were Arabic written in Latin script, then sourceText.text would be the same Arabic text
     * converted into Arab script.
     */
    @JsonProperty(value = "sourceText")
    private SourceText sourceText;

    /**
     * Creates an instance of TranslatedTextItem class.
     *
     * @param translations the translations value to set.
     */
    @JsonCreator
    private TranslatedTextItem(@JsonProperty(value = "translations", required = true) List<Translation> translations) {
        this.translations = translations;
    }

    /**
     * Get the detectedLanguage property: The detectedLanguage property is only present in the result object when
     * language auto-detection is requested.
     *
     * @return the detectedLanguage value.
     */
    public DetectedLanguage getDetectedLanguage() {
        return this.detectedLanguage;
    }

    /**
     * Get the translations property: An array of translation results. The size of the array matches the number of
     * target languages specified through the to query parameter.
     *
     * @return the translations value.
     */
    public List<Translation> getTranslations() {
        return this.translations;
    }

    /**
     * Get the sourceText property: Input text in the default script of the source language. sourceText property is
     * present only when the input is expressed in a script that's not the usual script for the language. For example,
     * if the input were Arabic written in Latin script, then sourceText.text would be the same Arabic text converted
     * into Arab script.
     *
     * @return the sourceText value.
     */
    public SourceText getSourceText() {
        return this.sourceText;
    }
}
