<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/devtools/clouderrorreporting/v1beta1/common.proto

namespace Google\Cloud\ErrorReporting\V1beta1;

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

/**
 * Indicates a location in the source code of the service for which errors are
 * reported. `functionName` must be provided by the application when reporting
 * an error, unless the error report contains a `message` with a supported
 * exception stack trace. All fields are optional for the later case.
 *
 * Generated from protobuf message <code>google.devtools.clouderrorreporting.v1beta1.SourceLocation</code>
 */
class SourceLocation extends \Google\Protobuf\Internal\Message
{
    /**
     * The source code filename, which can include a truncated relative
     * path, or a full path from a production machine.
     *
     * Generated from protobuf field <code>string file_path = 1;</code>
     */
    private $file_path = '';
    /**
     * 1-based. 0 indicates that the line number is unknown.
     *
     * Generated from protobuf field <code>int32 line_number = 2;</code>
     */
    private $line_number = 0;
    /**
     * Human-readable name of a function or method.
     * The value can include optional context like the class or package name.
     * For example, `my.package.MyClass.method` in case of Java.
     *
     * Generated from protobuf field <code>string function_name = 4;</code>
     */
    private $function_name = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $file_path
     *           The source code filename, which can include a truncated relative
     *           path, or a full path from a production machine.
     *     @type int $line_number
     *           1-based. 0 indicates that the line number is unknown.
     *     @type string $function_name
     *           Human-readable name of a function or method.
     *           The value can include optional context like the class or package name.
     *           For example, `my.package.MyClass.method` in case of Java.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Devtools\Clouderrorreporting\V1Beta1\Common::initOnce();
        parent::__construct($data);
    }

    /**
     * The source code filename, which can include a truncated relative
     * path, or a full path from a production machine.
     *
     * Generated from protobuf field <code>string file_path = 1;</code>
     * @return string
     */
    public function getFilePath()
    {
        return $this->file_path;
    }

    /**
     * The source code filename, which can include a truncated relative
     * path, or a full path from a production machine.
     *
     * Generated from protobuf field <code>string file_path = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setFilePath($var)
    {
        GPBUtil::checkString($var, True);
        $this->file_path = $var;

        return $this;
    }

    /**
     * 1-based. 0 indicates that the line number is unknown.
     *
     * Generated from protobuf field <code>int32 line_number = 2;</code>
     * @return int
     */
    public function getLineNumber()
    {
        return $this->line_number;
    }

    /**
     * 1-based. 0 indicates that the line number is unknown.
     *
     * Generated from protobuf field <code>int32 line_number = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setLineNumber($var)
    {
        GPBUtil::checkInt32($var);
        $this->line_number = $var;

        return $this;
    }

    /**
     * Human-readable name of a function or method.
     * The value can include optional context like the class or package name.
     * For example, `my.package.MyClass.method` in case of Java.
     *
     * Generated from protobuf field <code>string function_name = 4;</code>
     * @return string
     */
    public function getFunctionName()
    {
        return $this->function_name;
    }

    /**
     * Human-readable name of a function or method.
     * The value can include optional context like the class or package name.
     * For example, `my.package.MyClass.method` in case of Java.
     *
     * Generated from protobuf field <code>string function_name = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setFunctionName($var)
    {
        GPBUtil::checkString($var, True);
        $this->function_name = $var;

        return $this;
    }

}

