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

namespace Google\Cloud\NetworkServices\V1;

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

/**
 * `WasmPlugin` is a resource representing a service executing
 * a customer-provided Wasm module.
 *
 * Generated from protobuf message <code>google.cloud.networkservices.v1.WasmPlugin</code>
 */
class WasmPlugin extends \Google\Protobuf\Internal\Message
{
    /**
     * Identifier. Name of the `WasmPlugin` resource in the following format:
     * `projects/{project}/locations/{location}/wasmPlugins/{wasm_plugin}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     */
    protected $name = '';
    /**
     * Output only. The timestamp when the resource was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $create_time = null;
    /**
     * Output only. The timestamp when the resource was updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $update_time = null;
    /**
     * Optional. A human-readable description of the resource.
     *
     * Generated from protobuf field <code>string description = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $description = '';
    /**
     * Optional. Set of labels associated with the `WasmPlugin` resource.
     * The format must comply with [the following
     * requirements](/compute/docs/labeling-resources#requirements).
     *
     * Generated from protobuf field <code>map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $labels;
    /**
     * Optional. The ID of the `WasmPluginVersion` resource that is the
     * currently serving one. The version referred to must be a child of this
     * `WasmPlugin` resource.
     *
     * Generated from protobuf field <code>string main_version_id = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $main_version_id = '';
    /**
     * Optional. Specifies the logging options for the activity performed by this
     * plugin. If logging is enabled, plugin logs are exported to
     * Cloud Logging.
     * Note that the settings relate to the logs generated by using
     * logging statements in your Wasm code.
     *
     * Generated from protobuf field <code>.google.cloud.networkservices.v1.WasmPlugin.LogConfig log_config = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $log_config = null;
    /**
     * Optional. All versions of this `WasmPlugin` resource in the key-value
     * format. The key is the resource ID, and the value is the `VersionDetails`
     * object.
     * Lets you create or update a `WasmPlugin` resource and its versions in a
     * single request. When the `main_version_id` field is not empty, it must
     * point to one of the `VersionDetails` objects in the map.
     * If provided in a `PATCH` request, the new versions replace the
     * previous set. Any version omitted from the `versions` field is removed.
     * Because the `WasmPluginVersion` resource is immutable, if a
     * `WasmPluginVersion` resource with the same name already exists and differs,
     * the request fails.
     * Note: In a `GET` request, this field is populated only if the field
     * `GetWasmPluginRequest.view` is set to `WASM_PLUGIN_VIEW_FULL`.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.networkservices.v1.WasmPlugin.VersionDetails> versions = 10 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $versions;
    /**
     * Output only. List of all
     * [extensions](https://cloud.google.com/service-extensions/docs/overview)
     * that use this `WasmPlugin` resource.
     *
     * Generated from protobuf field <code>repeated .google.cloud.networkservices.v1.WasmPlugin.UsedBy used_by = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $used_by;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Identifier. Name of the `WasmPlugin` resource in the following format:
     *           `projects/{project}/locations/{location}/wasmPlugins/{wasm_plugin}`.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. The timestamp when the resource was created.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. The timestamp when the resource was updated.
     *     @type string $description
     *           Optional. A human-readable description of the resource.
     *     @type array|\Google\Protobuf\Internal\MapField $labels
     *           Optional. Set of labels associated with the `WasmPlugin` resource.
     *           The format must comply with [the following
     *           requirements](/compute/docs/labeling-resources#requirements).
     *     @type string $main_version_id
     *           Optional. The ID of the `WasmPluginVersion` resource that is the
     *           currently serving one. The version referred to must be a child of this
     *           `WasmPlugin` resource.
     *     @type \Google\Cloud\NetworkServices\V1\WasmPlugin\LogConfig $log_config
     *           Optional. Specifies the logging options for the activity performed by this
     *           plugin. If logging is enabled, plugin logs are exported to
     *           Cloud Logging.
     *           Note that the settings relate to the logs generated by using
     *           logging statements in your Wasm code.
     *     @type array|\Google\Protobuf\Internal\MapField $versions
     *           Optional. All versions of this `WasmPlugin` resource in the key-value
     *           format. The key is the resource ID, and the value is the `VersionDetails`
     *           object.
     *           Lets you create or update a `WasmPlugin` resource and its versions in a
     *           single request. When the `main_version_id` field is not empty, it must
     *           point to one of the `VersionDetails` objects in the map.
     *           If provided in a `PATCH` request, the new versions replace the
     *           previous set. Any version omitted from the `versions` field is removed.
     *           Because the `WasmPluginVersion` resource is immutable, if a
     *           `WasmPluginVersion` resource with the same name already exists and differs,
     *           the request fails.
     *           Note: In a `GET` request, this field is populated only if the field
     *           `GetWasmPluginRequest.view` is set to `WASM_PLUGIN_VIEW_FULL`.
     *     @type array<\Google\Cloud\NetworkServices\V1\WasmPlugin\UsedBy>|\Google\Protobuf\Internal\RepeatedField $used_by
     *           Output only. List of all
     *           [extensions](https://cloud.google.com/service-extensions/docs/overview)
     *           that use this `WasmPlugin` resource.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Networkservices\V1\Extensibility::initOnce();
        parent::__construct($data);
    }

    /**
     * Identifier. Name of the `WasmPlugin` resource in the following format:
     * `projects/{project}/locations/{location}/wasmPlugins/{wasm_plugin}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Identifier. Name of the `WasmPlugin` resource in the following format:
     * `projects/{project}/locations/{location}/wasmPlugins/{wasm_plugin}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Output only. The timestamp when the resource was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 2 [(.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. The timestamp when the resource was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 2 [(.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. The timestamp when the resource was updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.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. The timestamp when the resource was updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.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;
    }

    /**
     * Optional. A human-readable description of the resource.
     *
     * Generated from protobuf field <code>string description = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Optional. A human-readable description of the resource.
     *
     * Generated from protobuf field <code>string description = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * Optional. Set of labels associated with the `WasmPlugin` resource.
     * The format must comply with [the following
     * requirements](/compute/docs/labeling-resources#requirements).
     *
     * Generated from protobuf field <code>map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getLabels()
    {
        return $this->labels;
    }

    /**
     * Optional. Set of labels associated with the `WasmPlugin` resource.
     * The format must comply with [the following
     * requirements](/compute/docs/labeling-resources#requirements).
     *
     * Generated from protobuf field <code>map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setLabels($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->labels = $arr;

        return $this;
    }

    /**
     * Optional. The ID of the `WasmPluginVersion` resource that is the
     * currently serving one. The version referred to must be a child of this
     * `WasmPlugin` resource.
     *
     * Generated from protobuf field <code>string main_version_id = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getMainVersionId()
    {
        return $this->main_version_id;
    }

    /**
     * Optional. The ID of the `WasmPluginVersion` resource that is the
     * currently serving one. The version referred to must be a child of this
     * `WasmPlugin` resource.
     *
     * Generated from protobuf field <code>string main_version_id = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setMainVersionId($var)
    {
        GPBUtil::checkString($var, True);
        $this->main_version_id = $var;

        return $this;
    }

    /**
     * Optional. Specifies the logging options for the activity performed by this
     * plugin. If logging is enabled, plugin logs are exported to
     * Cloud Logging.
     * Note that the settings relate to the logs generated by using
     * logging statements in your Wasm code.
     *
     * Generated from protobuf field <code>.google.cloud.networkservices.v1.WasmPlugin.LogConfig log_config = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\NetworkServices\V1\WasmPlugin\LogConfig|null
     */
    public function getLogConfig()
    {
        return $this->log_config;
    }

