<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: src/proto/grpc/testing/control.proto

namespace Grpc\Testing;

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

/**
 * Generated from protobuf message <code>grpc.testing.ClientConfig</code>
 */
class ClientConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * List of targets to connect to. At least one target needs to be specified.
     *
     * Generated from protobuf field <code>repeated string server_targets = 1;</code>
     */
    private $server_targets;
    /**
     * Generated from protobuf field <code>.grpc.testing.ClientType client_type = 2;</code>
     */
    protected $client_type = 0;
    /**
     * Generated from protobuf field <code>.grpc.testing.SecurityParams security_params = 3;</code>
     */
    protected $security_params = null;
    /**
     * How many concurrent RPCs to start for each channel.
     * For synchronous client, use a separate thread for each outstanding RPC.
     *
     * Generated from protobuf field <code>int32 outstanding_rpcs_per_channel = 4;</code>
     */
    protected $outstanding_rpcs_per_channel = 0;
    /**
     * Number of independent client channels to create.
     * i-th channel will connect to server_target[i % server_targets.size()]
     *
     * Generated from protobuf field <code>int32 client_channels = 5;</code>
     */
    protected $client_channels = 0;
    /**
     * Only for async client. Number of threads to use to start/manage RPCs.
     *
     * Generated from protobuf field <code>int32 async_client_threads = 7;</code>
     */
    protected $async_client_threads = 0;
    /**
     * Generated from protobuf field <code>.grpc.testing.RpcType rpc_type = 8;</code>
     */
    protected $rpc_type = 0;
    /**
     * The requested load for the entire client (aggregated over all the threads).
     *
     * Generated from protobuf field <code>.grpc.testing.LoadParams load_params = 10;</code>
     */
    protected $load_params = null;
    /**
     * Generated from protobuf field <code>.grpc.testing.PayloadConfig payload_config = 11;</code>
     */
    protected $payload_config = null;
    /**
     * Generated from protobuf field <code>.grpc.testing.HistogramParams histogram_params = 12;</code>
     */
    protected $histogram_params = null;
    /**
     * Specify the cores we should run the client on, if desired
     *
     * Generated from protobuf field <code>repeated int32 core_list = 13;</code>
     */
    private $core_list;
    /**
     * Generated from protobuf field <code>int32 core_limit = 14;</code>
     */
    protected $core_limit = 0;
    /**
     * If we use an OTHER_CLIENT client_type, this string gives more detail
     *
     * Generated from protobuf field <code>string other_client_api = 15;</code>
     */
    protected $other_client_api = '';
    /**
     * Generated from protobuf field <code>repeated .grpc.testing.ChannelArg channel_args = 16;</code>
     */
    private $channel_args;
    /**
     * Number of threads that share each completion queue
     *
     * Generated from protobuf field <code>int32 threads_per_cq = 17;</code>
     */
    protected $threads_per_cq = 0;
    /**
     * Number of messages on a stream before it gets finished/restarted
     *
     * Generated from protobuf field <code>int32 messages_per_stream = 18;</code>
     */
    protected $messages_per_stream = 0;
    /**
     * Use coalescing API when possible.
     *
     * Generated from protobuf field <code>bool use_coalesce_api = 19;</code>
     */
    protected $use_coalesce_api = false;
    /**
     * If 0, disabled. Else, specifies the period between gathering latency
     * medians in milliseconds.
     *
     * Generated from protobuf field <code>int32 median_latency_collection_interval_millis = 20;</code>
     */
    protected $median_latency_collection_interval_millis = 0;
    /**
     * Number of client processes. 0 indicates no restriction.
     *
     * Generated from protobuf field <code>int32 client_processes = 21;</code>
     */
    protected $client_processes = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string[]|\Google\Protobuf\Internal\RepeatedField $server_targets
     *           List of targets to connect to. At least one target needs to be specified.
     *     @type int $client_type
     *     @type \Grpc\Testing\SecurityParams $security_params
     *     @type int $outstanding_rpcs_per_channel
     *           How many concurrent RPCs to start for each channel.
     *           For synchronous client, use a separate thread for each outstanding RPC.
     *     @type int $client_channels
     *           Number of independent client channels to create.
     *           i-th channel will connect to server_target[i % server_targets.size()]
     *     @type int $async_client_threads
     *           Only for async client. Number of threads to use to start/manage RPCs.
     *     @type int $rpc_type
     *     @type \Grpc\Testing\LoadParams $load_params
     *           The requested load for the entire client (aggregated over all the threads).
     *     @type \Grpc\Testing\PayloadConfig $payload_config
     *     @type \Grpc\Testing\HistogramParams $histogram_params
     *     @type int[]|\Google\Protobuf\Internal\RepeatedField $core_list
     *           Specify the cores we should run the client on, if desired
     *     @type int $core_limit
     *     @type string $other_client_api
     *           If we use an OTHER_CLIENT client_type, this string gives more detail
     *     @type \Grpc\Testing\ChannelArg[]|\Google\Protobuf\Internal\RepeatedField $channel_args
     *     @type int $threads_per_cq
     *           Number of threads that share each completion queue
     *     @type int $messages_per_stream
     *           Number of messages on a stream before it gets finished/restarted
     *     @type bool $use_coalesce_api
     *           Use coalescing API when possible.
     *     @type int $median_latency_collection_interval_millis
     *           If 0, disabled. Else, specifies the period between gathering latency
     *           medians in milliseconds.
     *     @type int $client_processes
     *           Number of client processes. 0 indicates no restriction.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Src\Proto\Grpc\Testing\Control::initOnce();
        parent::__construct($data);
    }

    /**
     * List of targets to connect to. At least one target needs to be specified.
     *
     * Generated from protobuf field <code>repeated string server_targets = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getServerTargets()
    {
        return $this->server_targets;
    }

    /**
     * List of targets to connect to. At least one target needs to be specified.
     *
     * Generated from protobuf field <code>repeated string server_targets = 1;</code>
     * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setServerTargets($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->server_targets = $arr;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.grpc.testing.ClientType client_type = 2;</code>
     * @return int
     */
    public function getClientType()
    {
        return $this->client_type;
    }

    /**
     * Generated from protobuf field <code>.grpc.testing.ClientType client_type = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setClientType($var)
    {
        GPBUtil::checkEnum($var, \Grpc\Testing\ClientType::class);
        $this->client_type = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.grpc.testing.SecurityParams security_params = 3;</code>
     * @return \Grpc\Testing\SecurityParams
     */
    public function getSecurityParams()
    {
        return $this->security_params;
    }

    /**
     * Generated from protobuf field <code>.grpc.testing.SecurityParams security_params = 3;</code>
     * @param \Grpc\Testing\SecurityParams $var
     * @return $this
     */
    public function setSecurityParams($var)
    {
        GPBUtil::checkMessage($var, \Grpc\Testing\SecurityParams::class);
        $this->security_params = $var;

        return $this;
    }

    /**
     * How many concurrent RPCs to start for each channel.
     * For synchronous client, use a separate thread for each outstanding RPC.
     *
     * Generated from protobuf field <code>int32 outstanding_rpcs_per_channel = 4;</code>
     * @return int
     */
    public function getOutstandingRpcsPerChannel()
    {
        return $this->outstanding_rpcs_per_channel;
    }

    /**
     * How many concurrent RPCs to start for each channel.
     * For synchronous client, use a separate thread for each outstanding RPC.
     *
     * Generated from protobuf field <code>int32 outstanding_rpcs_per_channel = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setOutstandingRpcsPerChannel($var)
    {
        GPBUtil::checkInt32($var);
        $this->outstanding_rpcs_per_channel = $var;

        return $this;
    }

    /**
     * Number of independent client channels to create.
     * i-th channel will connect to server_target[i % server_targets.size()]
     *
     * Generated from protobuf field <code>int32 client_channels = 5;</code>
     * @return int
     */
    public function getClientChannels()
    {
        return $this->client_channels;
    }

    /**
     * Number of independent client channels to create.
     * i-th channel will connect to server_target[i % server_targets.size()]
     *
     * Generated from protobuf field <code>int32 client_channels = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setClientChannels($var)
    {
        GPBUtil::checkInt32($var);
        $this->client_channels = $var;

        return $this;
    }

    /**
     * Only for async client. Number of threads to use to start/manage RPCs.
     *
     * Generated from protobuf field <code>int32 async_client_threads = 7;</code>
     * @return int
     */
    public function getAsyncClientThreads()
    {
        return $this->async_client_threads;
    }

    /**
     * Only for async client. Number of threads to use to start/manage RPCs.
     *
     * Generated from protobuf field <code>int32 async_client_threads = 7;</code>
     * @param int $var
     * @return $this
     */
    public function setAsyncClientThreads($var)
    {
        GPBUtil::checkInt32($var);
        $this->async_client_threads = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.grpc.testing.RpcType rpc_type = 8;</code>
     * @return int
     */
    public function getRpcType()
    {
        return $this->rpc_type;
    }

    /**
     * Generated from protobuf field <code>.grpc.testing.RpcType rpc_type = 8;</code>
     * @param int $var
     * @return $this
     */
    public function setRpcType($var)
    {
        GPBUtil::checkEnum($var, \Grpc\Testing\RpcType::class);
        $this->rpc_type = $var;

        return $this;
    }

    /**
     * The requested load for the entire client (aggregated over all the threads).
     *
     * Generated from protobuf field <code>.grpc.testing.LoadParams load_params = 10;</code>
     * @return \Grpc\Testing\LoadParams
     */
    public function getLoadParams()
    {
        return $this->load_params;
    }

    /**
     * The requested load for the entire client (aggregated over all the threads).
     *
     * Generated from protobuf field <code>.grpc.testing.LoadParams load_params = 10;</code>
     * @param \Grpc\Testing\LoadParams $var
     * @return $this
     */
    public function setLoadParams($var)
    {
        GPBUtil::checkMessage($var, \Grpc\Testing\LoadParams::class);
        $this->load_params = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.grpc.testing.PayloadConfig payload_config = 11;</code>
     * @return \Grpc\Testing\PayloadConfig
     */
    public function getPayloadConfig()
    {
        return $this->payload_config;
    }

    /**
     * Generated from protobuf field <code>.grpc.testing.PayloadConfig payload_config = 11;</code>
     * @param \Grpc\Testing\PayloadConfig $var
     * @return $this
     */
    public function setPayloadConfig($var)
    {
        GPBUtil::checkMessage($var, \Grpc\Testing\PayloadConfig::class);
        $this->payload_config = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.grpc.testing.HistogramParams histogram_params = 12;</code>
     * @return \Grpc\Testing\HistogramParams
     */
    public function getHistogramParams()
    {
        return $this->histogram_params;
    }

    /**
     * Generated from protobuf field <code>.grpc.testing.HistogramParams histogram_params = 12;</code>
     * @param \Grpc\Testing\HistogramParams $var
     * @return $this
     */
    public function setHistogramParams($var)
    {
        GPBUtil::checkMessage($var, \Grpc\Testing\HistogramParams::class);
        $this->histogram_params = $var;

        return $this;
    }

    /**
     * Specify the cores we should run the client on, if desired
     *
     * Generated from protobuf field <code>repeated int32 core_list = 13;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getCoreList()
    {
        return $this->core_list;
    }

    /**
     * Specify the cores we should run the client on, if desired
     *
     * Generated from protobuf field <code>repeated int32 core_list = 13;</code>
     * @param int[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setCoreList($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
        $this->core_list = $arr;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int32 core_limit = 14;</code>
     * @return int
     */
    public function getCoreLimit()
    {
        return $this->core_limit;
    }

    /**
     * Generated from protobuf field <code>int32 core_limit = 14;</code>
     * @param int $var
     * @return $this
     */
    public function setCoreLimit($var)
    {
        GPBUtil::checkInt32($var);
        $this->core_limit = $var;

        return $this;
    }

    /**
     * If we use an OTHER_CLIENT client_type, this string gives more detail
     *
     * Generated from protobuf field <code>string other_client_api = 15;</code>
     * @return string
     */
    public function getOtherClientApi()
    {
        return $this->other_client_api;
    }

    /**
     * If we use an OTHER_CLIENT client_type, this string gives more detail
     *
     * Generated from protobuf field <code>string other_client_api = 15;</code>
     * @param string $var
     * @return $this
     */
    public function setOtherClientApi($var)
    {
        GPBUtil::checkString($var, True);
        $this->other_client_api = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated .grpc.testing.ChannelArg channel_args = 16;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getChannelArgs()
    {
        return $this->channel_args;
    }

    /**
     * Generated from protobuf field <code>repeated .grpc.testing.ChannelArg channel_args = 16;</code>
     * @param \Grpc\Testing\ChannelArg[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setChannelArgs($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Grpc\Testing\ChannelArg::class);
        $this->channel_args = $arr;

        return $this;
    }

    /**
     * Number of threads that share each completion queue
     *
     * Generated from protobuf field <code>int32 threads_per_cq = 17;</code>
     * @return int
     */
    public function getThreadsPerCq()
    {
        return $this->threads_per_cq;
    }

    /**
     * Number of threads that share each completion queue
     *
     * Generated from protobuf field <code>int32 threads_per_cq = 17;</code>
     * @param int $var
     * @return $this
     */
    public function setThreadsPerCq($var)
    {
        GPBUtil::checkInt32($var);
        $this->threads_per_cq = $var;

        return $this;
    }

    /**
     * Number of messages on a stream before it gets finished/restarted
     *
     * Generated from protobuf field <code>int32 messages_per_stream = 18;</code>
     * @return int
     */
    public function getMessagesPerStream()
    {
        return $this->messages_per_stream;
    }

    /**
     * Number of messages on a stream before it gets finished/restarted
     *
     * Generated from protobuf field <code>int32 messages_per_stream = 18;</code>
     * @param int $var
     * @return $this
     */
    public function setMessagesPerStream($var)
    {
        GPBUtil::checkInt32($var);
        $this->messages_per_stream = $var;

        return $this;
    }

    /**
     * Use coalescing API when possible.
     *
     * Generated from protobuf field <code>bool use_coalesce_api = 19;</code>
     * @return bool
     */
    public function getUseCoalesceApi()
    {
        return $this->use_coalesce_api;
    }

    /**
     * Use coalescing API when possible.
     *
     * Generated from protobuf field <code>bool use_coalesce_api = 19;</code>
     * @param bool $var
     * @return $this
     */
    public function setUseCoalesceApi($var)
    {
        GPBUtil::checkBool($var);
        $this->use_coalesce_api = $var;

        return $this;
    }

    /**
     * If 0, disabled. Else, specifies the period between gathering latency
     * medians in milliseconds.
     *
     * Generated from protobuf field <code>int32 median_latency_collection_interval_millis = 20;</code>
     * @return int
     */
    public function getMedianLatencyCollectionIntervalMillis()
    {
        return $this->median_latency_collection_interval_millis;
    }

    /**
     * If 0, disabled. Else, specifies the period between gathering latency
     * medians in milliseconds.
     *
     * Generated from protobuf field <code>int32 median_latency_collection_interval_millis = 20;</code>
     * @param int $var
     * @return $this
     */
    public function setMedianLatencyCollectionIntervalMillis($var)
    {
        GPBUtil::checkInt32($var);
        $this->median_latency_collection_interval_millis = $var;

        return $this;
    }

    /**
     * Number of client processes. 0 indicates no restriction.
     *
     * Generated from protobuf field <code>int32 client_processes = 21;</code>
     * @return int
     */
    public function getClientProcesses()
    {
        return $this->client_processes;
    }

    /**
     * Number of client processes. 0 indicates no restriction.
     *
     * Generated from protobuf field <code>int32 client_processes = 21;</code>
     * @param int $var
     * @return $this
     */
    public function setClientProcesses($var)
    {
        GPBUtil::checkInt32($var);
        $this->client_processes = $var;

        return $this;
    }

}

