Example #1
0
 public function __construct($aws_config, $name)
 {
     $dp = new ArrayDataProvider($aws_config);
     $this->config = ['version' => "2012-11-05", "profile" => $dp->getMandatory('profile'), "region" => $dp->getMandatory('region')];
     $this->client = new SqsClient($this->config);
     $this->name = $name;
 }
 function __construct(array $msg_array)
 {
     parent::__construct($msg_array);
     $dp = new ArrayDataProvider($msg_array);
     $this->md5OfBody = $dp->getMandatory('MD5OfMessageBody', ArrayDataProvider::STRING_TYPE);
     $this->md5OfAttributes = $dp->getOptional('MD5OfMessageAttributes', ArrayDataProvider::STRING_TYPE, '');
 }
 public function __construct($aws_config, $topic_arn)
 {
     $dp = new ArrayDataProvider($aws_config);
     $this->config = ['version' => "2010-03-31", "profile" => $dp->getMandatory('profile'), "region" => $dp->getMandatory('region')];
     $this->client = new SnsClient($this->config);
     $this->topic_arn = $topic_arn;
 }
 function __construct(array $aws_config, $table_name, $attribute_types = [], $cas_field = '')
 {
     $dp = new ArrayDataProvider($aws_config);
     $this->config = ['version' => "2012-08-10", "profile" => $dp->getMandatory('profile'), "region" => $dp->getMandatory('region')];
     $this->dbClient = new DynamoDbClient($this->config);
     $this->tableName = $table_name;
     $this->attributeTypes = $attribute_types;
     $this->casField = $cas_field;
 }
 function __construct(array $msg_array)
 {
     parent::__construct($msg_array);
     $dp = new ArrayDataProvider($msg_array);
     $this->receiptHandle = $dp->getMandatory('ReceiptHandle', ArrayDataProvider::STRING_TYPE);
     $this->body = $dp->getMandatory('Body', ArrayDataProvider::STRING_TYPE);
     $this->md5OfBody = $dp->getMandatory('MD5OfBody', ArrayDataProvider::STRING_TYPE);
     $this->attributes = $dp->getOptional('MessageAttributes', ArrayDataProvider::ARRAY_TYPE, []);
     $this->md5OfAttributes = $dp->getOptional('MD5OfMessageAttributes', ArrayDataProvider::STRING_TYPE, '');
     $this->validate();
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $dataSourceFile = __DIR__ . "/data_source.yml";
     $config = Yaml::parse(file_get_contents($dataSourceFile));
     $dp = new ArrayDataProvider($config);
     $awsConfig = $dp->getMandatory('aws', DataProviderInterface::ARRAY_TYPE);
     self::$s3Region = $dp->getMandatory('aws.region', DataProviderInterface::STRING_TYPE);
     self::$sts = new StsClient($awsConfig);
     $s3 = new S3Client($awsConfig);
     self::$localFs = new ExtendedFilesystem(new ExtendedLocal(sys_get_temp_dir()));
     self::$s3Fs = new ExtendedFilesystem(new ExtendedAwsS3Adapter($s3, $dp->getMandatory('aws.s3bucket', DataProviderInterface::STRING_TYPE), $dp->getMandatory('aws.s3prefix', DataProviderInterface::STRING_TYPE)));
     self::$rs = RedshiftConnection::getConnection($dp->getMandatory('redshift', DataProviderInterface::ARRAY_TYPE));
 }
 function __construct(array $arr_message)
 {
     $dp = new ArrayDataProvider($arr_message);
     $this->messageId = $dp->getMandatory('MessageId', ArrayDataProvider::STRING_TYPE);
 }
 public function __construct(array $awsConfig)
 {
     $dp = new ArrayDataProvider($awsConfig);
     $this->config = ['version' => "2012-08-10", "profile" => $dp->getMandatory('profile'), "region" => $dp->getMandatory('region')];
     $this->db = new DynamoDbClient($this->config);
 }
Example #9
0
 public function getOptionalConfig($key, $expectedType = AbstractDataProvider::STRING_TYPE, $defaultValue = null)
 {
     // normalize key
     $key = strtr($key, ['-' => "_"]);
     return $this->configDataProvider->getOptional($key, $expectedType, $defaultValue);
 }
 public function testOptionalExist()
 {
     self::assertEquals(true, $this->dp->getOptional("bool", ArrayDataProvider::BOOL_TYPE, false));
 }