<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/retail/v2/search_service.proto

namespace Google\Cloud\Retail\V2\SearchRequest;

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

/**
 * Boost specification to boost certain items.
 *
 * Generated from protobuf message <code>google.cloud.retail.v2.SearchRequest.BoostSpec</code>
 */
class BoostSpec extends \Google\Protobuf\Internal\Message
{
    /**
     * Condition boost specifications. If a product matches multiple conditions
     * in the specifictions, boost scores from these specifications are all
     * applied and combined in a non-linear way. Maximum number of
     * specifications is 20.
     *
     * Generated from protobuf field <code>repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;</code>
     */
    private $condition_boost_specs;
    /**
     * Whether to skip boostspec validation. If this field is set to true,
     * invalid
     * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
     * will be ignored and valid
     * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
     * will still be applied.
     *
     * Generated from protobuf field <code>optional bool skip_boost_spec_validation = 2;</code>
     */
    private $skip_boost_spec_validation = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Cloud\Retail\V2\SearchRequest\BoostSpec\ConditionBoostSpec>|\Google\Protobuf\Internal\RepeatedField $condition_boost_specs
     *           Condition boost specifications. If a product matches multiple conditions
     *           in the specifictions, boost scores from these specifications are all
     *           applied and combined in a non-linear way. Maximum number of
     *           specifications is 20.
     *     @type bool $skip_boost_spec_validation
     *           Whether to skip boostspec validation. If this field is set to true,
     *           invalid
     *           [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
     *           will be ignored and valid
     *           [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
     *           will still be applied.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce();
        parent::__construct($data);
    }

    /**
     * Condition boost specifications. If a product matches multiple conditions
     * in the specifictions, boost scores from these specifications are all
     * applied and combined in a non-linear way. Maximum number of
     * specifications is 20.
     *
     * Generated from protobuf field <code>repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getConditionBoostSpecs()
    {
        return $this->condition_boost_specs;
    }

    /**
     * Condition boost specifications. If a product matches multiple conditions
     * in the specifictions, boost scores from these specifications are all
     * applied and combined in a non-linear way. Maximum number of
     * specifications is 20.
     *
     * Generated from protobuf field <code>repeated .google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec condition_boost_specs = 1;</code>
     * @param array<\Google\Cloud\Retail\V2\SearchRequest\BoostSpec\ConditionBoostSpec>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setConditionBoostSpecs($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\SearchRequest\BoostSpec\ConditionBoostSpec::class);
        $this->condition_boost_specs = $arr;

        return $this;
    }

    /**
     * Whether to skip boostspec validation. If this field is set to true,
     * invalid
     * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
     * will be ignored and valid
     * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
     * will still be applied.
     *
     * Generated from protobuf field <code>optional bool skip_boost_spec_validation = 2;</code>
     * @return bool
     */
    public function getSkipBoostSpecValidation()
    {
        return isset($this->skip_boost_spec_validation) ? $this->skip_boost_spec_validation : false;
    }

    public function hasSkipBoostSpecValidation()
    {
        return isset($this->skip_boost_spec_validation);
    }

    public function clearSkipBoostSpecValidation()
    {
        unset($this->skip_boost_spec_validation);
    }

    /**
     * Whether to skip boostspec validation. If this field is set to true,
     * invalid
     * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
     * will be ignored and valid
     * [BoostSpec.condition_boost_specs][google.cloud.retail.v2.SearchRequest.BoostSpec.condition_boost_specs]
     * will still be applied.
     *
     * Generated from protobuf field <code>optional bool skip_boost_spec_validation = 2;</code>
     * @param bool $var
     * @return $this
     */
    public function setSkipBoostSpecValidation($var)
    {
        GPBUtil::checkBool($var);
        $this->skip_boost_spec_validation = $var;

        return $this;
    }

}


