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

namespace Google\Cloud\GkeHub\V1;

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

/**
 * Membership contains information about a member cluster.
 *
 * Generated from protobuf message <code>google.cloud.gkehub.v1.Membership</code>
 */
class Membership extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The full, unique name of this Membership resource in the
     * format `projects/&#42;&#47;locations/&#42;&#47;memberships/{membership_id}`, set during
     * creation.
     * `membership_id` must be a valid RFC 1123 compliant DNS label:
     *   1. At most 63 characters in length
     *   2. It must consist of lower case alphanumeric characters or `-`
     *   3. It must start and end with an alphanumeric character
     * Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`,
     * with a maximum length of 63 characters.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $name = '';
    /**
     * Optional. Labels for this membership.
     *
     * Generated from protobuf field <code>map<string, string> labels = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $labels;
    /**
     * Output only. Description of this membership, limited to 63 characters.
     * Must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.\ ]*`
     * This field is present for legacy purposes.
     *
     * Generated from protobuf field <code>string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $description = '';
    /**
     * Output only. State of the Membership resource.
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.v1.MembershipState state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $state = null;
    /**
     * Output only. When the Membership was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $create_time = null;
    /**
     * Output only. When the Membership was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $update_time = null;
    /**
     * Output only. When the Membership was deleted.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $delete_time = null;
    /**
     * Optional. An externally-generated and managed ID for this Membership. This
     * ID may be modified after creation, but this is not recommended.
     * The ID must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.]*`
     * If this Membership represents a Kubernetes cluster, this value should be
     * set to the UID of the `kube-system` namespace object.
     *
     * Generated from protobuf field <code>string external_id = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $external_id = '';
    /**
     * Output only. For clusters using Connect, the timestamp of the most recent
     * connection established with Google Cloud. This time is updated every
     * several minutes, not continuously. For clusters that do not use GKE
     * Connect, or that have never connected successfully, this field will be
     * unset.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_connection_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $last_connection_time = null;
    /**
     * Output only. Google-generated UUID for this resource. This is unique across
     * all Membership resources. If a Membership resource is deleted and another
     * resource with the same name is created, it gets a different unique_id.
     *
     * Generated from protobuf field <code>string unique_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $unique_id = '';
    /**
     * Optional. How to identify workloads from this Membership.
     * See the documentation on Workload Identity for more details:
     * https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.v1.Authority authority = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $authority = null;
    /**
     * Optional. The monitoring config information for this membership.
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.v1.MonitoringConfig monitoring_config = 14 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $monitoring_config = null;
    protected $type;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\GkeHub\V1\MembershipEndpoint $endpoint
     *           Optional. Endpoint information to reach this member.
     *     @type string $name
     *           Output only. The full, unique name of this Membership resource in the
     *           format `projects/&#42;&#47;locations/&#42;&#47;memberships/{membership_id}`, set during
     *           creation.
     *           `membership_id` must be a valid RFC 1123 compliant DNS label:
     *             1. At most 63 characters in length
     *             2. It must consist of lower case alphanumeric characters or `-`
     *             3. It must start and end with an alphanumeric character
     *           Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`,
     *           with a maximum length of 63 characters.
     *     @type array|\Google\Protobuf\Internal\MapField $labels
     *           Optional. Labels for this membership.
     *     @type string $description
     *           Output only. Description of this membership, limited to 63 characters.
     *           Must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.\ ]*`
     *           This field is present for legacy purposes.
     *     @type \Google\Cloud\GkeHub\V1\MembershipState $state
     *           Output only. State of the Membership resource.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. When the Membership was created.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. When the Membership was last updated.
     *     @type \Google\Protobuf\Timestamp $delete_time
     *           Output only. When the Membership was deleted.
     *     @type string $external_id
     *           Optional. An externally-generated and managed ID for this Membership. This
     *           ID may be modified after creation, but this is not recommended.
     *           The ID must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.]*`
     *           If this Membership represents a Kubernetes cluster, this value should be
     *           set to the UID of the `kube-system` namespace object.
     *     @type \Google\Protobuf\Timestamp $last_connection_time
     *           Output only. For clusters using Connect, the timestamp of the most recent
     *           connection established with Google Cloud. This time is updated every
     *           several minutes, not continuously. For clusters that do not use GKE
     *           Connect, or that have never connected successfully, this field will be
     *           unset.
     *     @type string $unique_id
     *           Output only. Google-generated UUID for this resource. This is unique across
     *           all Membership resources. If a Membership resource is deleted and another
     *           resource with the same name is created, it gets a different unique_id.
     *     @type \Google\Cloud\GkeHub\V1\Authority $authority
     *           Optional. How to identify workloads from this Membership.
     *           See the documentation on Workload Identity for more details:
     *           https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity
     *     @type \Google\Cloud\GkeHub\V1\MonitoringConfig $monitoring_config
     *           Optional. The monitoring config information for this membership.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Gkehub\V1\Membership::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Endpoint information to reach this member.
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.v1.MembershipEndpoint endpoint = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\GkeHub\V1\MembershipEndpoint|null
     */
    public function getEndpoint()
    {
        return $this->readOneof(4);
    }

    public function hasEndpoint()
    {
        return $this->hasOneof(4);
    }

    /**
     * Optional. Endpoint information to reach this member.
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.v1.MembershipEndpoint endpoint = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\GkeHub\V1\MembershipEndpoint $var
     * @return $this
     */
    public function setEndpoint($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\MembershipEndpoint::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Output only. The full, unique name of this Membership resource in the
     * format `projects/&#42;&#47;locations/&#42;&#47;memberships/{membership_id}`, set during
     * creation.
     * `membership_id` must be a valid RFC 1123 compliant DNS label:
     *   1. At most 63 characters in length
     *   2. It must consist of lower case alphanumeric characters or `-`
     *   3. It must start and end with an alphanumeric character
     * Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`,
     * with a maximum length of 63 characters.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Output only. The full, unique name of this Membership resource in the
     * format `projects/&#42;&#47;locations/&#42;&#47;memberships/{membership_id}`, set during
     * creation.
     * `membership_id` must be a valid RFC 1123 compliant DNS label:
     *   1. At most 63 characters in length
     *   2. It must consist of lower case alphanumeric characters or `-`
     *   3. It must start and end with an alphanumeric character
     * Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`,
     * with a maximum length of 63 characters.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Optional. Labels for this membership.
     *
     * Generated from protobuf field <code>map<string, string> labels = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getLabels()
    {
        return $this->labels;
    }

    /**
     * Optional. Labels for this membership.
     *
     * Generated from protobuf field <code>map<string, string> labels = 2 [(.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;
    }

    /**
     * Output only. Description of this membership, limited to 63 characters.
     * Must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.\ ]*`
     * This field is present for legacy purposes.
     *
     * Generated from protobuf field <code>string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Output only. Description of this membership, limited to 63 characters.
     * Must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.\ ]*`
     * This field is present for legacy purposes.
     *
     * Generated from protobuf field <code>string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * Output only. State of the Membership resource.
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.v1.MembershipState state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\GkeHub\V1\MembershipState|null
     */
    public function getState()
    {
        return $this->state;
    }

    public function hasState()
    {
        return isset($this->state);
    }

    public function clearState()
    {
        unset($this->state);
    }

    /**
     * Output only. State of the Membership resource.
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.v1.MembershipState state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\GkeHub\V1\MembershipState $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\MembershipState::class);
        $this->state = $var;

        return $this;
    }

    /**
     * Output only. When the Membership was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 6 [(.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. When the Membership was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 6 [(.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 Membership was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 7 [(.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 Membership was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 7 [(.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. When the Membership was deleted.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getDeleteTime()
    {
        return $this->delete_time;
    }

    public function hasDeleteTime()
    {
        return isset($this->delete_time);
    }

    public function clearDeleteTime()
    {
        unset($this->delete_time);
    }

    /**
     * Output only. When the Membership was deleted.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setDeleteTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->delete_time = $var;

        return $this;
    }

    /**
     * Optional. An externally-generated and managed ID for this Membership. This
     * ID may be modified after creation, but this is not recommended.
     * The ID must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.]*`
     * If this Membership represents a Kubernetes cluster, this value should be
     * set to the UID of the `kube-system` namespace object.
     *
     * Generated from protobuf field <code>string external_id = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getExternalId()
    {
        return $this->external_id;
    }

    /**
     * Optional. An externally-generated and managed ID for this Membership. This
     * ID may be modified after creation, but this is not recommended.
     * The ID must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.]*`
     * If this Membership represents a Kubernetes cluster, this value should be
     * set to the UID of the `kube-system` namespace object.
     *
     * Generated from protobuf field <code>string external_id = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setExternalId($var)
    {
        GPBUtil::checkString($var, True);
        $this->external_id = $var;

        return $this;
    }

    /**
     * Output only. For clusters using Connect, the timestamp of the most recent
     * connection established with Google Cloud. This time is updated every
     * several minutes, not continuously. For clusters that do not use GKE
     * Connect, or that have never connected successfully, this field will be
     * unset.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_connection_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getLastConnectionTime()
    {
        return $this->last_connection_time;
    }

    public function hasLastConnectionTime()
    {
        return isset($this->last_connection_time);
    }

    public function clearLastConnectionTime()
    {
        unset($this->last_connection_time);
    }

    /**
     * Output only. For clusters using Connect, the timestamp of the most recent
     * connection established with Google Cloud. This time is updated every
     * several minutes, not continuously. For clusters that do not use GKE
     * Connect, or that have never connected successfully, this field will be
     * unset.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_connection_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setLastConnectionTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->last_connection_time = $var;

        return $this;
    }

    /**
     * Output only. Google-generated UUID for this resource. This is unique across
     * all Membership resources. If a Membership resource is deleted and another
     * resource with the same name is created, it gets a different unique_id.
     *
     * Generated from protobuf field <code>string unique_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getUniqueId()
    {
        return $this->unique_id;
    }

    /**
     * Output only. Google-generated UUID for this resource. This is unique across
     * all Membership resources. If a Membership resource is deleted and another
     * resource with the same name is created, it gets a different unique_id.
     *
     * Generated from protobuf field <code>string unique_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setUniqueId($var)
    {
        GPBUtil::checkString($var, True);
        $this->unique_id = $var;

        return $this;
    }

    /**
     * Optional. How to identify workloads from this Membership.
     * See the documentation on Workload Identity for more details:
     * https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.v1.Authority authority = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\GkeHub\V1\Authority|null
     */
    public function getAuthority()
    {
        return $this->authority;
    }

    public function hasAuthority()
    {
        return isset($this->authority);
    }

    public function clearAuthority()
    {
        unset($this->authority);
    }

    /**
     * Optional. How to identify workloads from this Membership.
     * See the documentation on Workload Identity for more details:
     * https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.v1.Authority authority = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\GkeHub\V1\Authority $var
     * @return $this
     */
    public function setAuthority($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\Authority::class);
        $this->authority = $var;

        return $this;
    }

    /**
     * Optional. The monitoring config information for this membership.
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.v1.MonitoringConfig monitoring_config = 14 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\GkeHub\V1\MonitoringConfig|null
     */
    public function getMonitoringConfig()
    {
        return $this->monitoring_config;
    }

    public function hasMonitoringConfig()
    {
        return isset($this->monitoring_config);
    }

    public function clearMonitoringConfig()
    {
        unset($this->monitoring_config);
    }

    /**
     * Optional. The monitoring config information for this membership.
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.v1.MonitoringConfig monitoring_config = 14 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\GkeHub\V1\MonitoringConfig $var
     * @return $this
     */
    public function setMonitoringConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\GkeHub\V1\MonitoringConfig::class);
        $this->monitoring_config = $var;

        return $this;
    }

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

}

