<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/analytics/admin/v1alpha/resources.proto

namespace Google\Analytics\Admin\V1alpha;

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

/**
 * A conversion event in a Google Analytics property.
 *
 * Generated from protobuf message <code>google.analytics.admin.v1alpha.ConversionEvent</code>
 */
class ConversionEvent extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. Resource name of this conversion event.
     * Format: properties/{property}/conversionEvents/{conversion_event}
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $name = '';
    /**
     * Immutable. The event name for this conversion event.
     * Examples: 'click', 'purchase'
     *
     * Generated from protobuf field <code>string event_name = 2 [(.google.api.field_behavior) = IMMUTABLE];</code>
     */
    private $event_name = '';
    /**
     * Output only. Time when this conversion event was created in the property.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $create_time = null;
    /**
     * Output only. If set, this event can currently be deleted via
     * DeleteConversionEvent.
     *
     * Generated from protobuf field <code>bool deletable = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $deletable = false;
    /**
     * Output only. If set to true, this conversion event refers to a custom
     * event.  If set to false, this conversion event refers to a default event in
     * GA. Default events typically have special meaning in GA. Default events are
     * usually created for you by the GA system, but in some cases can be created
     * by property admins. Custom events count towards the maximum number of
     * custom conversion events that may be created per property.
     *
     * Generated from protobuf field <code>bool custom = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $custom = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Output only. Resource name of this conversion event.
     *           Format: properties/{property}/conversionEvents/{conversion_event}
     *     @type string $event_name
     *           Immutable. The event name for this conversion event.
     *           Examples: 'click', 'purchase'
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. Time when this conversion event was created in the property.
     *     @type bool $deletable
     *           Output only. If set, this event can currently be deleted via
     *           DeleteConversionEvent.
     *     @type bool $custom
     *           Output only. If set to true, this conversion event refers to a custom
     *           event.  If set to false, this conversion event refers to a default event in
     *           GA. Default events typically have special meaning in GA. Default events are
     *           usually created for you by the GA system, but in some cases can be created
     *           by property admins. Custom events count towards the maximum number of
     *           custom conversion events that may be created per property.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Analytics\Admin\V1Alpha\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. Resource name of this conversion event.
     * Format: properties/{property}/conversionEvents/{conversion_event}
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Output only. Resource name of this conversion event.
     * Format: properties/{property}/conversionEvents/{conversion_event}
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Immutable. The event name for this conversion event.
     * Examples: 'click', 'purchase'
     *
     * Generated from protobuf field <code>string event_name = 2 [(.google.api.field_behavior) = IMMUTABLE];</code>
     * @return string
     */
    public function getEventName()
    {
        return $this->event_name;
    }

    /**
     * Immutable. The event name for this conversion event.
     * Examples: 'click', 'purchase'
     *
     * Generated from protobuf field <code>string event_name = 2 [(.google.api.field_behavior) = IMMUTABLE];</code>
     * @param string $var
     * @return $this
     */
    public function setEventName($var)
    {
        GPBUtil::checkString($var, True);
        $this->event_name = $var;

        return $this;
    }

    /**
     * Output only. Time when this conversion event was created in the property.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Output only. Time when this conversion event was created in the property.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Output only. If set, this event can currently be deleted via
     * DeleteConversionEvent.
     *
     * Generated from protobuf field <code>bool deletable = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return bool
     */
    public function getDeletable()
    {
        return $this->deletable;
    }

    /**
     * Output only. If set, this event can currently be deleted via
     * DeleteConversionEvent.
     *
     * Generated from protobuf field <code>bool deletable = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param bool $var
     * @return $this
     */
    public function setDeletable($var)
    {
        GPBUtil::checkBool($var);
        $this->deletable = $var;

        return $this;
    }

    /**
     * Output only. If set to true, this conversion event refers to a custom
     * event.  If set to false, this conversion event refers to a default event in
     * GA. Default events typically have special meaning in GA. Default events are
     * usually created for you by the GA system, but in some cases can be created
     * by property admins. Custom events count towards the maximum number of
     * custom conversion events that may be created per property.
     *
     * Generated from protobuf field <code>bool custom = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return bool
     */
    public function getCustom()
    {
        return $this->custom;
    }

    /**
     * Output only. If set to true, this conversion event refers to a custom
     * event.  If set to false, this conversion event refers to a default event in
     * GA. Default events typically have special meaning in GA. Default events are
     * usually created for you by the GA system, but in some cases can be created
     * by property admins. Custom events count towards the maximum number of
     * custom conversion events that may be created per property.
     *
     * Generated from protobuf field <code>bool custom = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param bool $var
     * @return $this
     */
    public function setCustom($var)
    {
        GPBUtil::checkBool($var);
        $this->custom = $var;

        return $this;
    }

}

