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

namespace Google\Cloud\AppHub\V1;

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

/**
 * ServiceProjectAttachment represents an attachment from a service project to a
 * host project. Service projects contain the underlying cloud
 * infrastructure resources, and expose these resources to the host project
 * through a ServiceProjectAttachment. With the attachments, the host project
 * can provide an aggregated view of resources across all service projects.
 *
 * Generated from protobuf message <code>google.cloud.apphub.v1.ServiceProjectAttachment</code>
 */
class ServiceProjectAttachment extends \Google\Protobuf\Internal\Message
{
    /**
     * Identifier. The resource name of a ServiceProjectAttachment. Format:
     * `"projects/{host-project-id}/locations/global/serviceProjectAttachments/{service-project-id}."`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     */
    protected $name = '';
    /**
     * Required. Immutable. Service project name in the format: `"projects/abc"`
     * or `"projects/123"`. As input, project name with either project id or
     * number are accepted. As output, this field will contain project number.
     *
     * Generated from protobuf field <code>string service_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = {</code>
     */
    protected $service_project = '';
    /**
     * Output only. Create time.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $create_time = null;
    /**
     * Output only. A globally unique identifier (in UUID4 format) for the
     * `ServiceProjectAttachment`.
     *
     * Generated from protobuf field <code>string uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = {</code>
     */
    protected $uid = '';
    /**
     * Output only. ServiceProjectAttachment state.
     *
     * Generated from protobuf field <code>.google.cloud.apphub.v1.ServiceProjectAttachment.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $state = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Identifier. The resource name of a ServiceProjectAttachment. Format:
     *           `"projects/{host-project-id}/locations/global/serviceProjectAttachments/{service-project-id}."`
     *     @type string $service_project
     *           Required. Immutable. Service project name in the format: `"projects/abc"`
     *           or `"projects/123"`. As input, project name with either project id or
     *           number are accepted. As output, this field will contain project number.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. Create time.
     *     @type string $uid
     *           Output only. A globally unique identifier (in UUID4 format) for the
     *           `ServiceProjectAttachment`.
     *     @type int $state
     *           Output only. ServiceProjectAttachment state.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Apphub\V1\ServiceProjectAttachment::initOnce();
        parent::__construct($data);
    }

    /**
     * Identifier. The resource name of a ServiceProjectAttachment. Format:
     * `"projects/{host-project-id}/locations/global/serviceProjectAttachments/{service-project-id}."`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Identifier. The resource name of a ServiceProjectAttachment. Format:
     * `"projects/{host-project-id}/locations/global/serviceProjectAttachments/{service-project-id}."`
     *
     * 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;
    }

    /**
     * Required. Immutable. Service project name in the format: `"projects/abc"`
     * or `"projects/123"`. As input, project name with either project id or
     * number are accepted. As output, this field will contain project number.
     *
     * Generated from protobuf field <code>string service_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getServiceProject()
    {
        return $this->service_project;
    }

    /**
     * Required. Immutable. Service project name in the format: `"projects/abc"`
     * or `"projects/123"`. As input, project name with either project id or
     * number are accepted. As output, this field will contain project number.
     *
     * Generated from protobuf field <code>string service_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setServiceProject($var)
    {
        GPBUtil::checkString($var, True);
        $this->service_project = $var;

        return $this;
    }

    /**
     * Output only. Create time.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3 [(.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. Create time.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3 [(.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. A globally unique identifier (in UUID4 format) for the
     * `ServiceProjectAttachment`.
     *
     * Generated from protobuf field <code>string uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = {</code>
     * @return string
     */
    public function getUid()
    {
        return $this->uid;
    }

    /**
     * Output only. A globally unique identifier (in UUID4 format) for the
     * `ServiceProjectAttachment`.
     *
     * Generated from protobuf field <code>string uid = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = {</code>
     * @param string $var
     * @return $this
     */
    public function setUid($var)
    {
        GPBUtil::checkString($var, True);
        $this->uid = $var;

        return $this;
    }

    /**
     * Output only. ServiceProjectAttachment state.
     *
     * Generated from protobuf field <code>.google.cloud.apphub.v1.ServiceProjectAttachment.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Output only. ServiceProjectAttachment state.
     *
     * Generated from protobuf field <code>.google.cloud.apphub.v1.ServiceProjectAttachment.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\AppHub\V1\ServiceProjectAttachment\State::class);
        $this->state = $var;

        return $this;
    }

}

