<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/googleads/v22/common/criteria.proto

namespace Google\Ads\GoogleAds\V22\Common;

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

/**
 * Category of a product offer.
 *
 * Generated from protobuf message <code>google.ads.googleads.v22.common.ProductCategoryInfo</code>
 */
class ProductCategoryInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * ID of the product category.
     * This ID is equivalent to the google_product_category ID as described in
     * this article: https://support.google.com/merchants/answer/6324436
     *
     * Generated from protobuf field <code>optional int64 category_id = 1;</code>
     */
    protected $category_id = null;
    /**
     * Level of the product category.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v22.enums.ProductCategoryLevelEnum.ProductCategoryLevel level = 2;</code>
     */
    protected $level = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $category_id
     *           ID of the product category.
     *           This ID is equivalent to the google_product_category ID as described in
     *           this article: https://support.google.com/merchants/answer/6324436
     *     @type int $level
     *           Level of the product category.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V22\Common\Criteria::initOnce();
        parent::__construct($data);
    }

    /**
     * ID of the product category.
     * This ID is equivalent to the google_product_category ID as described in
     * this article: https://support.google.com/merchants/answer/6324436
     *
     * Generated from protobuf field <code>optional int64 category_id = 1;</code>
     * @return int|string
     */
    public function getCategoryId()
    {
        return isset($this->category_id) ? $this->category_id : 0;
    }

    public function hasCategoryId()
    {
        return isset($this->category_id);
    }

    public function clearCategoryId()
    {
        unset($this->category_id);
    }

    /**
     * ID of the product category.
     * This ID is equivalent to the google_product_category ID as described in
     * this article: https://support.google.com/merchants/answer/6324436
     *
     * Generated from protobuf field <code>optional int64 category_id = 1;</code>
     * @param int|string $var
     * @return $this
     */
    public function setCategoryId($var)
    {
        GPBUtil::checkInt64($var);
        $this->category_id = $var;

        return $this;
    }

    /**
     * Level of the product category.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v22.enums.ProductCategoryLevelEnum.ProductCategoryLevel level = 2;</code>
     * @return int
     */
    public function getLevel()
    {
        return $this->level;
    }

    /**
     * Level of the product category.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v22.enums.ProductCategoryLevelEnum.ProductCategoryLevel level = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setLevel($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V22\Enums\ProductCategoryLevelEnum\ProductCategoryLevel::class);
        $this->level = $var;

        return $this;
    }

}

