<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/shopping/merchant/reports/v1beta/reports.proto

namespace Google\Shopping\Merchant\Reports\V1beta;

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

/**
 * Fields available for query in `competitive_visibility_top_merchant_view`
 * table.
 * [Competitive
 * visibility](https://support.google.com/merchants/answer/11366442) report with
 * business with highest visibility.
 * Values are only set for fields requested explicitly in the request's search
 * query.
 *
 * Generated from protobuf message <code>google.shopping.merchant.reports.v1beta.CompetitiveVisibilityTopMerchantView</code>
 */
class CompetitiveVisibilityTopMerchantView extends \Google\Protobuf\Internal\Message
{
    /**
     * Date of this row.
     * Cannot be selected in the `SELECT` clause. A condition on `date` is
     * required in the `WHERE` clause.
     *
     * Generated from protobuf field <code>.google.type.Date date = 1;</code>
     */
    protected $date = null;
    /**
     * Domain of your competitor or your domain, if 'is_your_domain' is true.
     * Required in the `SELECT` clause. Cannot be filtered on in the 'WHERE'
     * clause.
     *
     * Generated from protobuf field <code>optional string domain = 2;</code>
     */
    protected $domain = null;
    /**
     * True if this row contains data for your domain.
     * Cannot be filtered on in the 'WHERE' clause.
     *
     * Generated from protobuf field <code>optional bool is_your_domain = 3;</code>
     */
    protected $is_your_domain = null;
    /**
     * Country where impressions appeared.
     * Required in the `SELECT` clause. A condition on `report_country_code` is
     * required in the `WHERE` clause.
     *
     * Generated from protobuf field <code>optional string report_country_code = 4;</code>
     */
    protected $report_country_code = null;
    /**
     * Google product category ID to calculate the report for, represented in
     * [Google's product
     * taxonomy](https://support.google.com/merchants/answer/6324436).
     * Required in the `SELECT` clause. A condition on `report_category_id` is
     * required in the `WHERE` clause.
     *
     * Generated from protobuf field <code>optional int64 report_category_id = 5;</code>
     */
    protected $report_category_id = null;
    /**
     * Traffic source of impressions.
     * Required in the `SELECT` clause.
     *
     * Generated from protobuf field <code>optional .google.shopping.merchant.reports.v1beta.TrafficSource traffic_source = 6;</code>
     */
    protected $traffic_source = null;
    /**
     * Position of the domain in the top merchants ranking for the selected keys
     * (`date`, `report_category_id`, `report_country_code`, `traffic_source`)
     * based on impressions. 1 is the highest.
     * Cannot be filtered on in the 'WHERE' clause.
     *
     * Generated from protobuf field <code>optional int64 rank = 7;</code>
     */
    protected $rank = null;
    /**
     * [Ads / organic ratio]
     * (https://support.google.com/merchants/answer/11366442#zippy=%2Cads-free-ratio)
     * shows how often the domain receives impressions from Shopping ads compared
     * to organic traffic. The number is rounded and bucketed.
     * Cannot be filtered on in the 'WHERE' clause.
     *
     * Generated from protobuf field <code>optional double ads_organic_ratio = 8;</code>
     */
    protected $ads_organic_ratio = null;
    /**
     * [Page overlap rate]
     * (https://support.google.com/merchants/answer/11366442#zippy=%2Cpage-overlap-rate)
     * shows how frequently competing retailers’ offers are shown together with
     * your offers on the same page.
     * Cannot be filtered on in the 'WHERE' clause.
     *
     * Generated from protobuf field <code>optional double page_overlap_rate = 9;</code>
     */
    protected $page_overlap_rate = null;
    /**
     * [Higher position rate]
     * (https://support.google.com/merchants/answer/11366442#zippy=%2Chigher-position-rate)
     * shows how often a competitor’s offer got placed in a higher position on the
     * page than your offer.
     * Cannot be filtered on in the 'WHERE' clause.
     *
     * Generated from protobuf field <code>optional double higher_position_rate = 10;</code>
     */
    protected $higher_position_rate = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Type\Date $date
     *           Date of this row.
     *           Cannot be selected in the `SELECT` clause. A condition on `date` is
     *           required in the `WHERE` clause.
     *     @type string $domain
     *           Domain of your competitor or your domain, if 'is_your_domain' is true.
     *           Required in the `SELECT` clause. Cannot be filtered on in the 'WHERE'
     *           clause.
     *     @type bool $is_your_domain
     *           True if this row contains data for your domain.
     *           Cannot be filtered on in the 'WHERE' clause.
     *     @type string $report_country_code
     *           Country where impressions appeared.
     *           Required in the `SELECT` clause. A condition on `report_country_code` is
     *           required in the `WHERE` clause.
     *     @type int|string $report_category_id
     *           Google product category ID to calculate the report for, represented in
     *           [Google's product
     *           taxonomy](https://support.google.com/merchants/answer/6324436).
     *           Required in the `SELECT` clause. A condition on `report_category_id` is
     *           required in the `WHERE` clause.
     *     @type int $traffic_source
     *           Traffic source of impressions.
     *           Required in the `SELECT` clause.
     *     @type int|string $rank
     *           Position of the domain in the top merchants ranking for the selected keys
     *           (`date`, `report_category_id`, `report_country_code`, `traffic_source`)
     *           based on impressions. 1 is the highest.
     *           Cannot be filtered on in the 'WHERE' clause.
     *     @type float $ads_organic_ratio
     *           [Ads / organic ratio]
     *           (https://support.google.com/merchants/answer/11366442#zippy=%2Cads-free-ratio)
     *           shows how often the domain receives impressions from Shopping ads compared
     *           to organic traffic. The number is rounded and bucketed.
     *           Cannot be filtered on in the 'WHERE' clause.
     *     @type float $page_overlap_rate
     *           [Page overlap rate]
     *           (https://support.google.com/merchants/answer/11366442#zippy=%2Cpage-overlap-rate)
     *           shows how frequently competing retailers’ offers are shown together with
     *           your offers on the same page.
     *           Cannot be filtered on in the 'WHERE' clause.
     *     @type float $higher_position_rate
     *           [Higher position rate]
     *           (https://support.google.com/merchants/answer/11366442#zippy=%2Chigher-position-rate)
     *           shows how often a competitor’s offer got placed in a higher position on the
     *           page than your offer.
     *           Cannot be filtered on in the 'WHERE' clause.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Shopping\Merchant\Reports\V1Beta\Reports::initOnce();
        parent::__construct($data);
    }

    /**
     * Date of this row.
     * Cannot be selected in the `SELECT` clause. A condition on `date` is
     * required in the `WHERE` clause.
     *
     * Generated from protobuf field <code>.google.type.Date date = 1;</code>
     * @return \Google\Type\Date|null
     */
    public function getDate()
    {
        return $this->date;
    }

    public function hasDate()
    {
        return isset($this->date);
    }

    public function clearDate()
    {
        unset($this->date);
    }

    /**
     * Date of this row.
     * Cannot be selected in the `SELECT` clause. A condition on `date` is
     * required in the `WHERE` clause.
     *
     * Generated from protobuf field <code>.google.type.Date date = 1;</code>
     * @param \Google\Type\Date $var
     * @return $this
     */
    public function setDate($var)
    {
        GPBUtil::checkMessage($var, \Google\Type\Date::class);
        $this->date = $var;

        return $this;
    }

    /**
     * Domain of your competitor or your domain, if 'is_your_domain' is true.
     * Required in the `SELECT` clause. Cannot be filtered on in the 'WHERE'
     * clause.
     *
     * Generated from protobuf field <code>optional string domain = 2;</code>
     * @return string
     */
    public function getDomain()
    {
        return isset($this->domain) ? $this->domain : '';
    }

    public function hasDomain()
    {
        return isset($this->domain);
    }

    public function clearDomain()
    {
        unset($this->domain);
    }

    /**
     * Domain of your competitor or your domain, if 'is_your_domain' is true.
     * Required in the `SELECT` clause. Cannot be filtered on in the 'WHERE'
     * clause.
     *
     * Generated from protobuf field <code>optional string domain = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setDomain($var)
    {
        GPBUtil::checkString($var, True);
        $this->domain = $var;

        return $this;
    }

    /**
     * True if this row contains data for your domain.
     * Cannot be filtered on in the 'WHERE' clause.
     *
     * Generated from protobuf field <code>optional bool is_your_domain = 3;</code>
     * @return bool
     */
    public function getIsYourDomain()
    {
        return isset($this->is_your_domain) ? $this->is_your_domain : false;
    }

    public function hasIsYourDomain()
    {
        return isset($this->is_your_domain);
    }

    public function clearIsYourDomain()
    {
        unset($this->is_your_domain);
    }

    /**
     * True if this row contains data for your domain.
     * Cannot be filtered on in the 'WHERE' clause.
     *
     * Generated from protobuf field <code>optional bool is_your_domain = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setIsYourDomain($var)
    {
        GPBUtil::checkBool($var);
        $this->is_your_domain = $var;

        return $this;
    }

    /**
     * Country where impressions appeared.
     * Required in the `SELECT` clause. A condition on `report_country_code` is
     * required in the `WHERE` clause.
     *
     * Generated from protobuf field <code>optional string report_country_code = 4;</code>
     * @return string
     */
    public function getReportCountryCode()
    {
        return isset($this->report_country_code) ? $this->report_country_code : '';
    }

    public function hasReportCountryCode()
    {
        return isset($this->report_country_code);
    }

    public function clearReportCountryCode()
    {
        unset($this->report_country_code);
    }

    /**
     * Country where impressions appeared.
     * Required in the `SELECT` clause. A condition on `report_country_code` is
     * required in the `WHERE` clause.
     *
     * Generated from protobuf field <code>optional string report_country_code = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setReportCountryCode($var)
    {
        GPBUtil::checkString($var, True);
        $this->report_country_code = $var;

        return $this;
    }

    /**
     * Google product category ID to calculate the report for, represented in
     * [Google's product
     * taxonomy](https://support.google.com/merchants/answer/6324436).
     * Required in the `SELECT` clause. A condition on `report_category_id` is
     * required in the `WHERE` clause.
     *
     * Generated from protobuf field <code>optional int64 report_category_id = 5;</code>
     * @return int|string
     */
    public function getReportCategoryId()
    {
        return isset($this->report_category_id) ? $this->report_category_id : 0;
    }

    public function hasReportCategoryId()
    {
        return isset($this->report_category_id);
    }

    public function clearReportCategoryId()
    {
        unset($this->report_category_id);
    }

    /**
     * Google product category ID to calculate the report for, represented in
     * [Google's product
     * taxonomy](https://support.google.com/merchants/answer/6324436).
     * Required in the `SELECT` clause. A condition on `report_category_id` is
     * required in the `WHERE` clause.
     *
     * Generated from protobuf field <code>optional int64 report_category_id = 5;</code>
     * @param int|string $var
     * @return $this
     */
    public function setReportCategoryId($var)
    {
        GPBUtil::checkInt64($var);
        $this->report_category_id = $var;

        return $this;
    }

    /**
     * Traffic source of impressions.
     * Required in the `SELECT` clause.
     *
     * Generated from protobuf field <code>optional .google.shopping.merchant.reports.v1beta.TrafficSource traffic_source = 6;</code>
     * @return int
     */
    public function getTrafficSource()
    {
        return isset($this->traffic_source) ? $this->traffic_source : 0;
    }

    public function hasTrafficSource()
    {
        return isset($this->traffic_source);
    }

    public function clearTrafficSource()
    {
        unset($this->traffic_source);
    }

    /**
     * Traffic source of impressions.
     * Required in the `SELECT` clause.
     *
     * Generated from protobuf field <code>optional .google.shopping.merchant.reports.v1beta.TrafficSource traffic_source = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setTrafficSource($var)
    {
        GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Reports\V1beta\TrafficSource::class);
        $this->traffic_source = $var;

        return $this;
    }

    /**
     * Position of the domain in the top merchants ranking for the selected keys
     * (`date`, `report_category_id`, `report_country_code`, `traffic_source`)
     * based on impressions. 1 is the highest.
     * Cannot be filtered on in the 'WHERE' clause.
     *
     * Generated from protobuf field <code>optional int64 rank = 7;</code>
     * @return int|string
     */
    public function getRank()
    {
        return isset($this->rank) ? $this->rank : 0;
    }

    public function hasRank()
    {
        return isset($this->rank);
    }

    public function clearRank()
    {
        unset($this->rank);
    }

    /**
     * Position of the domain in the top merchants ranking for the selected keys
     * (`date`, `report_category_id`, `report_country_code`, `traffic_source`)
     * based on impressions. 1 is the highest.
     * Cannot be filtered on in the 'WHERE' clause.
     *
     * Generated from protobuf field <code>optional int64 rank = 7;</code>
     * @param int|string $var
     * @return $this
     */
    public function setRank($var)
    {
        GPBUtil::checkInt64($var);
        $this->rank = $var;

        return $this;
    }

    /**
     * [Ads / organic ratio]
     * (https://support.google.com/merchants/answer/11366442#zippy=%2Cads-free-ratio)
     * shows how often the domain receives impressions from Shopping ads compared
     * to organic traffic. The number is rounded and bucketed.
     * Cannot be filtered on in the 'WHERE' clause.
     *
     * Generated from protobuf field <code>optional double ads_organic_ratio = 8;</code>
     * @return float
     */
    public function getAdsOrganicRatio()
    {
        return isset($this->ads_organic_ratio) ? $this->ads_organic_ratio : 0.0;
    }

    public function hasAdsOrganicRatio()
    {
        return isset($this->ads_organic_ratio);
    }

    public function clearAdsOrganicRatio()
    {
        unset($this->ads_organic_ratio);
    }

    /**
     * [Ads / organic ratio]
     * (https://support.google.com/merchants/answer/11366442#zippy=%2Cads-free-ratio)
     * shows how often the domain receives impressions from Shopping ads compared
     * to organic traffic. The number is rounded and bucketed.
     * Cannot be filtered on in the 'WHERE' clause.
     *
     * Generated from protobuf field <code>optional double ads_organic_ratio = 8;</code>
     * @param float $var
     * @return $this
     */
    public function setAdsOrganicRatio($var)
    {
        GPBUtil::checkDouble($var);
        $this->ads_organic_ratio = $var;

        return $this;
    }

    /**
     * [Page overlap rate]
     * (https://support.google.com/merchants/answer/11366442#zippy=%2Cpage-overlap-rate)
     * shows how frequently competing retailers’ offers are shown together with
     * your offers on the same page.
     * Cannot be filtered on in the 'WHERE' clause.
     *
     * Generated from protobuf field <code>optional double page_overlap_rate = 9;</code>
     * @return float
     */
    public function getPageOverlapRate()
    {
        return isset($this->page_overlap_rate) ? $this->page_overlap_rate : 0.0;
    }

    public function hasPageOverlapRate()
    {
        return isset($this->page_overlap_rate);
    }

    public function clearPageOverlapRate()
    {
        unset($this->page_overlap_rate);
    }

    /**
     * [Page overlap rate]
     * (https://support.google.com/merchants/answer/11366442#zippy=%2Cpage-overlap-rate)
     * shows how frequently competing retailers’ offers are shown together with
     * your offers on the same page.
     * Cannot be filtered on in the 'WHERE' clause.
     *
     * Generated from protobuf field <code>optional double page_overlap_rate = 9;</code>
     * @param float $var
     * @return $this
     */
    public function setPageOverlapRate($var)
    {
        GPBUtil::checkDouble($var);
        $this->page_overlap_rate = $var;

        return $this;
    }

    /**
     * [Higher position rate]
     * (https://support.google.com/merchants/answer/11366442#zippy=%2Chigher-position-rate)
     * shows how often a competitor’s offer got placed in a higher position on the
     * page than your offer.
     * Cannot be filtered on in the 'WHERE' clause.
     *
     * Generated from protobuf field <code>optional double higher_position_rate = 10;</code>
     * @return float
     */
    public function getHigherPositionRate()
    {
        return isset($this->higher_position_rate) ? $this->higher_position_rate : 0.0;
    }

    public function hasHigherPositionRate()
    {
        return isset($this->higher_position_rate);
    }

    public function clearHigherPositionRate()
    {
        unset($this->higher_position_rate);
    }

    /**
     * [Higher position rate]
     * (https://support.google.com/merchants/answer/11366442#zippy=%2Chigher-position-rate)
     * shows how often a competitor’s offer got placed in a higher position on the
     * page than your offer.
     * Cannot be filtered on in the 'WHERE' clause.
     *
     * Generated from protobuf field <code>optional double higher_position_rate = 10;</code>
     * @param float $var
     * @return $this
     */
    public function setHigherPositionRate($var)
    {
        GPBUtil::checkDouble($var);
        $this->higher_position_rate = $var;

        return $this;
    }

}