    public function hasLogConfig()
    {
        return isset($this->log_config);
    }

    public function clearLogConfig()
    {
        unset($this->log_config);
    }

    /**
     * Optional. Specifies the logging options for the activity performed by this
     * plugin. If logging is enabled, plugin logs are exported to
     * Cloud Logging.
     * Note that the settings relate to the logs generated by using
     * logging statements in your Wasm code.
     *
     * Generated from protobuf field <code>.google.cloud.networkservices.v1.WasmPlugin.LogConfig log_config = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\NetworkServices\V1\WasmPlugin\LogConfig $var
     * @return $this
     */
    public function setLogConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\NetworkServices\V1\WasmPlugin\LogConfig::class);
        $this->log_config = $var;

        return $this;
    }

    /**
     * Optional. All versions of this `WasmPlugin` resource in the key-value
     * format. The key is the resource ID, and the value is the `VersionDetails`
     * object.
     * Lets you create or update a `WasmPlugin` resource and its versions in a
     * single request. When the `main_version_id` field is not empty, it must
     * point to one of the `VersionDetails` objects in the map.
     * If provided in a `PATCH` request, the new versions replace the
     * previous set. Any version omitted from the `versions` field is removed.
     * Because the `WasmPluginVersion` resource is immutable, if a
     * `WasmPluginVersion` resource with the same name already exists and differs,
     * the request fails.
     * Note: In a `GET` request, this field is populated only if the field
     * `GetWasmPluginRequest.view` is set to `WASM_PLUGIN_VIEW_FULL`.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.networkservices.v1.WasmPlugin.VersionDetails> versions = 10 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getVersions()
    {
        return $this->versions;
    }

    /**
     * Optional. All versions of this `WasmPlugin` resource in the key-value
     * format. The key is the resource ID, and the value is the `VersionDetails`
     * object.
     * Lets you create or update a `WasmPlugin` resource and its versions in a
     * single request. When the `main_version_id` field is not empty, it must
     * point to one of the `VersionDetails` objects in the map.
     * If provided in a `PATCH` request, the new versions replace the
     * previous set. Any version omitted from the `versions` field is removed.
     * Because the `WasmPluginVersion` resource is immutable, if a
     * `WasmPluginVersion` resource with the same name already exists and differs,
     * the request fails.
     * Note: In a `GET` request, this field is populated only if the field
     * `GetWasmPluginRequest.view` is set to `WASM_PLUGIN_VIEW_FULL`.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.networkservices.v1.WasmPlugin.VersionDetails> versions = 10 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setVersions($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\WasmPlugin\VersionDetails::class);
        $this->versions = $arr;

        return $this;
    }

    /**
     * Output only. List of all
     * [extensions](https://cloud.google.com/service-extensions/docs/overview)
     * that use this `WasmPlugin` resource.
     *
     * Generated from protobuf field <code>repeated .google.cloud.networkservices.v1.WasmPlugin.UsedBy used_by = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getUsedBy()
    {
        return $this->used_by;
    }

    /**
     * Output only. List of all
     * [extensions](https://cloud.google.com/service-extensions/docs/overview)
     * that use this `WasmPlugin` resource.
     *
     * Generated from protobuf field <code>repeated .google.cloud.networkservices.v1.WasmPlugin.UsedBy used_by = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param array<\Google\Cloud\NetworkServices\V1\WasmPlugin\UsedBy>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setUsedBy($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\WasmPlugin\UsedBy::class);
        $this->used_by = $arr;

        return $this;
    }

}

