<?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\ProductStatus;

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

/**
 * The ItemLevelIssue of the product status.
 *
 * Generated from protobuf message <code>google.shopping.merchant.products.v1.ProductStatus.ItemLevelIssue</code>
 */
class ItemLevelIssue extends \Google\Protobuf\Internal\Message
{
    /**
     * The error code of the issue.
     *
     * Generated from protobuf field <code>string code = 1;</code>
     */
    protected $code = '';
    /**
     * How this issue affects serving of the offer.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.products.v1.ProductStatus.ItemLevelIssue.Severity severity = 2;</code>
     */
    protected $severity = 0;
    /**
     * Whether the issue can be resolved by the business.
     *
     * Generated from protobuf field <code>string resolution = 3;</code>
     */
    protected $resolution = '';
    /**
     * The attribute's name, if the issue is caused by a single attribute.
     *
     * Generated from protobuf field <code>string attribute = 4;</code>
     */
    protected $attribute = '';
    /**
     * The reporting context the issue applies to.
     *
     * Generated from protobuf field <code>.google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 5;</code>
     */
    protected $reporting_context = 0;
    /**
     * A short issue description in English.
     *
     * Generated from protobuf field <code>string description = 6;</code>
     */
    protected $description = '';
    /**
     * A detailed issue description in English.
     *
     * Generated from protobuf field <code>string detail = 7;</code>
     */
    protected $detail = '';
    /**
     * The URL of a web page to help with resolving this issue.
     *
     * Generated from protobuf field <code>string documentation = 8;</code>
     */
    protected $documentation = '';
    /**
     * List of country codes (ISO 3166-1 alpha-2) where issue applies to the
     * offer.
     *
     * Generated from protobuf field <code>repeated string applicable_countries = 9;</code>
     */
    private $applicable_countries;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $code
     *           The error code of the issue.
     *     @type int $severity
     *           How this issue affects serving of the offer.
     *     @type string $resolution
     *           Whether the issue can be resolved by the business.
     *     @type string $attribute
     *           The attribute's name, if the issue is caused by a single attribute.
     *     @type int $reporting_context
     *           The reporting context the issue applies to.
     *     @type string $description
     *           A short issue description in English.
     *     @type string $detail
     *           A detailed issue description in English.
     *     @type string $documentation
     *           The URL of a web page to help with resolving this issue.
     *     @type string[] $applicable_countries
     *           List of country codes (ISO 3166-1 alpha-2) where issue applies to the
     *           offer.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Shopping\Merchant\Products\V1\ProductsCommon::initOnce();
        parent::__construct($data);
    }

    /**
     * The error code of the issue.
     *
     * Generated from protobuf field <code>string code = 1;</code>
     * @return string
     */
    public function getCode()
    {
        return $this->code;
    }

    /**
     * The error code of the issue.
     *
     * Generated from protobuf field <code>string code = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setCode($var)
    {
        GPBUtil::checkString($var, True);
        $this->code = $var;

        return $this;
    }

    /**
     * How this issue affects serving of the offer.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.products.v1.ProductStatus.ItemLevelIssue.Severity severity = 2;</code>
     * @return int
     */
    public function getSeverity()
    {
        return $this->severity;
    }

    /**
     * How this issue affects serving of the offer.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.products.v1.ProductStatus.ItemLevelIssue.Severity severity = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setSeverity($var)
    {
        GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Products\V1\ProductStatus\ItemLevelIssue\Severity::class);
        $this->severity = $var;

        return $this;
    }

    /**
     * Whether the issue can be resolved by the business.
     *
     * Generated from protobuf field <code>string resolution = 3;</code>
     * @return string
     */
    public function getResolution()
    {
        return $this->resolution;
    }

    /**
     * Whether the issue can be resolved by the business.
     *
     * Generated from protobuf field <code>string resolution = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setResolution($var)
    {
        GPBUtil::checkString($var, True);
        $this->resolution = $var;

        return $this;
    }

    /**
     * The attribute's name, if the issue is caused by a single attribute.
     *
     * Generated from protobuf field <code>string attribute = 4;</code>
     * @return string
     */
    public function getAttribute()
    {
        return $this->attribute;
    }

    /**
     * The attribute's name, if the issue is caused by a single attribute.
     *
     * Generated from protobuf field <code>string attribute = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setAttribute($var)
    {
        GPBUtil::checkString($var, True);
        $this->attribute = $var;

        return $this;
    }

    /**
     * The reporting context the issue applies to.
     *
     * Generated from protobuf field <code>.google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 5;</code>
     * @return int
     */
    public function getReportingContext()
    {
        return $this->reporting_context;
    }

    /**
     * The reporting context the issue applies to.
     *
     * Generated from protobuf field <code>.google.shopping.type.ReportingContext.ReportingContextEnum reporting_context = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setReportingContext($var)
    {
        GPBUtil::checkEnum($var, \Google\Shopping\Type\ReportingContext\ReportingContextEnum::class);
        $this->reporting_context = $var;

        return $this;
    }

    /**
     * A short issue description in English.
     *
     * Generated from protobuf field <code>string description = 6;</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * A short issue description in English.
     *
     * Generated from protobuf field <code>string description = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * A detailed issue description in English.
     *
     * Generated from protobuf field <code>string detail = 7;</code>
     * @return string
     */
    public function getDetail()
    {
        return $this->detail;
    }

    /**
     * A detailed issue description in English.
     *
     * Generated from protobuf field <code>string detail = 7;</code>
     * @param string $var
     * @return $this
     */
    public function setDetail($var)
    {
        GPBUtil::checkString($var, True);
        $this->detail = $var;

        return $this;
    }

    /**
     * The URL of a web page to help with resolving this issue.
     *
     * Generated from protobuf field <code>string documentation = 8;</code>
     * @return string
     */
    public function getDocumentation()
    {
        return $this->documentation;
    }

    /**
     * The URL of a web page to help with resolving this issue.
     *
     * Generated from protobuf field <code>string documentation = 8;</code>
     * @param string $var
     * @return $this
     */
    public function setDocumentation($var)
    {
        GPBUtil::checkString($var, True);
        $this->documentation = $var;

        return $this;
    }

    /**
     * List of country codes (ISO 3166-1 alpha-2) where issue applies to the
     * offer.
     *
     * Generated from protobuf field <code>repeated string applicable_countries = 9;</code>
     * @return RepeatedField<string>
     */
    public function getApplicableCountries()
    {
        return $this->applicable_countries;
    }

    /**
     * List of country codes (ISO 3166-1 alpha-2) where issue applies to the
     * offer.
     *
     * Generated from protobuf field <code>repeated string applicable_countries = 9;</code>
     * @param string[] $var
     * @return $this
     */
    public function setApplicableCountries($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->applicable_countries = $arr;

        return $this;
    }

}

