<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/vision/v1/product_search_service.proto

namespace Google\Cloud\Vision\V1;

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

/**
 * Request message for the `CreateReferenceImage` method.
 *
 * Generated from protobuf message <code>google.cloud.vision.v1.CreateReferenceImageRequest</code>
 */
class CreateReferenceImageRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Resource name of the product in which to create the reference image.
     * Format is
     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $parent = '';
    /**
     * Required. The reference image to create.
     * If an image ID is specified, it is ignored.
     *
     * Generated from protobuf field <code>.google.cloud.vision.v1.ReferenceImage reference_image = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $reference_image = null;
    /**
     * A user-supplied resource id for the ReferenceImage to be added. If set,
     * the server will attempt to use this value as the resource id. If it is
     * already in use, an error is returned with code ALREADY_EXISTS. Must be at
     * most 128 characters long. It cannot contain the character `/`.
     *
     * Generated from protobuf field <code>string reference_image_id = 3;</code>
     */
    private $reference_image_id = '';

    /**
     * @param string                                 $parent           Required. Resource name of the product in which to create the reference image.
     *
     *                                                                 Format is
     *                                                                 `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. Please see
     *                                                                 {@see ProductSearchClient::productName()} for help formatting this field.
     * @param \Google\Cloud\Vision\V1\ReferenceImage $referenceImage   Required. The reference image to create.
     *                                                                 If an image ID is specified, it is ignored.
     * @param string                                 $referenceImageId A user-supplied resource id for the ReferenceImage to be added. If set,
     *                                                                 the server will attempt to use this value as the resource id. If it is
     *                                                                 already in use, an error is returned with code ALREADY_EXISTS. Must be at
     *                                                                 most 128 characters long. It cannot contain the character `/`.
     *
     * @return \Google\Cloud\Vision\V1\CreateReferenceImageRequest
     *
     * @experimental
     */
    public static function build(string $parent, \Google\Cloud\Vision\V1\ReferenceImage $referenceImage, string $referenceImageId): self
    {
        return (new self())
            ->setParent($parent)
            ->setReferenceImage($referenceImage)
            ->setReferenceImageId($referenceImageId);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. Resource name of the product in which to create the reference image.
     *           Format is
     *           `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
     *     @type \Google\Cloud\Vision\V1\ReferenceImage $reference_image
     *           Required. The reference image to create.
     *           If an image ID is specified, it is ignored.
     *     @type string $reference_image_id
     *           A user-supplied resource id for the ReferenceImage to be added. If set,
     *           the server will attempt to use this value as the resource id. If it is
     *           already in use, an error is returned with code ALREADY_EXISTS. Must be at
     *           most 128 characters long. It cannot contain the character `/`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Vision\V1\ProductSearchService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Resource name of the product in which to create the reference image.
     * Format is
     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. Resource name of the product in which to create the reference image.
     * Format is
     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * Required. The reference image to create.
     * If an image ID is specified, it is ignored.
     *
     * Generated from protobuf field <code>.google.cloud.vision.v1.ReferenceImage reference_image = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Vision\V1\ReferenceImage|null
     */
    public function getReferenceImage()
    {
        return $this->reference_image;
    }

    public function hasReferenceImage()
    {
        return isset($this->reference_image);
    }

    public function clearReferenceImage()
    {
        unset($this->reference_image);
    }

    /**
     * Required. The reference image to create.
     * If an image ID is specified, it is ignored.
     *
     * Generated from protobuf field <code>.google.cloud.vision.v1.ReferenceImage reference_image = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Vision\V1\ReferenceImage $var
     * @return $this
     */
    public function setReferenceImage($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Vision\V1\ReferenceImage::class);
        $this->reference_image = $var;

        return $this;
    }

    /**
     * A user-supplied resource id for the ReferenceImage to be added. If set,
     * the server will attempt to use this value as the resource id. If it is
     * already in use, an error is returned with code ALREADY_EXISTS. Must be at
     * most 128 characters long. It cannot contain the character `/`.
     *
     * Generated from protobuf field <code>string reference_image_id = 3;</code>
     * @return string
     */
    public function getReferenceImageId()
    {
        return $this->reference_image_id;
    }

    /**
     * A user-supplied resource id for the ReferenceImage to be added. If set,
     * the server will attempt to use this value as the resource id. If it is
     * already in use, an error is returned with code ALREADY_EXISTS. Must be at
     * most 128 characters long. It cannot contain the character `/`.
     *
     * Generated from protobuf field <code>string reference_image_id = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setReferenceImageId($var)
    {
        GPBUtil::checkString($var, True);
        $this->reference_image_id = $var;

        return $this;
    }

}

