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

namespace Google\Cloud\Container\V1\NotificationConfig;

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

/**
 * Pub/Sub specific notification config.
 *
 * Generated from protobuf message <code>google.container.v1.NotificationConfig.PubSub</code>
 */
class PubSub extends \Google\Protobuf\Internal\Message
{
    /**
     * Enable notifications for Pub/Sub.
     *
     * Generated from protobuf field <code>bool enabled = 1;</code>
     */
    private $enabled = false;
    /**
     * The desired Pub/Sub topic to which notifications will be
     * sent by GKE. Format is `projects/{project}/topics/{topic}`.
     *
     * Generated from protobuf field <code>string topic = 2 [(.google.api.resource_reference) = {</code>
     */
    private $topic = '';
    /**
     * Allows filtering to one or more specific event types. If no filter is
     * specified, or if a filter is specified with no event types, all event
     * types will be sent
     *
     * Generated from protobuf field <code>.google.container.v1.NotificationConfig.Filter filter = 3;</code>
     */
    private $filter = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $enabled
     *           Enable notifications for Pub/Sub.
     *     @type string $topic
     *           The desired Pub/Sub topic to which notifications will be
     *           sent by GKE. Format is `projects/{project}/topics/{topic}`.
     *     @type \Google\Cloud\Container\V1\NotificationConfig\Filter $filter
     *           Allows filtering to one or more specific event types. If no filter is
     *           specified, or if a filter is specified with no event types, all event
     *           types will be sent
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Container\V1\ClusterService::initOnce();
        parent::__construct($data);
    }

    /**
     * Enable notifications for Pub/Sub.
     *
     * Generated from protobuf field <code>bool enabled = 1;</code>
     * @return bool
     */
    public function getEnabled()
    {
        return $this->enabled;
    }

    /**
     * Enable notifications for Pub/Sub.
     *
     * Generated from protobuf field <code>bool enabled = 1;</code>
     * @param bool $var
     * @return $this
     */
    public function setEnabled($var)
    {
        GPBUtil::checkBool($var);
        $this->enabled = $var;

        return $this;
    }

    /**
     * The desired Pub/Sub topic to which notifications will be
     * sent by GKE. Format is `projects/{project}/topics/{topic}`.
     *
     * Generated from protobuf field <code>string topic = 2 [(.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getTopic()
    {
        return $this->topic;
    }

    /**
     * The desired Pub/Sub topic to which notifications will be
     * sent by GKE. Format is `projects/{project}/topics/{topic}`.
     *
     * Generated from protobuf field <code>string topic = 2 [(.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setTopic($var)
    {
        GPBUtil::checkString($var, True);
        $this->topic = $var;

        return $this;
    }

    /**
     * Allows filtering to one or more specific event types. If no filter is
     * specified, or if a filter is specified with no event types, all event
     * types will be sent
     *
     * Generated from protobuf field <code>.google.container.v1.NotificationConfig.Filter filter = 3;</code>
     * @return \Google\Cloud\Container\V1\NotificationConfig\Filter|null
     */
    public function getFilter()
    {
        return $this->filter;
    }

    public function hasFilter()
    {
        return isset($this->filter);
    }

    public function clearFilter()
    {
        unset($this->filter);
    }

    /**
     * Allows filtering to one or more specific event types. If no filter is
     * specified, or if a filter is specified with no event types, all event
     * types will be sent
     *
     * Generated from protobuf field <code>.google.container.v1.NotificationConfig.Filter filter = 3;</code>
     * @param \Google\Cloud\Container\V1\NotificationConfig\Filter $var
     * @return $this
     */
    public function setFilter($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\NotificationConfig\Filter::class);
        $this->filter = $var;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(PubSub::class, \Google\Cloud\Container\V1\NotificationConfig_PubSub::class);

