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

namespace Google\Cloud\Datastream\V1\CdcStrategy;

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

/**
 * CDC strategy to start replicating from a specific position in the source.
 *
 * Generated from protobuf message <code>google.cloud.datastream.v1.CdcStrategy.SpecificStartPosition</code>
 */
class SpecificStartPosition extends \Google\Protobuf\Internal\Message
{
    protected $position;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Datastream\V1\MysqlLogPosition $mysql_log_position
     *           MySQL specific log position to start replicating from.
     *     @type \Google\Cloud\Datastream\V1\OracleScnPosition $oracle_scn_position
     *           Oracle SCN to start replicating from.
     *     @type \Google\Cloud\Datastream\V1\SqlServerLsnPosition $sql_server_lsn_position
     *           SqlServer LSN to start replicating from.
     *     @type \Google\Cloud\Datastream\V1\MysqlGtidPosition $mysql_gtid_position
     *           MySQL GTID set to start replicating from.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Datastream\V1\DatastreamResources::initOnce();
        parent::__construct($data);
    }

    /**
     * MySQL specific log position to start replicating from.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.MysqlLogPosition mysql_log_position = 101;</code>
     * @return \Google\Cloud\Datastream\V1\MysqlLogPosition|null
     */
    public function getMysqlLogPosition()
    {
        return $this->readOneof(101);
    }

    public function hasMysqlLogPosition()
    {
        return $this->hasOneof(101);
    }

    /**
     * MySQL specific log position to start replicating from.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.MysqlLogPosition mysql_log_position = 101;</code>
     * @param \Google\Cloud\Datastream\V1\MysqlLogPosition $var
     * @return $this
     */
    public function setMysqlLogPosition($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Datastream\V1\MysqlLogPosition::class);
        $this->writeOneof(101, $var);

        return $this;
    }

    /**
     * Oracle SCN to start replicating from.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.OracleScnPosition oracle_scn_position = 102;</code>
     * @return \Google\Cloud\Datastream\V1\OracleScnPosition|null
     */
    public function getOracleScnPosition()
    {
        return $this->readOneof(102);
    }

    public function hasOracleScnPosition()
    {
        return $this->hasOneof(102);
    }

    /**
     * Oracle SCN to start replicating from.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.OracleScnPosition oracle_scn_position = 102;</code>
     * @param \Google\Cloud\Datastream\V1\OracleScnPosition $var
     * @return $this
     */
    public function setOracleScnPosition($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Datastream\V1\OracleScnPosition::class);
        $this->writeOneof(102, $var);

        return $this;
    }

    /**
     * SqlServer LSN to start replicating from.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.SqlServerLsnPosition sql_server_lsn_position = 103;</code>
     * @return \Google\Cloud\Datastream\V1\SqlServerLsnPosition|null
     */
    public function getSqlServerLsnPosition()
    {
        return $this->readOneof(103);
    }

    public function hasSqlServerLsnPosition()
    {
        return $this->hasOneof(103);
    }

    /**
     * SqlServer LSN to start replicating from.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.SqlServerLsnPosition sql_server_lsn_position = 103;</code>
     * @param \Google\Cloud\Datastream\V1\SqlServerLsnPosition $var
     * @return $this
     */
    public function setSqlServerLsnPosition($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Datastream\V1\SqlServerLsnPosition::class);
        $this->writeOneof(103, $var);

        return $this;
    }

    /**
     * MySQL GTID set to start replicating from.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.MysqlGtidPosition mysql_gtid_position = 104;</code>
     * @return \Google\Cloud\Datastream\V1\MysqlGtidPosition|null
     */
    public function getMysqlGtidPosition()
    {
        return $this->readOneof(104);
    }

    public function hasMysqlGtidPosition()
    {
        return $this->hasOneof(104);
    }

    /**
     * MySQL GTID set to start replicating from.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.MysqlGtidPosition mysql_gtid_position = 104;</code>
     * @param \Google\Cloud\Datastream\V1\MysqlGtidPosition $var
     * @return $this
     */
    public function setMysqlGtidPosition($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Datastream\V1\MysqlGtidPosition::class);
        $this->writeOneof(104, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getPosition()
    {
        return $this->whichOneof("position");
    }

}

