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

namespace Grafeas\V1;

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

/**
 * Details about the layer a package was found in.
 *
 * Generated from protobuf message <code>grafeas.v1.LayerDetails</code>
 */
class LayerDetails extends \Google\Protobuf\Internal\Message
{
    /**
     * The index of the layer in the container image.
     *
     * Generated from protobuf field <code>int32 index = 1;</code>
     */
    protected $index = 0;
    /**
     * The diff ID (typically a sha256 hash) of the layer in the container image.
     *
     * Generated from protobuf field <code>string diff_id = 2;</code>
     */
    protected $diff_id = '';
    /**
     * The layer chain ID (sha256 hash) of the layer in the container image.
     * https://github.com/opencontainers/image-spec/blob/main/config.md#layer-chainid
     *
     * Generated from protobuf field <code>string chain_id = 5;</code>
     */
    protected $chain_id = '';
    /**
     * The layer build command that was used to build the layer. This may not be
     * found in all layers depending on how the container image is built.
     *
     * Generated from protobuf field <code>string command = 3;</code>
     */
    protected $command = '';
    /**
     * The base images the layer is found within.
     *
     * Generated from protobuf field <code>repeated .grafeas.v1.BaseImage base_images = 4;</code>
     */
    private $base_images;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $index
     *           The index of the layer in the container image.
     *     @type string $diff_id
     *           The diff ID (typically a sha256 hash) of the layer in the container image.
     *     @type string $chain_id
     *           The layer chain ID (sha256 hash) of the layer in the container image.
     *           https://github.com/opencontainers/image-spec/blob/main/config.md#layer-chainid
     *     @type string $command
     *           The layer build command that was used to build the layer. This may not be
     *           found in all layers depending on how the container image is built.
     *     @type array<\Grafeas\V1\BaseImage>|\Google\Protobuf\Internal\RepeatedField $base_images
     *           The base images the layer is found within.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Grafeas\V1\Common::initOnce();
        parent::__construct($data);
    }

    /**
     * The index of the layer in the container image.
     *
     * Generated from protobuf field <code>int32 index = 1;</code>
     * @return int
     */
    public function getIndex()
    {
        return $this->index;
    }

    /**
     * The index of the layer in the container image.
     *
     * Generated from protobuf field <code>int32 index = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setIndex($var)
    {
        GPBUtil::checkInt32($var);
        $this->index = $var;

        return $this;
    }

    /**
     * The diff ID (typically a sha256 hash) of the layer in the container image.
     *
     * Generated from protobuf field <code>string diff_id = 2;</code>
     * @return string
     */
    public function getDiffId()
    {
        return $this->diff_id;
    }

    /**
     * The diff ID (typically a sha256 hash) of the layer in the container image.
     *
     * Generated from protobuf field <code>string diff_id = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setDiffId($var)
    {
        GPBUtil::checkString($var, True);
        $this->diff_id = $var;

        return $this;
    }

    /**
     * The layer chain ID (sha256 hash) of the layer in the container image.
     * https://github.com/opencontainers/image-spec/blob/main/config.md#layer-chainid
     *
     * Generated from protobuf field <code>string chain_id = 5;</code>
     * @return string
     */
    public function getChainId()
    {
        return $this->chain_id;
    }

    /**
     * The layer chain ID (sha256 hash) of the layer in the container image.
     * https://github.com/opencontainers/image-spec/blob/main/config.md#layer-chainid
     *
     * Generated from protobuf field <code>string chain_id = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setChainId($var)
    {
        GPBUtil::checkString($var, True);
        $this->chain_id = $var;

        return $this;
    }

    /**
     * The layer build command that was used to build the layer. This may not be
     * found in all layers depending on how the container image is built.
     *
     * Generated from protobuf field <code>string command = 3;</code>
     * @return string
     */
    public function getCommand()
    {
        return $this->command;
    }

    /**
     * The layer build command that was used to build the layer. This may not be
     * found in all layers depending on how the container image is built.
     *
     * Generated from protobuf field <code>string command = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setCommand($var)
    {
        GPBUtil::checkString($var, True);
        $this->command = $var;

        return $this;
    }

    /**
     * The base images the layer is found within.
     *
     * Generated from protobuf field <code>repeated .grafeas.v1.BaseImage base_images = 4;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getBaseImages()
    {
        return $this->base_images;
    }

    /**
     * The base images the layer is found within.
     *
     * Generated from protobuf field <code>repeated .grafeas.v1.BaseImage base_images = 4;</code>
     * @param array<\Grafeas\V1\BaseImage>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setBaseImages($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Grafeas\V1\BaseImage::class);
        $this->base_images = $arr;

        return $this;
    }

}

