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

/**
 * Specifies how other products are related to this product.
 *
 * Generated from protobuf message <code>google.shopping.merchant.products.v1.ProductAttributes.RelatedProduct</code>
 */
class RelatedProduct extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The type of the relationship between this product and the
     * related product.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.products.v1.ProductAttributes.RelatedProduct.RelationshipType relationship_type = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $relationship_type = 0;
    /**
     * Required. The type of the identifier of the related product.
     * For example, [GTIN](https://support.google.com/merchants/answer/6219078)
     * or [product ID](https://support.google.com/merchants/answer/6324405).
     *
     * Generated from protobuf field <code>.google.shopping.merchant.products.v1.ProductAttributes.RelatedProduct.IdType id_type = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $id_type = 0;
    /**
     * Required. The identifier of the related product.
     *
     * Generated from protobuf field <code>string id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $id = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $relationship_type
     *           Required. The type of the relationship between this product and the
     *           related product.
     *     @type int $id_type
     *           Required. The type of the identifier of the related product.
     *           For example, [GTIN](https://support.google.com/merchants/answer/6219078)
     *           or [product ID](https://support.google.com/merchants/answer/6324405).
     *     @type string $id
     *           Required. The identifier of the related product.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Shopping\Merchant\Products\V1\ProductsCommon::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The type of the relationship between this product and the
     * related product.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.products.v1.ProductAttributes.RelatedProduct.RelationshipType relationship_type = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getRelationshipType()
    {
        return $this->relationship_type;
    }

    /**
     * Required. The type of the relationship between this product and the
     * related product.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.products.v1.ProductAttributes.RelatedProduct.RelationshipType relationship_type = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setRelationshipType($var)
    {
        GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Products\V1\ProductAttributes\RelatedProduct\RelationshipType::class);
        $this->relationship_type = $var;

        return $this;
    }

    /**
     * Required. The type of the identifier of the related product.
     * For example, [GTIN](https://support.google.com/merchants/answer/6219078)
     * or [product ID](https://support.google.com/merchants/answer/6324405).
     *
     * Generated from protobuf field <code>.google.shopping.merchant.products.v1.ProductAttributes.RelatedProduct.IdType id_type = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getIdType()
    {
        return $this->id_type;
    }

    /**
     * Required. The type of the identifier of the related product.
     * For example, [GTIN](https://support.google.com/merchants/answer/6219078)
     * or [product ID](https://support.google.com/merchants/answer/6324405).
     *
     * Generated from protobuf field <code>.google.shopping.merchant.products.v1.ProductAttributes.RelatedProduct.IdType id_type = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setIdType($var)
    {
        GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Products\V1\ProductAttributes\RelatedProduct\IdType::class);
        $this->id_type = $var;

        return $this;
    }

    /**
     * Required. The identifier of the related product.
     *
     * Generated from protobuf field <code>string id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Required. The identifier of the related product.
     *
     * Generated from protobuf field <code>string id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

}

