<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/language/v2/language_service.proto

namespace Google\Cloud\Language\V2;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * The document moderation response message.
 *
 * Generated from protobuf message <code>google.cloud.language.v2.ModerateTextResponse</code>
 */
class ModerateTextResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * Harmful and sensitive categories representing the input document.
     *
     * Generated from protobuf field <code>repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 1;</code>
     */
    private $moderation_categories;
    /**
     * The language of the text, which will be the same as the language specified
     * in the request or, if not specified, the automatically-detected language.
     * See [Document.language][] field for more details.
     *
     * Generated from protobuf field <code>string language_code = 2;</code>
     */
    private $language_code = '';
    /**
     * Whether the language is officially supported. The API may still return a
     * response when the language is not supported, but it is on a best effort
     * basis.
     *
     * Generated from protobuf field <code>bool language_supported = 3;</code>
     */
    private $language_supported = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Cloud\Language\V2\ClassificationCategory>|\Google\Protobuf\Internal\RepeatedField $moderation_categories
     *           Harmful and sensitive categories representing the input document.
     *     @type string $language_code
     *           The language of the text, which will be the same as the language specified
     *           in the request or, if not specified, the automatically-detected language.
     *           See [Document.language][] field for more details.
     *     @type bool $language_supported
     *           Whether the language is officially supported. The API may still return a
     *           response when the language is not supported, but it is on a best effort
     *           basis.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Language\V2\LanguageService::initOnce();
        parent::__construct($data);
    }

    /**
     * Harmful and sensitive categories representing the input document.
     *
     * Generated from protobuf field <code>repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getModerationCategories()
    {
        return $this->moderation_categories;
    }

    /**
     * Harmful and sensitive categories representing the input document.
     *
     * Generated from protobuf field <code>repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 1;</code>
     * @param array<\Google\Cloud\Language\V2\ClassificationCategory>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setModerationCategories($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Language\V2\ClassificationCategory::class);
        $this->moderation_categories = $arr;

        return $this;
    }

    /**
     * The language of the text, which will be the same as the language specified
     * in the request or, if not specified, the automatically-detected language.
     * See [Document.language][] field for more details.
     *
     * Generated from protobuf field <code>string language_code = 2;</code>
     * @return string
     */
    public function getLanguageCode()
    {
        return $this->language_code;
    }

    /**
     * The language of the text, which will be the same as the language specified
     * in the request or, if not specified, the automatically-detected language.
     * See [Document.language][] field for more details.
     *
     * Generated from protobuf field <code>string language_code = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setLanguageCode($var)
    {
        GPBUtil::checkString($var, True);
        $this->language_code = $var;

        return $this;
    }

    /**
     * Whether the language is officially supported. The API may still return a
     * response when the language is not supported, but it is on a best effort
     * basis.
     *
     * Generated from protobuf field <code>bool language_supported = 3;</code>
     * @return bool
     */
    public function getLanguageSupported()
    {
        return $this->language_supported;
    }

    /**
     * Whether the language is officially supported. The API may still return a
     * response when the language is not supported, but it is on a best effort
     * basis.
     *
     * Generated from protobuf field <code>bool language_supported = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setLanguageSupported($var)
    {
        GPBUtil::checkBool($var);
        $this->language_supported = $var;

        return $this;
    }

}

