<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/devtools/cloudbuild/v1/cloudbuild.proto

namespace Google\Cloud\Build\V1;

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

/**
 * Response including listed builds.
 *
 * Generated from protobuf message <code>google.devtools.cloudbuild.v1.ListBuildsResponse</code>
 */
class ListBuildsResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * Builds will be sorted by `create_time`, descending.
     *
     * Generated from protobuf field <code>repeated .google.devtools.cloudbuild.v1.Build builds = 1;</code>
     */
    private $builds;
    /**
     * Token to receive the next page of results.
     * This will be absent if the end of the response list has been reached.
     *
     * Generated from protobuf field <code>string next_page_token = 2;</code>
     */
    private $next_page_token = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Cloud\Build\V1\Build>|\Google\Protobuf\Internal\RepeatedField $builds
     *           Builds will be sorted by `create_time`, descending.
     *     @type string $next_page_token
     *           Token to receive the next page of results.
     *           This will be absent if the end of the response list has been reached.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce();
        parent::__construct($data);
    }

    /**
     * Builds will be sorted by `create_time`, descending.
     *
     * Generated from protobuf field <code>repeated .google.devtools.cloudbuild.v1.Build builds = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getBuilds()
    {
        return $this->builds;
    }

    /**
     * Builds will be sorted by `create_time`, descending.
     *
     * Generated from protobuf field <code>repeated .google.devtools.cloudbuild.v1.Build builds = 1;</code>
     * @param array<\Google\Cloud\Build\V1\Build>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setBuilds($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\Build::class);
        $this->builds = $arr;

        return $this;
    }

    /**
     * Token to receive the next page of results.
     * This will be absent if the end of the response list has been reached.
     *
     * Generated from protobuf field <code>string next_page_token = 2;</code>
     * @return string
     */
    public function getNextPageToken()
    {
        return $this->next_page_token;
    }

    /**
     * Token to receive the next page of results.
     * This will be absent if the end of the response list has been reached.
     *
     * Generated from protobuf field <code>string next_page_token = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setNextPageToken($var)
    {
        GPBUtil::checkString($var, True);
        $this->next_page_token = $var;

        return $this;
    }

}

