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

namespace Google\Cloud\NetworkManagement\V1;

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

/**
 * Request for the `CreateConnectivityTest` method.
 *
 * Generated from protobuf message <code>google.cloud.networkmanagement.v1.CreateConnectivityTestRequest</code>
 */
class CreateConnectivityTestRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The parent resource of the Connectivity Test to create:
     *     `projects/{project_id}/locations/global`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $parent = '';
    /**
     * Required. The logical name of the Connectivity Test in your project
     * with the following restrictions:
     * * Must contain only lowercase letters, numbers, and hyphens.
     * * Must start with a letter.
     * * Must be between 1-40 characters.
     * * Must end with a number or a letter.
     * * Must be unique within the customer project
     *
     * Generated from protobuf field <code>string test_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $test_id = '';
    /**
     * Required. A `ConnectivityTest` resource
     *
     * Generated from protobuf field <code>.google.cloud.networkmanagement.v1.ConnectivityTest resource = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $resource = null;

    /**
     * @param string                                              $parent   Required. The parent resource of the Connectivity Test to create:
     *                                                                      `projects/{project_id}/locations/global`
     * @param string                                              $testId   Required. The logical name of the Connectivity Test in your project
     *                                                                      with the following restrictions:
     *
     *                                                                      * Must contain only lowercase letters, numbers, and hyphens.
     *                                                                      * Must start with a letter.
     *                                                                      * Must be between 1-40 characters.
     *                                                                      * Must end with a number or a letter.
     *                                                                      * Must be unique within the customer project
     * @param \Google\Cloud\NetworkManagement\V1\ConnectivityTest $resource Required. A `ConnectivityTest` resource
     *
     * @return \Google\Cloud\NetworkManagement\V1\CreateConnectivityTestRequest
     *
     * @experimental
     */
    public static function build(string $parent, string $testId, \Google\Cloud\NetworkManagement\V1\ConnectivityTest $resource): self
    {
        return (new self())
            ->setParent($parent)
            ->setTestId($testId)
            ->setResource($resource);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The parent resource of the Connectivity Test to create:
     *               `projects/{project_id}/locations/global`
     *     @type string $test_id
     *           Required. The logical name of the Connectivity Test in your project
     *           with the following restrictions:
     *           * Must contain only lowercase letters, numbers, and hyphens.
     *           * Must start with a letter.
     *           * Must be between 1-40 characters.
     *           * Must end with a number or a letter.
     *           * Must be unique within the customer project
     *     @type \Google\Cloud\NetworkManagement\V1\ConnectivityTest $resource
     *           Required. A `ConnectivityTest` resource
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Networkmanagement\V1\Reachability::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The parent resource of the Connectivity Test to create:
     *     `projects/{project_id}/locations/global`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. The parent resource of the Connectivity Test to create:
     *     `projects/{project_id}/locations/global`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * Required. The logical name of the Connectivity Test in your project
     * with the following restrictions:
     * * Must contain only lowercase letters, numbers, and hyphens.
     * * Must start with a letter.
     * * Must be between 1-40 characters.
     * * Must end with a number or a letter.
     * * Must be unique within the customer project
     *
     * Generated from protobuf field <code>string test_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getTestId()
    {
        return $this->test_id;
    }

    /**
     * Required. The logical name of the Connectivity Test in your project
     * with the following restrictions:
     * * Must contain only lowercase letters, numbers, and hyphens.
     * * Must start with a letter.
     * * Must be between 1-40 characters.
     * * Must end with a number or a letter.
     * * Must be unique within the customer project
     *
     * Generated from protobuf field <code>string test_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setTestId($var)
    {
        GPBUtil::checkString($var, True);
        $this->test_id = $var;

        return $this;
    }

    /**
     * Required. A `ConnectivityTest` resource
     *
     * Generated from protobuf field <code>.google.cloud.networkmanagement.v1.ConnectivityTest resource = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\NetworkManagement\V1\ConnectivityTest|null
     */
    public function getResource()
    {
        return $this->resource;
    }

    public function hasResource()
    {
        return isset($this->resource);
    }

    public function clearResource()
    {
        unset($this->resource);
    }

    /**
     * Required. A `ConnectivityTest` resource
     *
     * Generated from protobuf field <code>.google.cloud.networkmanagement.v1.ConnectivityTest resource = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\NetworkManagement\V1\ConnectivityTest $var
     * @return $this
     */
    public function setResource($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\NetworkManagement\V1\ConnectivityTest::class);
        $this->resource = $var;

        return $this;
    }

}

