Amazon-SQS-Client

 view release on metacpan or  search on metacpan

lib/Amazon/SQS/Client.pm  view on Meta::CPAN

  if ( @args > 2 ) {
    if ( ref $args[2] ) {
      $client_options = $args[2];
    }
    else {
      $client_options = $args[3] // {};
      $client_options->{SecurityToken} = $args[2];
    }
  }

  return $class->SUPER::new(
    { aws_access_key_id     => $args[0],
      aws_secret_access_key => $args[1],
      $client_options->{SecurityToken} ? ( token    => $client_options->{SecurityToken} ) : (),
      $client_options->{loglevel}      ? ( loglevel => $client_options->{loglevel} )      : (),
    }
  );
}

################################################################################
#  Copyright 2008 Amazon Technologies, Inc.

lib/Amazon/SQS/Client.pm  view on Meta::CPAN

      $options = { %{$options}, %{ $args[2] } };
    }
  }
  else {
    $options = ref $args[2] ? $args[2] : {};
    $options->{credentials} //= Amazon::Credentials->new();
  }

  set_defaults($options);

  my $self = $class->SUPER::new($options);

  $self->init_v4_signer;

  return $self;
}

########################################################################
sub set_defaults {
########################################################################
  my ($options) = @_;

lib/Amazon/SQS/Config.pm  view on Meta::CPAN


use parent qw(Class::Accessor::Fast);

########################################################################
sub new {
########################################################################
  my ( $class, @args ) = @_;

  my $options = ref $args[0] ? $args[0] : {@args};

  my $self = $class->SUPER::new($options);

  my $file = $self->get_file;

  die "file is a required argument\n"
    if !$file;

  die sprintf "no such file: [%s]\n", $file
    if !openhandle($file) && !-e $file;

  my $config = Config::IniFiles->new(

lib/Amazon/SQS/QueueHandler.pm  view on Meta::CPAN

our $FALSE = 0;

########################################################################
sub new {
########################################################################
  my ( $class, @args ) = @_;

  my $options = ref $args[0] ? $args[0] : {@args};

  $options->{credentials} //= Amazon::Credentials->new;
  my $self = $class->SUPER::new($options);

  $self->init_defaults();

  $self->create_service();

  if ( $self->get_name && !$self->get_url ) {
    my %queue_list = reverse $self->list_queues();

    if ( $self->get_create_queue ) {
      $self->create_queue( $self->get_name );

lib/Amazon/SQS/Sample.pm  view on Meta::CPAN

  foreach my $var ( keys %{$options} ) {
    next
      if $var !~ /\-/xsm;

    my $val = $options->{$var};

    $var =~ s/\-/_/xsmg;
    $options->{$var} = $val;
  }

  my $self = $class->SUPER::new($options);

  my $config;

  if ( $self->get_file ) {
    $config = Amazon::SQS::Config->new( file => $self->get_file );

    $self->set_config($config);
  }

  my $endpoint_url = $self->get_endpoint_url;



( run in 1.163 second using v1.01-cache-2.11-cpan-49f99fa48dc )