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

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

/**
 * The pet policy of the property.
 *
 * Generated from protobuf message <code>google.shopping.merchant.products.v1.ProductAttributes.PetPolicy</code>
 */
class PetPolicy extends \Google\Protobuf\Internal\Message
{
    /**
     * Whether pets are allowed.
     *
     * Generated from protobuf field <code>bool pets_allowed = 1;</code>
     */
    protected $pets_allowed = false;
    /**
     * The pet types allowed.
     *
     * Generated from protobuf field <code>repeated .google.shopping.merchant.products.v1.ProductAttributes.PetPolicy.PetType pet_types = 2;</code>
     */
    private $pet_types;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $pets_allowed
     *           Whether pets are allowed.
     *     @type int[] $pet_types
     *           The pet types allowed.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Shopping\Merchant\Products\V1\ProductsCommon::initOnce();
        parent::__construct($data);
    }

    /**
     * Whether pets are allowed.
     *
     * Generated from protobuf field <code>bool pets_allowed = 1;</code>
     * @return bool
     */
    public function getPetsAllowed()
    {
        return $this->pets_allowed;
    }

    /**
     * Whether pets are allowed.
     *
     * Generated from protobuf field <code>bool pets_allowed = 1;</code>
     * @param bool $var
     * @return $this
     */
    public function setPetsAllowed($var)
    {
        GPBUtil::checkBool($var);
        $this->pets_allowed = $var;

        return $this;
    }

    /**
     * The pet types allowed.
     *
     * Generated from protobuf field <code>repeated .google.shopping.merchant.products.v1.ProductAttributes.PetPolicy.PetType pet_types = 2;</code>
     * @return RepeatedField<int>
     */
    public function getPetTypes()
    {
        return $this->pet_types;
    }

    /**
     * The pet types allowed.
     *
     * Generated from protobuf field <code>repeated .google.shopping.merchant.products.v1.ProductAttributes.PetPolicy.PetType pet_types = 2;</code>
     * @param int[] $var
     * @return $this
     */
    public function setPetTypes($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Shopping\Merchant\Products\V1\ProductAttributes\PetPolicy\PetType::class);
        $this->pet_types = $arr;

        return $this;
    }

}

