-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add timestream client * Fixes * Fixes * Fixes * wip * Update AwsClientFactory.php * Fixes * Updated change logs
- Loading branch information
0 parents
commit 297b052
Showing
45 changed files
with
2,245 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/.github export-ignore | ||
/tests export-ignore | ||
/.gitignore export-ignore | ||
/Makefile export-ignore | ||
/phpunit.xml.dist export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# These are supported funding model platforms | ||
|
||
github: [nyholm, jderusse] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[*.yml] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Update branch alias | ||
|
||
on: | ||
push: | ||
tags: ['*'] | ||
|
||
jobs: | ||
branch-alias: | ||
name: Update branch alias | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.1 | ||
coverage: none | ||
|
||
- name: Find branch alias | ||
id: find_alias | ||
run: | | ||
TAG=$(echo $GITHUB_REF | cut -d'/' -f 3) | ||
echo "Last tag was $TAG" | ||
ARR=(${TAG//./ }) | ||
ARR[1]=$((${ARR[1]}+1)) | ||
echo ::set-output name=alias::${ARR[0]}.${ARR[1]} | ||
- name: Checkout main repo | ||
run: | | ||
git clone --branch master https://${{ secrets.BOT_GITHUB_TOKEN }}:[email protected]/async-aws/aws aws | ||
- name: Update branch alias | ||
run: | | ||
cd aws/src/Service/TimestreamQuery | ||
CURRENT_ALIAS=$(composer config extra.branch-alias.dev-master | cut -d'-' -f 1) | ||
# If there is a current value on the branch alias | ||
if [ ! -z $CURRENT_ALIAS ]; then | ||
NEW_ALIAS=${{ steps.find_alias.outputs.alias }} | ||
CURRENT_ARR=(${CURRENT_ALIAS//./ }) | ||
NEW_ARR=(${NEW_ALIAS//./ }) | ||
if [ ${CURRENT_ARR[0]} -gt ${NEW_ARR[0]} ]; then | ||
echo "The current value for major version is larger" | ||
exit 1; | ||
fi | ||
if [ ${CURRENT_ARR[0]} -eq ${NEW_ARR[0]} ] && [ ${CURRENT_ARR[1]} -gt ${NEW_ARR[1]} ]; then | ||
echo "The current value for minor version is larger" | ||
exit 1; | ||
fi | ||
fi | ||
composer config extra.branch-alias.dev-master ${{ steps.find_alias.outputs.alias }}-dev | ||
- name: Commit & push the new files | ||
run: | | ||
echo "::group::git status" | ||
cd aws | ||
git status | ||
echo "::endgroup::" | ||
git add -N . | ||
if [[ $(git diff --numstat | wc -l) -eq 0 ]]; then | ||
echo "No changes found. Exiting." | ||
exit 0; | ||
fi | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "AsyncAws Bot" | ||
echo "::group::git push" | ||
git add . | ||
git commit -m "Update branch alias" | ||
git push | ||
echo "::endgroup::" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: BC Check | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
roave-bc-check: | ||
name: Roave BC Check | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Modify composer.json | ||
run: | | ||
sed -i -re 's/"require": \{/"minimum-stability": "dev","prefer-stable": true,"require": \{/' composer.json | ||
cat composer.json | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "AsyncAws Bot" | ||
git commit -am "Allow unstable dependencies" | ||
- name: Roave BC Check | ||
uses: docker://nyholm/roave-bc-check-ga |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 10 | ||
matrix: | ||
php: ['7.2', '7.3', '7.4', '8.0', '8.1'] | ||
|
||
steps: | ||
- name: Set up PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: none | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Initialize tests | ||
run: make initialize | ||
|
||
- name: Download dependencies | ||
run: | | ||
composer config minimum-stability dev | ||
composer req symfony/phpunit-bridge --no-update | ||
composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable | ||
- name: Run tests | ||
run: ./vendor/bin/simple-phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/vendor/ | ||
*.cache | ||
composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Change Log | ||
|
||
## NOT RELEASED | ||
|
||
## 0.1.0 | ||
|
||
First version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2021 Jérémy Derussé, Tobias Nyholm | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.EXPORT_ALL_VARIABLES: | ||
|
||
initialize: start-docker | ||
start-docker: | ||
echo "Noop" | ||
|
||
test: initialize | ||
./vendor/bin/simple-phpunit | ||
|
||
clean: stop-docker | ||
stop-docker: | ||
echo "Noop" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# AsyncAws Timestream Query Client | ||
|
||
![](https://github.com/async-aws/timestream-query/workflows/Tests/badge.svg?branch=master) | ||
![](https://github.com/async-aws/timestream-query/workflows/BC%20Check/badge.svg?branch=master) | ||
|
||
An API client for Timestream Query. | ||
|
||
## Install | ||
|
||
```cli | ||
composer require async-aws/timestream-query | ||
``` | ||
|
||
## Documentation | ||
|
||
See https://async-aws.com/clients/timestream-query.html for documentation. | ||
|
||
## Contribute | ||
|
||
Contributions are welcome and appreciated. Please read https://async-aws.com/contribute/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "async-aws/timestream-query", | ||
"description": "Timestream Query client, part of the AWS SDK provided by AsyncAws.", | ||
"license": "MIT", | ||
"type": "library", | ||
"keywords": [ | ||
"aws", | ||
"amazon", | ||
"sdk", | ||
"async-aws", | ||
"timestream-query" | ||
], | ||
"require": { | ||
"php": "^7.2.5 || ^8.0", | ||
"ext-filter": "*", | ||
"ext-json": "*", | ||
"async-aws/core": "^1.9" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"AsyncAws\\TimestreamQuery\\": "src" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"AsyncAws\\TimestreamQuery\\Tests\\": "tests/" | ||
} | ||
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "0.1-dev" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" | ||
backupGlobals="false" | ||
colors="true" | ||
bootstrap="vendor/autoload.php" | ||
failOnRisky="true" | ||
failOnWarning="true" | ||
> | ||
<coverage> | ||
<include> | ||
<directory>./src</directory> | ||
</include> | ||
</coverage> | ||
<php> | ||
<ini name="error_reporting" value="-1"/> | ||
</php> | ||
<testsuites> | ||
<testsuite name="Test Suite"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace AsyncAws\TimestreamQuery\Enum; | ||
|
||
/** | ||
* Indicates if the column is of type string, integer, Boolean, double, timestamp, date, time. | ||
*/ | ||
final class ScalarType | ||
{ | ||
public const BIGINT = 'BIGINT'; | ||
public const BOOLEAN = 'BOOLEAN'; | ||
public const DATE = 'DATE'; | ||
public const DOUBLE = 'DOUBLE'; | ||
public const INTEGER = 'INTEGER'; | ||
public const INTERVAL_DAY_TO_SECOND = 'INTERVAL_DAY_TO_SECOND'; | ||
public const INTERVAL_YEAR_TO_MONTH = 'INTERVAL_YEAR_TO_MONTH'; | ||
public const TIME = 'TIME'; | ||
public const TIMESTAMP = 'TIMESTAMP'; | ||
public const UNKNOWN = 'UNKNOWN'; | ||
public const VARCHAR = 'VARCHAR'; | ||
|
||
public static function exists(string $value): bool | ||
{ | ||
return isset([ | ||
self::BIGINT => true, | ||
self::BOOLEAN => true, | ||
self::DATE => true, | ||
self::DOUBLE => true, | ||
self::INTEGER => true, | ||
self::INTERVAL_DAY_TO_SECOND => true, | ||
self::INTERVAL_YEAR_TO_MONTH => true, | ||
self::TIME => true, | ||
self::TIMESTAMP => true, | ||
self::UNKNOWN => true, | ||
self::VARCHAR => true, | ||
][$value]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace AsyncAws\TimestreamQuery\Exception; | ||
|
||
use AsyncAws\Core\Exception\Http\ClientException; | ||
use Symfony\Contracts\HttpClient\ResponseInterface; | ||
|
||
/** | ||
* You are not authorized to perform this action. | ||
*/ | ||
final class AccessDeniedException extends ClientException | ||
{ | ||
protected function populateResult(ResponseInterface $response): void | ||
{ | ||
$data = $response->toArray(false); | ||
|
||
if (null !== $v = (isset($data['message']) ? (string) $data['message'] : null)) { | ||
$this->message = $v; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace AsyncAws\TimestreamQuery\Exception; | ||
|
||
use AsyncAws\Core\Exception\Http\ClientException; | ||
use Symfony\Contracts\HttpClient\ResponseInterface; | ||
|
||
/** | ||
* Unable to poll results for a cancelled query. | ||
*/ | ||
final class ConflictException extends ClientException | ||
{ | ||
protected function populateResult(ResponseInterface $response): void | ||
{ | ||
$data = $response->toArray(false); | ||
|
||
if (null !== $v = (isset($data['message']) ? (string) $data['message'] : null)) { | ||
$this->message = $v; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace AsyncAws\TimestreamQuery\Exception; | ||
|
||
use AsyncAws\Core\Exception\Http\ClientException; | ||
use Symfony\Contracts\HttpClient\ResponseInterface; | ||
|
||
/** | ||
* Timestream was unable to fully process this request because of an internal server error. | ||
*/ | ||
final class InternalServerException extends ClientException | ||
{ | ||
protected function populateResult(ResponseInterface $response): void | ||
{ | ||
$data = $response->toArray(false); | ||
|
||
if (null !== $v = (isset($data['message']) ? (string) $data['message'] : null)) { | ||
$this->message = $v; | ||
} | ||
} | ||
} |
Oops, something went wrong.