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

namespace Google\Cloud\NetworkManagement\V1;

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

/**
 * For display only. The specification of the endpoints for the test.
 * EndpointInfo is derived from source and destination Endpoint and validated
 * by the backend data plane model.
 *
 * Generated from protobuf message <code>google.cloud.networkmanagement.v1.EndpointInfo</code>
 */
class EndpointInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * Source IP address.
     *
     * Generated from protobuf field <code>string source_ip = 1;</code>
     */
    private $source_ip = '';
    /**
     * Destination IP address.
     *
     * Generated from protobuf field <code>string destination_ip = 2;</code>
     */
    private $destination_ip = '';
    /**
     * IP protocol in string format, for example: "TCP", "UDP", "ICMP".
     *
     * Generated from protobuf field <code>string protocol = 3;</code>
     */
    private $protocol = '';
    /**
     * Source port. Only valid when protocol is TCP or UDP.
     *
     * Generated from protobuf field <code>int32 source_port = 4;</code>
     */
    private $source_port = 0;
    /**
     * Destination port. Only valid when protocol is TCP or UDP.
     *
     * Generated from protobuf field <code>int32 destination_port = 5;</code>
     */
    private $destination_port = 0;
    /**
     * URI of the network where this packet originates from.
     *
     * Generated from protobuf field <code>string source_network_uri = 6;</code>
     */
    private $source_network_uri = '';
    /**
     * URI of the network where this packet is sent to.
     *
     * Generated from protobuf field <code>string destination_network_uri = 7;</code>
     */
    private $destination_network_uri = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $source_ip
     *           Source IP address.
     *     @type string $destination_ip
     *           Destination IP address.
     *     @type string $protocol
     *           IP protocol in string format, for example: "TCP", "UDP", "ICMP".
     *     @type int $source_port
     *           Source port. Only valid when protocol is TCP or UDP.
     *     @type int $destination_port
     *           Destination port. Only valid when protocol is TCP or UDP.
     *     @type string $source_network_uri
     *           URI of the network where this packet originates from.
     *     @type string $destination_network_uri
     *           URI of the network where this packet is sent to.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Networkmanagement\V1\Trace::initOnce();
        parent::__construct($data);
    }

    /**
     * Source IP address.
     *
     * Generated from protobuf field <code>string source_ip = 1;</code>
     * @return string
     */
    public function getSourceIp()
    {
        return $this->source_ip;
    }

    /**
     * Source IP address.
     *
     * Generated from protobuf field <code>string source_ip = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setSourceIp($var)
    {
        GPBUtil::checkString($var, True);
        $this->source_ip = $var;

        return $this;
    }

    /**
     * Destination IP address.
     *
     * Generated from protobuf field <code>string destination_ip = 2;</code>
     * @return string
     */
    public function getDestinationIp()
    {
        return $this->destination_ip;
    }

    /**
     * Destination IP address.
     *
     * Generated from protobuf field <code>string destination_ip = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setDestinationIp($var)
    {
        GPBUtil::checkString($var, True);
        $this->destination_ip = $var;

        return $this;
    }

    /**
     * IP protocol in string format, for example: "TCP", "UDP", "ICMP".
     *
     * Generated from protobuf field <code>string protocol = 3;</code>
     * @return string
     */
    public function getProtocol()
    {
        return $this->protocol;
    }

    /**
     * IP protocol in string format, for example: "TCP", "UDP", "ICMP".
     *
     * Generated from protobuf field <code>string protocol = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setProtocol($var)
    {
        GPBUtil::checkString($var, True);
        $this->protocol = $var;

        return $this;
    }

    /**
     * Source port. Only valid when protocol is TCP or UDP.
     *
     * Generated from protobuf field <code>int32 source_port = 4;</code>
     * @return int
     */
    public function getSourcePort()
    {
        return $this->source_port;
    }

    /**
     * Source port. Only valid when protocol is TCP or UDP.
     *
     * Generated from protobuf field <code>int32 source_port = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setSourcePort($var)
    {
        GPBUtil::checkInt32($var);
        $this->source_port = $var;

        return $this;
    }

    /**
     * Destination port. Only valid when protocol is TCP or UDP.
     *
     * Generated from protobuf field <code>int32 destination_port = 5;</code>
     * @return int
     */
    public function getDestinationPort()
    {
        return $this->destination_port;
    }

    /**
     * Destination port. Only valid when protocol is TCP or UDP.
     *
     * Generated from protobuf field <code>int32 destination_port = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setDestinationPort($var)
    {
        GPBUtil::checkInt32($var);
        $this->destination_port = $var;

        return $this;
    }

    /**
     * URI of the network where this packet originates from.
     *
     * Generated from protobuf field <code>string source_network_uri = 6;</code>
     * @return string
     */
    public function getSourceNetworkUri()
    {
        return $this->source_network_uri;
    }

    /**
     * URI of the network where this packet originates from.
     *
     * Generated from protobuf field <code>string source_network_uri = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setSourceNetworkUri($var)
    {
        GPBUtil::checkString($var, True);
        $this->source_network_uri = $var;

        return $this;
    }

    /**
     * URI of the network where this packet is sent to.
     *
     * Generated from protobuf field <code>string destination_network_uri = 7;</code>
     * @return string
     */
    public function getDestinationNetworkUri()
    {
        return $this->destination_network_uri;
    }

    /**
     * URI of the network where this packet is sent to.
     *
     * Generated from protobuf field <code>string destination_network_uri = 7;</code>
     * @param string $var
     * @return $this
     */
    public function setDestinationNetworkUri($var)
    {
        GPBUtil::checkString($var, True);
        $this->destination_network_uri = $var;

        return $this;
    }

}

