<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/video/stitcher/v1/companions.proto

namespace Google\Cloud\Video\Stitcher\V1;

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

/**
 * Metadata for companion ads.
 *
 * Generated from protobuf message <code>google.cloud.video.stitcher.v1.CompanionAds</code>
 */
class CompanionAds extends \Google\Protobuf\Internal\Message
{
    /**
     * Indicates how many of the companions should be displayed with the ad.
     *
     * Generated from protobuf field <code>.google.cloud.video.stitcher.v1.CompanionAds.DisplayRequirement display_requirement = 1;</code>
     */
    private $display_requirement = 0;
    /**
     * List of companion ads.
     *
     * Generated from protobuf field <code>repeated .google.cloud.video.stitcher.v1.Companion companions = 2;</code>
     */
    private $companions;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $display_requirement
     *           Indicates how many of the companions should be displayed with the ad.
     *     @type array<\Google\Cloud\Video\Stitcher\V1\Companion>|\Google\Protobuf\Internal\RepeatedField $companions
     *           List of companion ads.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Video\Stitcher\V1\Companions::initOnce();
        parent::__construct($data);
    }

    /**
     * Indicates how many of the companions should be displayed with the ad.
     *
     * Generated from protobuf field <code>.google.cloud.video.stitcher.v1.CompanionAds.DisplayRequirement display_requirement = 1;</code>
     * @return int
     */
    public function getDisplayRequirement()
    {
        return $this->display_requirement;
    }

    /**
     * Indicates how many of the companions should be displayed with the ad.
     *
     * Generated from protobuf field <code>.google.cloud.video.stitcher.v1.CompanionAds.DisplayRequirement display_requirement = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setDisplayRequirement($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Video\Stitcher\V1\CompanionAds\DisplayRequirement::class);
        $this->display_requirement = $var;

        return $this;
    }

    /**
     * List of companion ads.
     *
     * Generated from protobuf field <code>repeated .google.cloud.video.stitcher.v1.Companion companions = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getCompanions()
    {
        return $this->companions;
    }

    /**
     * List of companion ads.
     *
     * Generated from protobuf field <code>repeated .google.cloud.video.stitcher.v1.Companion companions = 2;</code>
     * @param array<\Google\Cloud\Video\Stitcher\V1\Companion>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setCompanions($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Video\Stitcher\V1\Companion::class);
        $this->companions = $arr;

        return $this;
    }

}

