<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: opentelemetry/proto/profiles/v1development/profiles.proto

namespace Opentelemetry\Proto\Profiles\V1development;

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

/**
 * Represents a complete profile, including sample types, samples, mappings to
 * binaries, stacks, locations, functions, string table, and additional
 * metadata. It modifies and annotates pprof Profile with OpenTelemetry
 * specific fields.
 * Note that whilst fields in this message retain the name and field id from pprof in most cases
 * for ease of understanding data migration, it is not intended that pprof:Profile and
 * OpenTelemetry:Profile encoding be wire compatible.
 *
 * Generated from protobuf message <code>opentelemetry.proto.profiles.v1development.Profile</code>
 */
class Profile extends \Google\Protobuf\Internal\Message
{
    /**
     * The type and unit of all Sample.values in this profile.
     * For a cpu or off-cpu profile this might be:
     *   ["cpu","nanoseconds"] or ["off_cpu","nanoseconds"]
     * For a heap profile, this might be:
     *   ["allocated_objects","count"] or ["allocated_space","bytes"],
     *
     * Generated from protobuf field <code>.opentelemetry.proto.profiles.v1development.ValueType sample_type = 1;</code>
     */
    protected $sample_type = null;
    /**
     * The set of samples recorded in this profile.
     *
     * Generated from protobuf field <code>repeated .opentelemetry.proto.profiles.v1development.Sample sample = 2;</code>
     */
    private $sample;
    /**
     * Time of collection (UTC) represented as nanoseconds past the epoch.
     *
     * Generated from protobuf field <code>fixed64 time_unix_nano = 3;</code>
     */
    protected $time_unix_nano = 0;
    /**
     * Duration of the profile, if a duration makes sense.
     *
     * Generated from protobuf field <code>uint64 duration_nano = 4;</code>
     */
    protected $duration_nano = 0;
    /**
     * The kind of events between sampled occurrences.
     * e.g [ "cpu","cycles" ] or [ "heap","bytes" ]
     *
     * Generated from protobuf field <code>.opentelemetry.proto.profiles.v1development.ValueType period_type = 5;</code>
     */
    protected $period_type = null;
    /**
     * The number of events between sampled occurrences.
     *
     * Generated from protobuf field <code>int64 period = 6;</code>
     */
    protected $period = 0;
    /**
     * Free-form text associated with the profile. The text is displayed as is
     * to the user by the tools that read profiles (e.g. by pprof). This field
     * should not be used to store any machine-readable information, it is only
     * for human-friendly content. The profile must stay functional if this field
     * is cleaned.
     *
     * Generated from protobuf field <code>repeated int32 comment_strindices = 7;</code>
     */
    private $comment_strindices;
    /**
     * A globally unique identifier for a profile. The ID is a 16-byte array. An ID with
     * all zeroes is considered invalid. It may be used for deduplication and signal
     * correlation purposes. It is acceptable to treat two profiles with different values
     * in this field as not equal, even if they represented the same object at an earlier
     * time.
     * This field is optional; an ID may be assigned to an ID-less profile in a later step.
     *
     * Generated from protobuf field <code>bytes profile_id = 8;</code>
     */
    protected $profile_id = '';
    /**
     * dropped_attributes_count is the number of attributes that were discarded. Attributes
     * can be discarded because their keys are too long or because there are too many
     * attributes. If this value is 0, then no attributes were dropped.
     *
     * Generated from protobuf field <code>uint32 dropped_attributes_count = 9;</code>
     */
    protected $dropped_attributes_count = 0;
    /**
     * Specifies format of the original payload. Common values are defined in semantic conventions. [required if original_payload is present]
     *
     * Generated from protobuf field <code>string original_payload_format = 10;</code>
     */
    protected $original_payload_format = '';
    /**
     * Original payload can be stored in this field. This can be useful for users who want to get the original payload.
     * Formats such as JFR are highly extensible and can contain more information than what is defined in this spec.
     * Inclusion of original payload should be configurable by the user. Default behavior should be to not include the original payload.
     * If the original payload is in pprof format, it SHOULD not be included in this field.
     * The field is optional, however if it is present then equivalent converted data should be populated in other fields
     * of this message as far as is practicable.
     *
     * Generated from protobuf field <code>bytes original_payload = 11;</code>
     */
    protected $original_payload = '';
    /**
     * References to attributes in attribute_table. [optional]
     *
     * Generated from protobuf field <code>repeated int32 attribute_indices = 12;</code>
     */
    private $attribute_indices;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Opentelemetry\Proto\Profiles\V1development\ValueType $sample_type
     *           The type and unit of all Sample.values in this profile.
     *           For a cpu or off-cpu profile this might be:
     *             ["cpu","nanoseconds"] or ["off_cpu","nanoseconds"]
     *           For a heap profile, this might be:
     *             ["allocated_objects","count"] or ["allocated_space","bytes"],
     *     @type \Opentelemetry\Proto\Profiles\V1development\Sample[]|\Google\Protobuf\Internal\RepeatedField $sample
     *           The set of samples recorded in this profile.
     *     @type int|string $time_unix_nano
     *           Time of collection (UTC) represented as nanoseconds past the epoch.
     *     @type int|string $duration_nano
     *           Duration of the profile, if a duration makes sense.
     *     @type \Opentelemetry\Proto\Profiles\V1development\ValueType $period_type
     *           The kind of events between sampled occurrences.
     *           e.g [ "cpu","cycles" ] or [ "heap","bytes" ]
     *     @type int|string $period
     *           The number of events between sampled occurrences.
     *     @type int[]|\Google\Protobuf\Internal\RepeatedField $comment_strindices
     *           Free-form text associated with the profile. The text is displayed as is
     *           to the user by the tools that read profiles (e.g. by pprof). This field
     *           should not be used to store any machine-readable information, it is only
     *           for human-friendly content. The profile must stay functional if this field
     *           is cleaned.
     *     @type string $profile_id
     *           A globally unique identifier for a profile. The ID is a 16-byte array. An ID with
     *           all zeroes is considered invalid. It may be used for deduplication and signal
     *           correlation purposes. It is acceptable to treat two profiles with different values
     *           in this field as not equal, even if they represented the same object at an earlier
     *           time.
     *           This field is optional; an ID may be assigned to an ID-less profile in a later step.
     *     @type int $dropped_attributes_count
     *           dropped_attributes_count is the number of attributes that were discarded. Attributes
     *           can be discarded because their keys are too long or because there are too many
     *           attributes. If this value is 0, then no attributes were dropped.
     *     @type string $original_payload_format
     *           Specifies format of the original payload. Common values are defined in semantic conventions. [required if original_payload is present]
     *     @type string $original_payload
     *           Original payload can be stored in this field. This can be useful for users who want to get the original payload.
     *           Formats such as JFR are highly extensible and can contain more information than what is defined in this spec.
     *           Inclusion of original payload should be configurable by the user. Default behavior should be to not include the original payload.
     *           If the original payload is in pprof format, it SHOULD not be included in this field.
     *           The field is optional, however if it is present then equivalent converted data should be populated in other fields
     *           of this message as far as is practicable.
     *     @type int[]|\Google\Protobuf\Internal\RepeatedField $attribute_indices
     *           References to attributes in attribute_table. [optional]
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Opentelemetry\Proto\Profiles\V1Development\Profiles::initOnce();
        parent::__construct($data);
    }

    /**
     * The type and unit of all Sample.values in this profile.
     * For a cpu or off-cpu profile this might be:
     *   ["cpu","nanoseconds"] or ["off_cpu","nanoseconds"]
     * For a heap profile, this might be:
     *   ["allocated_objects","count"] or ["allocated_space","bytes"],
     *
     * Generated from protobuf field <code>.opentelemetry.proto.profiles.v1development.ValueType sample_type = 1;</code>
     * @return \Opentelemetry\Proto\Profiles\V1development\ValueType|null
     */
    public function getSampleType()
    {
        return $this->sample_type;
    }

    public function hasSampleType()
    {
        return isset($this->sample_type);
    }

    public function clearSampleType()
    {
        unset($this->sample_type);
    }

    /**
     * The type and unit of all Sample.values in this profile.
     * For a cpu or off-cpu profile this might be:
     *   ["cpu","nanoseconds"] or ["off_cpu","nanoseconds"]
     * For a heap profile, this might be:
     *   ["allocated_objects","count"] or ["allocated_space","bytes"],
     *
     * Generated from protobuf field <code>.opentelemetry.proto.profiles.v1development.ValueType sample_type = 1;</code>
     * @param \Opentelemetry\Proto\Profiles\V1development\ValueType $var
     * @return $this
     */
    public function setSampleType($var)
    {
        GPBUtil::checkMessage($var, \Opentelemetry\Proto\Profiles\V1development\ValueType::class);
        $this->sample_type = $var;

        return $this;
    }

    /**
     * The set of samples recorded in this profile.
     *
     * Generated from protobuf field <code>repeated .opentelemetry.proto.profiles.v1development.Sample sample = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getSample()
    {
        return $this->sample;
    }

    /**
     * The set of samples recorded in this profile.
     *
     * Generated from protobuf field <code>repeated .opentelemetry.proto.profiles.v1development.Sample sample = 2;</code>
     * @param \Opentelemetry\Proto\Profiles\V1development\Sample[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setSample($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Profiles\V1development\Sample::class);
        $this->sample = $arr;

        return $this;
    }

    /**
     * Time of collection (UTC) represented as nanoseconds past the epoch.
     *
     * Generated from protobuf field <code>fixed64 time_unix_nano = 3;</code>
     * @return int|string
     */
    public function getTimeUnixNano()
    {
        return $this->time_unix_nano;
    }

    /**
     * Time of collection (UTC) represented as nanoseconds past the epoch.
     *
     * Generated from protobuf field <code>fixed64 time_unix_nano = 3;</code>
     * @param int|string $var
     * @return $this
     */
    public function setTimeUnixNano($var)
    {
        GPBUtil::checkUint64($var);
        $this->time_unix_nano = $var;

        return $this;
    }

    /**
     * Duration of the profile, if a duration makes sense.
     *
     * Generated from protobuf field <code>uint64 duration_nano = 4;</code>
     * @return int|string
     */
    public function getDurationNano()
    {
        return $this->duration_nano;
    }

    /**
     * Duration of the profile, if a duration makes sense.
     *
     * Generated from protobuf field <code>uint64 duration_nano = 4;</code>
     * @param int|string $var
     * @return $this
     */
    public function setDurationNano($var)
    {
        GPBUtil::checkUint64($var);
        $this->duration_nano = $var;

        return $this;
    }

    /**
     * The kind of events between sampled occurrences.
     * e.g [ "cpu","cycles" ] or [ "heap","bytes" ]
     *
     * Generated from protobuf field <code>.opentelemetry.proto.profiles.v1development.ValueType period_type = 5;</code>
     * @return \Opentelemetry\Proto\Profiles\V1development\ValueType|null
     */
    public function getPeriodType()
    {
        return $this->period_type;
    }

    public function hasPeriodType()
    {
        return isset($this->period_type);
    }

    public function clearPeriodType()
    {
        unset($this->period_type);
    }

    /**
     * The kind of events between sampled occurrences.
     * e.g [ "cpu","cycles" ] or [ "heap","bytes" ]
     *
     * Generated from protobuf field <code>.opentelemetry.proto.profiles.v1development.ValueType period_type = 5;</code>
     * @param \Opentelemetry\Proto\Profiles\V1development\ValueType $var
     * @return $this
     */
    public function setPeriodType($var)
    {
        GPBUtil::checkMessage($var, \Opentelemetry\Proto\Profiles\V1development\ValueType::class);
        $this->period_type = $var;

        return $this;
    }

    /**
     * The number of events between sampled occurrences.
     *
     * Generated from protobuf field <code>int64 period = 6;</code>
     * @return int|string
     */
    public function getPeriod()
    {
        return $this->period;
    }

    /**
     * The number of events between sampled occurrences.
     *
     * Generated from protobuf field <code>int64 period = 6;</code>
     * @param int|string $var
     * @return $this
     */
    public function setPeriod($var)
    {
        GPBUtil::checkInt64($var);
        $this->period = $var;

        return $this;
    }

    /**
     * Free-form text associated with the profile. The text is displayed as is
     * to the user by the tools that read profiles (e.g. by pprof). This field
     * should not be used to store any machine-readable information, it is only
     * for human-friendly content. The profile must stay functional if this field
     * is cleaned.
     *
     * Generated from protobuf field <code>repeated int32 comment_strindices = 7;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getCommentStrindices()
    {
        return $this->comment_strindices;
    }

    /**
     * Free-form text associated with the profile. The text is displayed as is
     * to the user by the tools that read profiles (e.g. by pprof). This field
     * should not be used to store any machine-readable information, it is only
     * for human-friendly content. The profile must stay functional if this field
     * is cleaned.
     *
     * Generated from protobuf field <code>repeated int32 comment_strindices = 7;</code>
     * @param int[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setCommentStrindices($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
        $this->comment_strindices = $arr;

        return $this;
    }

    /**
     * A globally unique identifier for a profile. The ID is a 16-byte array. An ID with
     * all zeroes is considered invalid. It may be used for deduplication and signal
     * correlation purposes. It is acceptable to treat two profiles with different values
     * in this field as not equal, even if they represented the same object at an earlier
     * time.
     * This field is optional; an ID may be assigned to an ID-less profile in a later step.
     *
     * Generated from protobuf field <code>bytes profile_id = 8;</code>
     * @return string
     */
    public function getProfileId()
    {
        return $this->profile_id;
    }

    /**
     * A globally unique identifier for a profile. The ID is a 16-byte array. An ID with
     * all zeroes is considered invalid. It may be used for deduplication and signal
     * correlation purposes. It is acceptable to treat two profiles with different values
     * in this field as not equal, even if they represented the same object at an earlier
     * time.
     * This field is optional; an ID may be assigned to an ID-less profile in a later step.
     *
     * Generated from protobuf field <code>bytes profile_id = 8;</code>
     * @param string $var
     * @return $this
     */
    public function setProfileId($var)
    {
        GPBUtil::checkString($var, False);
        $this->profile_id = $var;

        return $this;
    }

    /**
     * dropped_attributes_count is the number of attributes that were discarded. Attributes
     * can be discarded because their keys are too long or because there are too many
     * attributes. If this value is 0, then no attributes were dropped.
     *
     * Generated from protobuf field <code>uint32 dropped_attributes_count = 9;</code>
     * @return int
     */
    public function getDroppedAttributesCount()
    {
        return $this->dropped_attributes_count;
    }

    /**
     * dropped_attributes_count is the number of attributes that were discarded. Attributes
     * can be discarded because their keys are too long or because there are too many
     * attributes. If this value is 0, then no attributes were dropped.
     *
     * Generated from protobuf field <code>uint32 dropped_attributes_count = 9;</code>
     * @param int $var
     * @return $this
     */
    public function setDroppedAttributesCount($var)
    {
        GPBUtil::checkUint32($var);
        $this->dropped_attributes_count = $var;

        return $this;
    }

    /**
     * Specifies format of the original payload. Common values are defined in semantic conventions. [required if original_payload is present]
     *
     * Generated from protobuf field <code>string original_payload_format = 10;</code>
     * @return string
     */
    public function getOriginalPayloadFormat()
    {
        return $this->original_payload_format;
    }

    /**
     * Specifies format of the original payload. Common values are defined in semantic conventions. [required if original_payload is present]
     *
     * Generated from protobuf field <code>string original_payload_format = 10;</code>
     * @param string $var
     * @return $this
     */
    public function setOriginalPayloadFormat($var)
    {
        GPBUtil::checkString($var, True);
        $this->original_payload_format = $var;

        return $this;
    }

    /**
     * Original payload can be stored in this field. This can be useful for users who want to get the original payload.
     * Formats such as JFR are highly extensible and can contain more information than what is defined in this spec.
     * Inclusion of original payload should be configurable by the user. Default behavior should be to not include the original payload.
     * If the original payload is in pprof format, it SHOULD not be included in this field.
     * The field is optional, however if it is present then equivalent converted data should be populated in other fields
     * of this message as far as is practicable.
     *
     * Generated from protobuf field <code>bytes original_payload = 11;</code>
     * @return string
     */
    public function getOriginalPayload()
    {
        return $this->original_payload;
    }

    /**
     * Original payload can be stored in this field. This can be useful for users who want to get the original payload.
     * Formats such as JFR are highly extensible and can contain more information than what is defined in this spec.
     * Inclusion of original payload should be configurable by the user. Default behavior should be to not include the original payload.
     * If the original payload is in pprof format, it SHOULD not be included in this field.
     * The field is optional, however if it is present then equivalent converted data should be populated in other fields
     * of this message as far as is practicable.
     *
     * Generated from protobuf field <code>bytes original_payload = 11;</code>
     * @param string $var
     * @return $this
     */
    public function setOriginalPayload($var)
    {
        GPBUtil::checkString($var, False);
        $this->original_payload = $var;

        return $this;
    }

    /**
     * References to attributes in attribute_table. [optional]
     *
     * Generated from protobuf field <code>repeated int32 attribute_indices = 12;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAttributeIndices()
    {
        return $this->attribute_indices;
    }

    /**
     * References to attributes in attribute_table. [optional]
     *
     * Generated from protobuf field <code>repeated int32 attribute_indices = 12;</code>
     * @param int[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAttributeIndices($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
        $this->attribute_indices = $arr;

        return $this;
    }

}

