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

namespace Google\Api;

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

/**
 * An annotation designating that this field is a reference to a resource
 * defined by another message.
 *
 * Generated from protobuf message <code>google.api.ResourceReference</code>
 */
class ResourceReference extends \Google\Protobuf\Internal\Message
{
    /**
     * The unified resource type name of the type that this field references.
     * Marks this as a field referring to a resource in another message.
     * Example:
     *   message Subscription {
     *     string topic = 2 [(google.api.resource_reference) = {
     *       type = "pubsub.googleapis.com/Topic"
     *     }];
     *   }
     *
     * Generated from protobuf field <code>string type = 1;</code>
     */
    private $type = '';
    /**
     * The fully-qualified message name of a child of the type that this field
     * references.
     * This is useful for `parent` fields where a resource has more than one
     * possible type of parent.
     * Example:
     *   message ListLogEntriesRequest {
     *     string parent = 1 [(google.api.resource_reference) = {
     *       child_type: "logging.googleapis.com/LogEntry"
     *     };
     *   }
     * If the referenced message is in the same proto package, the service name
     * may be omitted:
     *   message ListLogEntriesRequest {
     *     string parent = 1
     *       [(google.api.resource_reference).child_type = "LogEntry"];
     *   }
     *
     * Generated from protobuf field <code>string child_type = 2;</code>
     */
    private $child_type = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $type
     *           The unified resource type name of the type that this field references.
     *           Marks this as a field referring to a resource in another message.
     *           Example:
     *             message Subscription {
     *               string topic = 2 [(google.api.resource_reference) = {
     *                 type = "pubsub.googleapis.com/Topic"
     *               }];
     *             }
     *     @type string $child_type
     *           The fully-qualified message name of a child of the type that this field
     *           references.
     *           This is useful for `parent` fields where a resource has more than one
     *           possible type of parent.
     *           Example:
     *             message ListLogEntriesRequest {
     *               string parent = 1 [(google.api.resource_reference) = {
     *                 child_type: "logging.googleapis.com/LogEntry"
     *               };
     *             }
     *           If the referenced message is in the same proto package, the service name
     *           may be omitted:
     *             message ListLogEntriesRequest {
     *               string parent = 1
     *                 [(google.api.resource_reference).child_type = "LogEntry"];
     *             }
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Api\Resource::initOnce();
        parent::__construct($data);
    }

    /**
     * The unified resource type name of the type that this field references.
     * Marks this as a field referring to a resource in another message.
     * Example:
     *   message Subscription {
     *     string topic = 2 [(google.api.resource_reference) = {
     *       type = "pubsub.googleapis.com/Topic"
     *     }];
     *   }
     *
     * Generated from protobuf field <code>string type = 1;</code>
     * @return string
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * The unified resource type name of the type that this field references.
     * Marks this as a field referring to a resource in another message.
     * Example:
     *   message Subscription {
     *     string topic = 2 [(google.api.resource_reference) = {
     *       type = "pubsub.googleapis.com/Topic"
     *     }];
     *   }
     *
     * Generated from protobuf field <code>string type = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkString($var, True);
        $this->type = $var;

        return $this;
    }

    /**
     * The fully-qualified message name of a child of the type that this field
     * references.
     * This is useful for `parent` fields where a resource has more than one
     * possible type of parent.
     * Example:
     *   message ListLogEntriesRequest {
     *     string parent = 1 [(google.api.resource_reference) = {
     *       child_type: "logging.googleapis.com/LogEntry"
     *     };
     *   }
     * If the referenced message is in the same proto package, the service name
     * may be omitted:
     *   message ListLogEntriesRequest {
     *     string parent = 1
     *       [(google.api.resource_reference).child_type = "LogEntry"];
     *   }
     *
     * Generated from protobuf field <code>string child_type = 2;</code>
     * @return string
     */
    public function getChildType()
    {
        return $this->child_type;
    }

    /**
     * The fully-qualified message name of a child of the type that this field
     * references.
     * This is useful for `parent` fields where a resource has more than one
     * possible type of parent.
     * Example:
     *   message ListLogEntriesRequest {
     *     string parent = 1 [(google.api.resource_reference) = {
     *       child_type: "logging.googleapis.com/LogEntry"
     *     };
     *   }
     * If the referenced message is in the same proto package, the service name
     * may be omitted:
     *   message ListLogEntriesRequest {
     *     string parent = 1
     *       [(google.api.resource_reference).child_type = "LogEntry"];
     *   }
     *
     * Generated from protobuf field <code>string child_type = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setChildType($var)
    {
        GPBUtil::checkString($var, True);
        $this->child_type = $var;

        return $this;
    }

}

