Paws-Kinesis-MemoryCaller

 view release on metacpan or  search on metacpan

lib/Paws/Kinesis/MemoryCaller.pm  view on Meta::CPAN


The following methods have been implemented:

=over

=item *

CreateStream

=item *

DescribeStream

=item *

GetRecords

=item *

GetShardIterator

=item *

PutRecord

=item *

PutRecords

=back

=cut

use Moose;
with "Paws::Net::CallerRole";

use namespace::autoclean;
use Data::UUID;
use List::AllUtils qw(first_index);
use MIME::Base64 qw(decode_base64);

use Paws;
use Paws::Credential::Environment;

use Paws::Kinesis::DescribeStreamOutput;
use Paws::Kinesis::GetRecordsOutput;
use Paws::Kinesis::GetShardIteratorOutput;
use Paws::Kinesis::PutRecordOutput;
use Paws::Kinesis::PutRecordsOutput;

use Paws::Kinesis::PutRecord;

use Paws::Kinesis::PutRecordsResultEntry;

use Paws::Kinesis::HashKeyRange;
use Paws::Kinesis::Record;
use Paws::Kinesis::Shard;
use Paws::Kinesis::SequenceNumberRange;
use Paws::Kinesis::StreamDescription;

has store => (is => 'ro', isa => 'HashRef', default => sub { +{} });
has shard_iterator__address => (
    is => 'ro',
    isa => 'HashRef',
    default => sub { +{} },
);

=head1 METHODS

=head2 new_kinesis

Shortcut method to create a new Kinesis service instance that uses this caller.
Equivalent to:

    Paws->service('Kinesis',
        caller      => Paws::Kinesis::MemoryCaller->new(),
        credentials => Paws::Credential::Environment->new(),
        region      => "N/A",
    );

=cut

sub new_kinesis {
    my $class = shift;

    return Paws->service('Kinesis',
        caller      => $class->new(),
        credentials => Paws::Credential::Environment->new(),
        region      => "N/A",
    );
}

sub caller_to_response {}

sub do_call {
    my $self = shift;
    my ($kinesis, $action) = @_;

    my $action_class = ref $action;

    my $method = {
        "Paws::Kinesis::CreateStream"       => "_create_stream",
        "Paws::Kinesis::DescribeStream"     => "_describe_stream",
        "Paws::Kinesis::GetRecords"         => "_get_records",
        "Paws::Kinesis::GetShardIterator"   => "_get_shard_iterator",
        "Paws::Kinesis::PutRecord"          => "_put_record",
        "Paws::Kinesis::PutRecords"         => "_put_records",
    }->{$action_class} or die "($action_class) is not implemented";

    $self->$method($action);
}

sub _create_stream {
    my $self = shift;
    my ($action) = @_;

    my $last_shard = $action->ShardCount - 1;
    $last_shard >= 0
        or die "ShardCount must be greater than zero to CreateStream";

    my $shard_id__records = {



( run in 0.786 second using v1.01-cache-2.11-cpan-39bf76dae61 )