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

namespace Google\Cloud\Logging\V2;

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

/**
 * The parameters to CreateLink.
 *
 * Generated from protobuf message <code>google.logging.v2.CreateLinkRequest</code>
 */
class CreateLinkRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The full resource name of the bucket to create a link for.
     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $parent = '';
    /**
     * Required. The new link.
     *
     * Generated from protobuf field <code>.google.logging.v2.Link link = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $link = null;
    /**
     * Required. The ID to use for the link. The link_id can have up to 100
     * characters. A valid link_id must only have alphanumeric characters and
     * underscores within it.
     *
     * Generated from protobuf field <code>string link_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $link_id = '';

    /**
     * @param string                        $parent Required. The full resource name of the bucket to create a link for.
     *
     *                                              "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
     *                                              "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
     *                                              "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
     *                                              "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
     *                                              Please see {@see ConfigServiceV2Client::logBucketName()} for help formatting this field.
     * @param \Google\Cloud\Logging\V2\Link $link   Required. The new link.
     * @param string                        $linkId Required. The ID to use for the link. The link_id can have up to 100
     *                                              characters. A valid link_id must only have alphanumeric characters and
     *                                              underscores within it.
     *
     * @return \Google\Cloud\Logging\V2\CreateLinkRequest
     *
     * @experimental
     */
    public static function build(string $parent, \Google\Cloud\Logging\V2\Link $link, string $linkId): self
    {
        return (new self())
            ->setParent($parent)
            ->setLink($link)
            ->setLinkId($linkId);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The full resource name of the bucket to create a link for.
     *               "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
     *               "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
     *               "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
     *               "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
     *     @type \Google\Cloud\Logging\V2\Link $link
     *           Required. The new link.
     *     @type string $link_id
     *           Required. The ID to use for the link. The link_id can have up to 100
     *           characters. A valid link_id must only have alphanumeric characters and
     *           underscores within it.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The full resource name of the bucket to create a link for.
     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. The full resource name of the bucket to create a link for.
     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * Required. The new link.
     *
     * Generated from protobuf field <code>.google.logging.v2.Link link = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Logging\V2\Link|null
     */
    public function getLink()
    {
        return $this->link;
    }

    public function hasLink()
    {
        return isset($this->link);
    }

    public function clearLink()
    {
        unset($this->link);
    }

    /**
     * Required. The new link.
     *
     * Generated from protobuf field <code>.google.logging.v2.Link link = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Logging\V2\Link $var
     * @return $this
     */
    public function setLink($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\Link::class);
        $this->link = $var;

        return $this;
    }

    /**
     * Required. The ID to use for the link. The link_id can have up to 100
     * characters. A valid link_id must only have alphanumeric characters and
     * underscores within it.
     *
     * Generated from protobuf field <code>string link_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getLinkId()
    {
        return $this->link_id;
    }

    /**
     * Required. The ID to use for the link. The link_id can have up to 100
     * characters. A valid link_id must only have alphanumeric characters and
     * underscores within it.
     *
     * Generated from protobuf field <code>string link_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setLinkId($var)
    {
        GPBUtil::checkString($var, True);
        $this->link_id = $var;

        return $this;
    }

}

