protected function getInitialShardIterator($shard_id, $starting_sequence_number = NULL)
    {

        $args = [
            'ShardId' => $shard_id,
            'StreamName' => $this->getStreamName(),
            'ShardIteratorType' => $this->initialShardIteratorType,
        ];

        // If we have the starting sequence number update also the ShardIteratorType
        // to start reading just after it.
        if (!empty($starting_sequence_number)) {
            $args['ShardIteratorType'] = self::ITERATOR_TYPE_AFTER_SEQUENCE_NUMBER;
            $args['StartingSequenceNumber'] = $starting_sequence_number;
        }

        $res = $this->getClient()->getShardIterator($args);

        return $res->get('ShardIterator');
    }