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

namespace Google\Cloud\GkeHub\V1;

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

/**
 * MembershipBinding is a subresource of a Membership, representing
 * what Fleet Scopes (or other, future Fleet resources) a Membership is bound
 * to.
 *
 * Generated from protobuf message <code>google.cloud.gkehub.v1.MembershipBinding</code>
 */
class MembershipBinding extends \Google\Protobuf\Internal\Message
{
    /**
     * The resource name for the membershipbinding itself
     * `projects/{project}/locations/{location}/memberships/{membership}/bindings/{membershipbinding}`
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    protected $name = '';
    /**
     * Output only. Google-generated UUID for this resource. This is unique across
     * all membershipbinding resources. If a membershipbinding resource is deleted
     * and another resource with the same name is created, it gets a different
     * uid.
     *
     * Generated from protobuf field <code>string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $uid = '';
    /**
     * Output only. When the membership binding was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $create_time = null;
    /**
     * Output only. When the membership binding was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $update_time = null;
    /**
     * Output only. When the membership binding was deleted.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $delete_time = null;
    /**
     * Output only. State of the membership binding resource.
     *
     * Generated from protobuf field <code>.google.cloud.gkehub.v1.MembershipBindingLifecycleState state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $state = null;
    /**
     * Optional. Labels for this MembershipBinding.
     *
     * Generated from protobuf field <code>map<string, string> labels = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $labels;
    protected $target;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $scope
     *           A Scope resource name in the format
     *           `projects/&#42;&#47;locations/&#42;&#47;scopes/&#42;`.
     *     @type string $name
     *           The resource name for the membershipbinding itself
     *           `projects/{project}/locations/{location}/memberships/{membership}/bindings/{membershipbinding}`
     *     @type string $uid
     *           Output only. Google-generated UUID for this resource. This is unique across
     *           all membershipbinding resources. If a membershipbinding resource is deleted
     *           and another resource with the same name is created, it gets a different
     *           uid.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. When the membership binding was created.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. When the membership binding was last updated.
     *     @type \Google\Protobuf\Timestamp $delete_time
     *           Output only. When the membership binding was deleted.
     *     @type \Google\Cloud\GkeHub\V1\MembershipBindingLifecycleState $state
     *           Output only. State of the membership binding resource.
     *     @type array|\Google\Protobuf\Internal\MapField $labels
     *           Optional. Labels for this MembershipBinding.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Gkehub\V1\Fleet::initOnce();
        parent::__construct($data);
    }

    /**
     * A Scope resource name in the format
     * `projects/&#42;&#47;locations/&#42;&#47;scopes/&#42;`.
     *
     * Generated from protobuf field <code>string scope = 3 [(.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getScope()
    {
        return $this->readOneof(3);
    }

    public function hasScope()
    {
        return $this->hasOneof(3);
    }

    /**
     * A Scope resource name in the format
     * `projects/&#42;&#47;locations/&#42;&#47;scopes/&#42;`.
     *
     * Generated from protobuf field <code>string scope = 3 [(.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setScope($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * The resource name for the membershipbinding itself
     * `projects/{project}/locations/{location}/memberships/{membership}/bindings/{membershipbinding}`
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * The resource name for the membershipbinding itself
     * `projects/{project}/locations/{location}/memberships/{membership}/bindings/{membershipbinding}`
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Output only. When the membership binding was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 5 [(.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 binding was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 5 [(.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 binding was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 6 [(.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 binding was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 6 [(.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 binding was deleted.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp delete_time = 7 [(.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 binding was deleted.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp delete_time = 7 [(.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;
    }

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

        return $this;
    }

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

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

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

}

