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

namespace Google\Cloud\AIPlatform\V1;

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

/**
 * A resource used in LLM queries for users to explicitly specify what to cache
 * and how to cache.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.CachedContent</code>
 */
class CachedContent extends \Google\Protobuf\Internal\Message
{
    /**
     * Immutable. Identifier. The server-generated resource name of the cached
     * content Format:
     * projects/{project}/locations/{location}/cachedContents/{cached_content}
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = IMMUTABLE];</code>
     */
    protected $name = '';
    /**
     * Optional. Immutable. The user-generated meaningful display name of the
     * cached content.
     *
     * Generated from protobuf field <code>string display_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     */
    protected $display_name = '';
    /**
     * Immutable. The name of the `Model` to use for cached content. Currently,
     * only the published Gemini base models are supported, in form of
     * projects/{PROJECT}/locations/{LOCATION}/publishers/google/models/{MODEL}
     *
     * Generated from protobuf field <code>string model = 2 [(.google.api.field_behavior) = IMMUTABLE];</code>
     */
    protected $model = '';
    /**
     * Optional. Input only. Immutable. Developer set system instruction.
     * Currently, text only
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.Content system_instruction = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];</code>
     */
    protected $system_instruction = null;
    /**
     * Optional. Input only. Immutable. The content to cache
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];</code>
     */
    private $contents;
    /**
     * Optional. Input only. Immutable. A list of `Tools` the model may use to
     * generate the next response
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Tool tools = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];</code>
     */
    private $tools;
    /**
     * Optional. Input only. Immutable. Tool config. This config is shared for all
     * tools
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.ToolConfig tool_config = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];</code>
     */
    protected $tool_config = null;
    /**
     * Output only. Creation time of the cache entry.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $create_time = null;
    /**
     * Output only. When the cache entry was last updated in UTC time.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $update_time = null;
    /**
     * Output only. Metadata on the usage of the cached content.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.CachedContent.UsageMetadata usage_metadata = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $usage_metadata = null;
    /**
     * Input only. Immutable. Customer-managed encryption key spec for a
     * `CachedContent`. If set, this `CachedContent` and all its sub-resources
     * will be secured by this key.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 13 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE];</code>
     */
    protected $encryption_spec = null;
    protected $expiration;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Timestamp $expire_time
     *           Timestamp of when this resource is considered expired.
     *           This is *always* provided on output, regardless of what was sent
     *           on input.
     *     @type \Google\Protobuf\Duration $ttl
     *           Input only. The TTL for this resource. The expiration time is computed:
     *           now + TTL.
     *     @type string $name
     *           Immutable. Identifier. The server-generated resource name of the cached
     *           content Format:
     *           projects/{project}/locations/{location}/cachedContents/{cached_content}
     *     @type string $display_name
     *           Optional. Immutable. The user-generated meaningful display name of the
     *           cached content.
     *     @type string $model
     *           Immutable. The name of the `Model` to use for cached content. Currently,
     *           only the published Gemini base models are supported, in form of
     *           projects/{PROJECT}/locations/{LOCATION}/publishers/google/models/{MODEL}
     *     @type \Google\Cloud\AIPlatform\V1\Content $system_instruction
     *           Optional. Input only. Immutable. Developer set system instruction.
     *           Currently, text only
     *     @type array<\Google\Cloud\AIPlatform\V1\Content>|\Google\Protobuf\Internal\RepeatedField $contents
     *           Optional. Input only. Immutable. The content to cache
     *     @type array<\Google\Cloud\AIPlatform\V1\Tool>|\Google\Protobuf\Internal\RepeatedField $tools
     *           Optional. Input only. Immutable. A list of `Tools` the model may use to
     *           generate the next response
     *     @type \Google\Cloud\AIPlatform\V1\ToolConfig $tool_config
     *           Optional. Input only. Immutable. Tool config. This config is shared for all
     *           tools
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. Creation time of the cache entry.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. When the cache entry was last updated in UTC time.
     *     @type \Google\Cloud\AIPlatform\V1\CachedContent\UsageMetadata $usage_metadata
     *           Output only. Metadata on the usage of the cached content.
     *     @type \Google\Cloud\AIPlatform\V1\EncryptionSpec $encryption_spec
     *           Input only. Immutable. Customer-managed encryption key spec for a
     *           `CachedContent`. If set, this `CachedContent` and all its sub-resources
     *           will be secured by this key.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\CachedContent::initOnce();
        parent::__construct($data);
    }

    /**
     * Timestamp of when this resource is considered expired.
     * This is *always* provided on output, regardless of what was sent
     * on input.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp expire_time = 9;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getExpireTime()
    {
        return $this->readOneof(9);
    }

    public function hasExpireTime()
    {
        return $this->hasOneof(9);
    }

    /**
     * Timestamp of when this resource is considered expired.
     * This is *always* provided on output, regardless of what was sent
     * on input.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp expire_time = 9;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setExpireTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->writeOneof(9, $var);

        return $this;
    }

    /**
     * Input only. The TTL for this resource. The expiration time is computed:
     * now + TTL.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration ttl = 10 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getTtl()
    {
        return $this->readOneof(10);
    }

    public function hasTtl()
    {
        return $this->hasOneof(10);
    }

    /**
     * Input only. The TTL for this resource. The expiration time is computed:
     * now + TTL.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration ttl = 10 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setTtl($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->writeOneof(10, $var);

        return $this;
    }

    /**
     * Immutable. Identifier. The server-generated resource name of the cached
     * content Format:
     * projects/{project}/locations/{location}/cachedContents/{cached_content}
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Immutable. Identifier. The server-generated resource name of the cached
     * content Format:
     * projects/{project}/locations/{location}/cachedContents/{cached_content}
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Optional. Immutable. The user-generated meaningful display name of the
     * cached content.
     *
     * Generated from protobuf field <code>string display_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return string
     */
    public function getDisplayName()
    {
        return $this->display_name;
    }

    /**
     * Optional. Immutable. The user-generated meaningful display name of the
     * cached content.
     *
     * Generated from protobuf field <code>string display_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param string $var
     * @return $this
     */
    public function setDisplayName($var)
    {
        GPBUtil::checkString($var, True);
        $this->display_name = $var;

        return $this;
    }

    /**
     * Immutable. The name of the `Model` to use for cached content. Currently,
     * only the published Gemini base models are supported, in form of
     * projects/{PROJECT}/locations/{LOCATION}/publishers/google/models/{MODEL}
     *
     * Generated from protobuf field <code>string model = 2 [(.google.api.field_behavior) = IMMUTABLE];</code>
     * @return string
     */
    public function getModel()
    {
        return $this->model;
    }

    /**
     * Immutable. The name of the `Model` to use for cached content. Currently,
     * only the published Gemini base models are supported, in form of
     * projects/{PROJECT}/locations/{LOCATION}/publishers/google/models/{MODEL}
     *
     * Generated from protobuf field <code>string model = 2 [(.google.api.field_behavior) = IMMUTABLE];</code>
     * @param string $var
     * @return $this
     */
    public function setModel($var)
    {
        GPBUtil::checkString($var, True);
        $this->model = $var;

        return $this;
    }

    /**
     * Optional. Input only. Immutable. Developer set system instruction.
     * Currently, text only
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.Content system_instruction = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];</code>
     * @return \Google\Cloud\AIPlatform\V1\Content|null
     */
    public function getSystemInstruction()
    {
        return $this->system_instruction;
    }

    public function hasSystemInstruction()
    {
        return isset($this->system_instruction);
    }

    public function clearSystemInstruction()
    {
        unset($this->system_instruction);
    }

    /**
     * Optional. Input only. Immutable. Developer set system instruction.
     * Currently, text only
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.Content system_instruction = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];</code>
     * @param \Google\Cloud\AIPlatform\V1\Content $var
     * @return $this
     */
    public function setSystemInstruction($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\Content::class);
        $this->system_instruction = $var;

        return $this;
    }

    /**
     * Optional. Input only. Immutable. The content to cache
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getContents()
    {
        return $this->contents;
    }

    /**
     * Optional. Input only. Immutable. The content to cache
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Content contents = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];</code>
     * @param array<\Google\Cloud\AIPlatform\V1\Content>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setContents($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\Content::class);
        $this->contents = $arr;

        return $this;
    }

    /**
     * Optional. Input only. Immutable. A list of `Tools` the model may use to
     * generate the next response
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Tool tools = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getTools()
    {
        return $this->tools;
    }

    /**
     * Optional. Input only. Immutable. A list of `Tools` the model may use to
     * generate the next response
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Tool tools = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];</code>
     * @param array<\Google\Cloud\AIPlatform\V1\Tool>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setTools($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\Tool::class);
        $this->tools = $arr;

        return $this;
    }

    /**
     * Optional. Input only. Immutable. Tool config. This config is shared for all
     * tools
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.ToolConfig tool_config = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];</code>
     * @return \Google\Cloud\AIPlatform\V1\ToolConfig|null
     */
    public function getToolConfig()
    {
        return $this->tool_config;
    }

    public function hasToolConfig()
    {
        return isset($this->tool_config);
    }

    public function clearToolConfig()
    {
        unset($this->tool_config);
    }

    /**
     * Optional. Input only. Immutable. Tool config. This config is shared for all
     * tools
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.ToolConfig tool_config = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = INPUT_ONLY];</code>
     * @param \Google\Cloud\AIPlatform\V1\ToolConfig $var
     * @return $this
     */
    public function setToolConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\ToolConfig::class);
        $this->tool_config = $var;

        return $this;
    }

    /**
     * Output only. Creation time of the cache entry.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Output only. Creation time of the cache entry.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Output only. When the cache entry was last updated in UTC time.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getUpdateTime()
    {
        return $this->update_time;
    }

    public function hasUpdateTime()
    {
        return isset($this->update_time);
    }

    public function clearUpdateTime()
    {
        unset($this->update_time);
    }

    /**
     * Output only. When the cache entry was last updated in UTC time.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->update_time = $var;

        return $this;
    }

    /**
     * Output only. Metadata on the usage of the cached content.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.CachedContent.UsageMetadata usage_metadata = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\AIPlatform\V1\CachedContent\UsageMetadata|null
     */
    public function getUsageMetadata()
    {
        return $this->usage_metadata;
    }

    public function hasUsageMetadata()
    {
        return isset($this->usage_metadata);
    }

    public function clearUsageMetadata()
    {
        unset($this->usage_metadata);
    }

    /**
     * Output only. Metadata on the usage of the cached content.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.CachedContent.UsageMetadata usage_metadata = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\AIPlatform\V1\CachedContent\UsageMetadata $var
     * @return $this
     */
    public function setUsageMetadata($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\CachedContent\UsageMetadata::class);
        $this->usage_metadata = $var;

        return $this;
    }

    /**
     * Input only. Immutable. Customer-managed encryption key spec for a
     * `CachedContent`. If set, this `CachedContent` and all its sub-resources
     * will be secured by this key.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 13 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return \Google\Cloud\AIPlatform\V1\EncryptionSpec|null
     */
    public function getEncryptionSpec()
    {
        return $this->encryption_spec;
    }

    public function hasEncryptionSpec()
    {
        return isset($this->encryption_spec);
    }

    public function clearEncryptionSpec()
    {
        unset($this->encryption_spec);
    }

    /**
     * Input only. Immutable. Customer-managed encryption key spec for a
     * `CachedContent`. If set, this `CachedContent` and all its sub-resources
     * will be secured by this key.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.EncryptionSpec encryption_spec = 13 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param \Google\Cloud\AIPlatform\V1\EncryptionSpec $var
     * @return $this
     */
    public function setEncryptionSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\EncryptionSpec::class);
        $this->encryption_spec = $var;

        return $this;
    }

    /**
     * @return string
     */
    public function getExpiration()
    {
        return $this->whichOneof("expiration");
    }

}

