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

namespace Google\Shopping\Merchant\Products\V1;

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

/**
 * Product
 * [certification](https://support.google.com/merchants/answer/13528839),
 * initially introduced for EU energy efficiency labeling compliance using the
 * EU EPREL database.
 *
 * Generated from protobuf message <code>google.shopping.merchant.products.v1.ProductCertification</code>
 */
class ProductCertification extends \Google\Protobuf\Internal\Message
{
    /**
     * The certification authority.
     *
     * Generated from protobuf field <code>optional .google.shopping.merchant.products.v1.CertificationAuthority certification_authority = 1;</code>
     */
    protected $certification_authority = null;
    /**
     * The name of the certification.
     *
     * Generated from protobuf field <code>optional .google.shopping.merchant.products.v1.CertificationName certification_name = 2;</code>
     */
    protected $certification_name = null;
    /**
     * The certification code.
     * Maximum length is 2000 characters.
     *
     * Generated from protobuf field <code>optional string certification_code = 3;</code>
     */
    protected $certification_code = null;
    /**
     * The certification value (also known as class, level or grade), for
     * example "A+", "C", "gold". Maximum length is 2000 characters.
     *
     * Generated from protobuf field <code>optional string certification_value = 4;</code>
     */
    protected $certification_value = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $certification_authority
     *           The certification authority.
     *     @type int $certification_name
     *           The name of the certification.
     *     @type string $certification_code
     *           The certification code.
     *           Maximum length is 2000 characters.
     *     @type string $certification_value
     *           The certification value (also known as class, level or grade), for
     *           example "A+", "C", "gold". Maximum length is 2000 characters.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Shopping\Merchant\Products\V1\ProductsCommon::initOnce();
        parent::__construct($data);
    }

    /**
     * The certification authority.
     *
     * Generated from protobuf field <code>optional .google.shopping.merchant.products.v1.CertificationAuthority certification_authority = 1;</code>
     * @return int
     */
    public function getCertificationAuthority()
    {
        return isset($this->certification_authority) ? $this->certification_authority : 0;
    }

    public function hasCertificationAuthority()
    {
        return isset($this->certification_authority);
    }

    public function clearCertificationAuthority()
    {
        unset($this->certification_authority);
    }

    /**
     * The certification authority.
     *
     * Generated from protobuf field <code>optional .google.shopping.merchant.products.v1.CertificationAuthority certification_authority = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setCertificationAuthority($var)
    {
        GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Products\V1\CertificationAuthority::class);
        $this->certification_authority = $var;

        return $this;
    }

    /**
     * The name of the certification.
     *
     * Generated from protobuf field <code>optional .google.shopping.merchant.products.v1.CertificationName certification_name = 2;</code>
     * @return int
     */
    public function getCertificationName()
    {
        return isset($this->certification_name) ? $this->certification_name : 0;
    }

    public function hasCertificationName()
    {
        return isset($this->certification_name);
    }

    public function clearCertificationName()
    {
        unset($this->certification_name);
    }

    /**
     * The name of the certification.
     *
     * Generated from protobuf field <code>optional .google.shopping.merchant.products.v1.CertificationName certification_name = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setCertificationName($var)
    {
        GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Products\V1\CertificationName::class);
        $this->certification_name = $var;

        return $this;
    }

    /**
     * The certification code.
     * Maximum length is 2000 characters.
     *
     * Generated from protobuf field <code>optional string certification_code = 3;</code>
     * @return string
     */
    public function getCertificationCode()
    {
        return isset($this->certification_code) ? $this->certification_code : '';
    }

    public function hasCertificationCode()
    {
        return isset($this->certification_code);
    }

    public function clearCertificationCode()
    {
        unset($this->certification_code);
    }

    /**
     * The certification code.
     * Maximum length is 2000 characters.
     *
     * Generated from protobuf field <code>optional string certification_code = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setCertificationCode($var)
    {
        GPBUtil::checkString($var, True);
        $this->certification_code = $var;

        return $this;
    }

    /**
     * The certification value (also known as class, level or grade), for
     * example "A+", "C", "gold". Maximum length is 2000 characters.
     *
     * Generated from protobuf field <code>optional string certification_value = 4;</code>
     * @return string
     */
    public function getCertificationValue()
    {
        return isset($this->certification_value) ? $this->certification_value : '';
    }

    public function hasCertificationValue()
    {
        return isset($this->certification_value);
    }

    public function clearCertificationValue()
    {
        unset($this->certification_value);
    }

    /**
     * The certification value (also known as class, level or grade), for
     * example "A+", "C", "gold". Maximum length is 2000 characters.
     *
     * Generated from protobuf field <code>optional string certification_value = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setCertificationValue($var)
    {
        GPBUtil::checkString($var, True);
        $this->certification_value = $var;

        return $this;
    }

}

